You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+69-5Lines changed: 69 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,11 +14,11 @@ This repository allows you to quickly install Apache Solr for Drupal 9+ into a [
14
14
15
15
## Installation on Drupal 9+
16
16
17
-
1.`ddev add-on get ddev/ddev-drupal-solr && ddev restart`
17
+
1.Install this add-on: `ddev add-on get ddev/ddev-drupal-solr && ddev restart`
18
18
2. You may need to install the relevant Drupal requirements: `ddev composer require drush/drush drupal/search_api_solr`
19
19
3. Enable the `search_api_solr` module either using the web interface or `ddev drush en -y search_api_solr`
20
20
4. Create a Search API server at `admin/config/search/search-api` -> "Add server"
21
-
5.Create a server with the following settings
21
+
5.Configure the server with the following settings:
22
22
* Set "Server name" to anything you want. Maybe `ddev-solr-server`.
23
23
* Set "Backend" to `Solr`
24
24
* Configure Solr backend
@@ -29,13 +29,75 @@ This repository allows you to quickly install Apache Solr for Drupal 9+ into a [
29
29
30
30
6.`ddev restart`
31
31
32
+
## Installation on Drupal 7
33
+
34
+
### Ddev / Solr configuration
35
+
36
+
1. Install this add-on: `ddev add-on get ddev/ddev-drupal-solr`
37
+
2. Set the version of Solr verison 7: Edit the `.ddev/docker-compose.solr.yaml` file. Replace `image: solr:8` with `image: solr:7` on line 34.
38
+
3. Add the schema needed for version 7: Defaults can be found in the Search API Solr in the `search_api_solr/solr-conf/7.x` directory . Copy these files into `.ddev/solr/conf`.
39
+
4. Restart Ddev: `ddev restart`.
40
+
5. Confirm Solr is working by visiting `http://<projectname>.ddev.site:8983/solr/`.
41
+
6. If the Ddev drush version is too new for Drupal 7, you may need to symlink `drush` to the `drush8` provided with Ddev. You can do this by adding a `post-start` hook inside your `.ddev/config.yaml` file as follows
1. You may need to install the relevant Drupal modules: `ddev drush dl search_api_solr`.
51
+
2. Enable the `search_api_solr` module either using the web interface or `ddev drush en -y search_api_solr`
52
+
4. Create a Search API server at `admin/config/search/search-api` -> "Add server"
53
+
5. Configure the server with the following settings:
54
+
* Set "Server name" to anything you want. Maybe `ddev-solr-server`.
55
+
* Set "Protocol" to `http`
56
+
* Set "Solr host" to `solr`
57
+
* Set "Solr port" to `8983`
58
+
* Set "path" to `/solr/dev`.
59
+
The "Solr server URI" should be `http://solr:8983/solr/dev` when done.
60
+
6. Create a Search API index at `admin/config/search/search-api` -> "Add index"
61
+
7. Configure the index as needed, but this is common:
62
+
* Set "Server name" to anything you want. Maybe `ddev-solr-index-content`.
63
+
* Set "item type" to `content`
64
+
* Set the server to `ddev-solr-server` (or whaver the name is)
65
+
* Index the site.
66
+
8. Build a new view of indexed content `ddev-solr-index-content` (or whatever the name is)
67
+
7. Configure the view as needed, but this is common:
68
+
* Set "View name" to anything you want. Maybe `Solr Search`.
69
+
* Set "Show" to `ddev-solr-index-content` (or whatever the name is)
70
+
* Tick the box for "Create a page"
71
+
* Set the "Page title" to `Search` or whatever you prefer
72
+
* Set the "Path" to `/search` or whatever you prefer
73
+
* Set "Display format" to `HTML list` + `OL` / `Rendered entity` + `Search result` view mode
74
+
* Continue and edit
75
+
* Add filters:
76
+
* Add an EXPOSED filter for `Search: Fulltext search (exposed)`
77
+
* Add additional filters as needed (recommended: `Indexed Content: Status (= Published)`)
78
+
* Add sort criteria:
79
+
* Add a sort on `Search: Relevance (desc)`
80
+
* Set "access control: to `Permission` / `View published content`
81
+
* Set "Exposed form style" to `Input required`
82
+
* Set "No Results behavior" to `Global:text` / `No results matched your search.`
83
+
* (Optional) Set "Exposed form in block" setting
84
+
85
+
32
86
## Outdated Solr config files
33
87
34
88
If you get a message about Solr having outdated config files, you need to update the included Solr config files.
35
89
90
+
### Drupal 9+:
91
+
36
92
1. Click "Get config.zip" on the server page
37
93
2. Unzip the files, and put the config files into `.ddev/solr/conf/`
38
-
3. Run `ddev restart`
94
+
3. Restart Ddev: `ddev restart`
95
+
96
+
### Drupal 7
97
+
98
+
1. Locate the example files in the `search_api_solr/solr-conf/7.x` directory .
99
+
2. Copy these files into `.ddev/solr/conf`.
100
+
4. Restart Ddev: `ddev restart`.
39
101
40
102
### Other frameworks
41
103
@@ -45,7 +107,7 @@ See [the documentation in the `doc` folder](doc/README.md)
45
107
46
108
This is the classic Drupal `solr:8` image recipe used for a long time by Drupal users and compatible with `search_api_solr`.
47
109
48
-
*It installs a [`.ddev/docker-compose.solr.yaml`](docker-compose.solr.yaml) using the solr:8 docker image.
110
+
*This add-on installs a [`.ddev/docker-compose.solr.yaml`](docker-compose.solr.yaml) using the `solr:8` docker image.
49
111
* A standard Drupal 9+ Solr configuration is included in [.ddev/solr/conf](solr/conf).
50
112
* A [.ddev/docker-entrypoint-initdb.d/solr-configupdate.sh](solr/docker-entrypoint-initdb.d/solr-configupdate.sh) is included and mounted into the Solr container so that you can change Solr config in `.ddev/solr/conf` with just a `ddev restart`.
51
113
@@ -72,4 +134,6 @@ You can delete the "dev" core from `http://<projectname>.ddev.site:8983/solr/#/~
72
134
73
135
## Caveats
74
136
75
-
* This recipe won't work with versions of Solr before `solr:8`, and Acquia's hosting [requires Solr 7](https://docs.acquia.com/acquia-search/). You'll want to see the [contributed recipes](https://github.com/ddev/ddev-contrib) for older versions of Solr.
137
+
* This recipe is designed for versions of Solr `solr:8` and beyond. Acquia's hosting [requires Solr 7](https://docs.acquia.com/acquia-search/). You'll want to follow the Drupal 7 instructions above, or see the [contributed recipes](https://github.com/ddev/ddev-contrib) for older versions of Solr.
0 commit comments