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
+66-4Lines changed: 66 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ This add-on integrates Solr for Drupal 9+ into your [DDEV](https://ddev.com/) pr
33
33
ddev drush en -y search_api_solr
34
34
```
35
35
4. Create a Search API server at `admin/config/search/search-api` -> "Add server"
36
-
5.Create a server with the following settings
36
+
5.Configure the server with the following settings:
37
37
* Set "Server name" to anything you want. Maybe `ddev-solr-server`.
38
38
* Set "Backend" to `Solr`
39
39
* Configure Solr backend
@@ -43,13 +43,75 @@ This add-on integrates Solr for Drupal 9+ into your [DDEV](https://ddev.com/) pr
43
43
* Under "Advanced server configuration" set the "solr.install.dir" to `/opt/solr`.
44
44
6.`ddev restart`
45
45
46
-
### Outdated Solr config files
46
+
## Installation on Drupal 7
47
+
48
+
### Ddev / Solr configuration
49
+
50
+
1. Install this add-on: `ddev add-on get ddev/ddev-drupal-solr`
51
+
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.
52
+
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`.
53
+
4. Restart Ddev: `ddev restart`.
54
+
5. Confirm Solr is working by visiting `http://<projectname>.ddev.site:8983/solr/`.
55
+
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`.
66
+
2. Enable the `search_api_solr` module either using the web interface or `ddev drush en -y search_api_solr`
67
+
4. Create a Search API server at `admin/config/search/search-api` -> "Add server"
68
+
5. Configure the server with the following settings:
69
+
* Set "Server name" to anything you want. Maybe `ddev-solr-server`.
70
+
* Set "Protocol" to `http`
71
+
* Set "Solr host" to `solr`
72
+
* Set "Solr port" to `8983`
73
+
* Set "path" to `/solr/dev`.
74
+
The "Solr server URI" should be `http://solr:8983/solr/dev` when done.
75
+
6. Create a Search API index at `admin/config/search/search-api` -> "Add index"
76
+
7. Configure the index as needed, but this is common:
77
+
* Set "Server name" to anything you want. Maybe `ddev-solr-index-content`.
78
+
* Set "item type" to `content`
79
+
* Set the server to `ddev-solr-server` (or whaver the name is)
80
+
* Index the site.
81
+
8. Build a new view of indexed content `ddev-solr-index-content` (or whatever the name is)
82
+
7. Configure the view as needed, but this is common:
83
+
* Set "View name" to anything you want. Maybe `Solr Search`.
84
+
* Set "Show" to `ddev-solr-index-content` (or whatever the name is)
85
+
* Tick the box for "Create a page"
86
+
* Set the "Page title" to `Search` or whatever you prefer
87
+
* Set the "Path" to `/search` or whatever you prefer
88
+
* Set "Display format" to `HTML list` + `OL` / `Rendered entity` + `Search result` view mode
89
+
* Continue and edit
90
+
* Add filters:
91
+
* Add an EXPOSED filter for `Search: Fulltext search (exposed)`
92
+
* Add additional filters as needed (recommended: `Indexed Content: Status (= Published)`)
93
+
* Add sort criteria:
94
+
* Add a sort on `Search: Relevance (desc)`
95
+
* Set "access control: to `Permission` / `View published content`
96
+
* Set "Exposed form style" to `Input required`
97
+
* Set "No Results behavior" to `Global:text` / `No results matched your search.`
98
+
* (Optional) Set "Exposed form in block" setting
99
+
100
+
## Outdated Solr config files
47
101
48
102
If you get a message about Solr having outdated config files, you need to update the included Solr config files.
49
103
104
+
### Drupal 9+:
105
+
50
106
1. Click "Get config.zip" on the server page
51
107
2. Unzip the files, and put the config files into `.ddev/solr/conf/`
52
-
3. Run `ddev restart`
108
+
3. Restart Ddev: `ddev restart`
109
+
110
+
### Drupal 7
111
+
112
+
1. Locate the example files in the `search_api_solr/solr-conf/7.x` directory .
113
+
2. Copy these files into `.ddev/solr/conf`.
114
+
4. Restart Ddev: `ddev restart`.
53
115
54
116
### Other frameworks
55
117
@@ -68,7 +130,7 @@ See [the documentation in the `doc` folder](doc/README.md)
68
130
69
131
This originates from the classic Drupal `solr:8` image recipe used for a long time by Drupal users and compatible with `search_api_solr`.
70
132
71
-
*It installs a [`.ddev/docker-compose.solr.yaml`](docker-compose.solr.yaml) using the `solr:8` docker image.
133
+
*This add-on installs a [`.ddev/docker-compose.solr.yaml`](docker-compose.solr.yaml) using the `solr:8` docker image.
72
134
* A standard Drupal 9+ Solr configuration is included in [.ddev/solr/conf](solr/conf).
73
135
* 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`.
0 commit comments