├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ └── feature_request.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── tests.yml ├── LICENSE ├── README.md ├── doc ├── README.md └── Silverstripe.md ├── docker-compose.solr.yaml ├── install.yaml ├── solr ├── conf │ ├── accents_en.txt │ ├── accents_und.txt │ ├── elevate.xml │ ├── protwords_en.txt │ ├── protwords_und.txt │ ├── schema.xml │ ├── schema_extra_fields.xml │ ├── schema_extra_types.xml │ ├── solrconfig.xml │ ├── solrconfig_extra.xml │ ├── solrconfig_index.xml │ ├── solrconfig_query.xml │ ├── solrconfig_requestdispatcher.xml │ ├── solrcore.properties │ ├── stopwords_en.txt │ ├── stopwords_und.txt │ ├── synonyms_en.txt │ └── synonyms_und.txt └── docker-entrypoint-initdb.d │ └── solr-configupdate.sh └── tests ├── test.bats └── testdata └── db.sql.gz /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: 🐞 Bug report or Support Request 2 | description: Create a report to help us improve. 3 | labels: [bug] 4 | body: 5 | - type: checkboxes 6 | attributes: 7 | label: Preliminary checklist 8 | description: Please complete the following checks before submitting an issue. 9 | options: 10 | - label: I am using the latest stable version of DDEV 11 | required: true 12 | - label: I am using the latest stable version of this add-on 13 | required: true 14 | - type: textarea 15 | attributes: 16 | label: Expected Behavior 17 | description: What did you expect to happen? 18 | validations: 19 | required: true 20 | - type: textarea 21 | attributes: 22 | label: Actual Behavior 23 | description: What actually happened instead? 24 | validations: 25 | required: true 26 | - type: textarea 27 | attributes: 28 | label: Steps To Reproduce 29 | description: Specific steps to reproduce the behavior. 30 | placeholder: | 31 | 1. In this environment... 32 | 2. With this config... 33 | 3. Run `...` 34 | 4. See error... 35 | validations: 36 | required: false 37 | - type: textarea 38 | attributes: 39 | label: Anything else? 40 | description: | 41 | Links? References? Screenshots? Anything that will give us more context about your issue! 42 | 43 | 💡 Attach images or log files by clicking this area to highlight it and dragging files in. 44 | validations: 45 | required: false 46 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: 🚀 Feature request 2 | description: Suggest an idea for this project. 3 | labels: [enhancement] 4 | body: 5 | - type: checkboxes 6 | attributes: 7 | label: Is there an existing issue for this? 8 | description: Please search existing issues to see if one already exists for your request. 9 | options: 10 | - label: I have searched the existing issues 11 | required: true 12 | - type: textarea 13 | attributes: 14 | label: Is your feature request related to a problem? 15 | description: Clearly and concisely describe the problem. (Ex. I'm always frustrated when...) 16 | validations: 17 | required: true 18 | - type: textarea 19 | attributes: 20 | label: Describe your solution 21 | description: Clearly and concisely describe what you want to happen. 22 | validations: 23 | required: true 24 | - type: textarea 25 | attributes: 26 | label: Describe alternatives 27 | description: Clearly and concisely describe any alternative solutions or features you've considered. 28 | validations: 29 | required: false 30 | - type: textarea 31 | attributes: 32 | label: Additional context 33 | description: Add any other context or screenshots about the feature request. 34 | validations: 35 | required: false 36 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## The Issue 2 | 3 | - # 4 | 5 | 6 | 7 | ## How This PR Solves The Issue 8 | 9 | ## Manual Testing Instructions 10 | 11 | ```bash 12 | ddev add-on get https://github.com///tarball/ 13 | ddev restart 14 | ``` 15 | 16 | ## Automated Testing Overview 17 | 18 | 19 | 20 | ## Release/Deployment Notes 21 | 22 | 23 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: tests 2 | on: 3 | pull_request: 4 | push: 5 | branches: [ main ] 6 | 7 | schedule: 8 | - cron: '25 08 * * *' 9 | 10 | workflow_dispatch: 11 | inputs: 12 | debug_enabled: 13 | type: boolean 14 | description: Debug with tmate 15 | required: false 16 | default: false 17 | 18 | concurrency: 19 | group: ${{ github.workflow }}-${{ github.ref }} 20 | cancel-in-progress: true 21 | 22 | # This is required for "gautamkrishnar/keepalive-workflow", see "ddev/github-action-add-on-test" 23 | permissions: 24 | actions: write 25 | 26 | jobs: 27 | tests: 28 | strategy: 29 | matrix: 30 | ddev_version: [stable, HEAD] 31 | fail-fast: false 32 | 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - uses: ddev/github-action-add-on-test@v2 37 | with: 38 | ddev_version: ${{ matrix.ddev_version }} 39 | token: ${{ secrets.GITHUB_TOKEN }} 40 | debug_enabled: ${{ github.event.inputs.debug_enabled }} 41 | addon_repository: ${{ env.GITHUB_REPOSITORY }} 42 | addon_ref: ${{ env.GITHUB_REF }} 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![add-on registry](https://img.shields.io/badge/DDEV-Add--on_Registry-blue)](https://addons.ddev.com) 2 | [![tests](https://github.com/ddev/ddev-drupal-solr/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/ddev/ddev-drupal-solr/actions/workflows/tests.yml?query=branch%3Amain) 3 | [![last commit](https://img.shields.io/github/last-commit/ddev/ddev-drupal-solr)](https://github.com/ddev/ddev-drupal-solr/commits) 4 | [![release](https://img.shields.io/github/v/release/ddev/ddev-drupal-solr)](https://github.com/ddev/ddev-drupal-solr/releases/latest) 5 | 6 | # DDEV Drupal Solr 7 | 8 | ## What is the difference between this and ddev-solr 9 | 10 | Please consider using [ddev/ddev-solr](https://github.com/ddev/ddev-solr), which runs Solr in the modern "Cloud" mode. This offers several advantages. If you are using Drupal, the biggest advantage 11 | is that you can update the Solr Configset from the UI or with a Drush command everytime you update `search_api_solr`. 12 | 13 | The current addon runs in "classic standalone" mode. It is probably simpler at first to setup, but comes with the added maintainance steps for configsets. Most Solr hosting service providers run "Solr Cloud" as a backend. 14 | 15 | ## Overview 16 | 17 | [Apache Solr](https://solr.apache.org/) is the blazing-fast, open source, multi-modal search platform built on the full-text, vector, and geospatial search capabilities of Apache Lucene™. 18 | 19 | This add-on integrates Solr for Drupal 9+ into your [DDEV](https://ddev.com/) project. It follows the [Setting up Solr (single core) - the classic way](https://git.drupalcode.org/project/search_api_solr/-/blob/4.x/README.md#setting-up-solr-single-core-the-classic-way) recipe. 20 | 21 | ## Installation on Drupal 9+ 22 | 23 | 1. ```bash 24 | ddev add-on get ddev/ddev-drupal-solr 25 | ddev restart 26 | ``` 27 | 2. You may need to install the relevant Drupal requirements: 28 | ```bash 29 | ddev composer require drush/drush drupal/search_api_solr 30 | ``` 31 | 3. Enable the `search_api_solr` module either using the web interface or 32 | ```bash 33 | ddev drush en -y search_api_solr 34 | ``` 35 | 4. Create a Search API server at `admin/config/search/search-api` -> "Add server" 36 | 5. Create a server with the following settings 37 | * Set "Server name" to anything you want. Maybe `ddev-solr-server`. 38 | * Set "Backend" to `Solr` 39 | * Configure Solr backend 40 | * Set "Solr Connector" to `Standard` 41 | * Set "Solr host" to `solr` 42 | * Set "solr core" to `dev` 43 | * Under "Advanced server configuration" set the "solr.install.dir" to `/opt/solr`. 44 | 6. `ddev restart` 45 | 46 | ### Outdated Solr config files 47 | 48 | If you get a message about Solr having outdated config files, you need to update the included Solr config files. 49 | 50 | 1. Click "Get config.zip" on the server page 51 | 2. Unzip the files, and put the config files into `.ddev/solr/conf/` 52 | 3. Run `ddev restart` 53 | 54 | ### Other frameworks 55 | 56 | See [the documentation in the `doc` folder](doc/README.md) 57 | 58 | ## Usage 59 | 60 | | Command | Description | 61 | | ------- | ----------- | 62 | | `ddev launch :8943` | Open Solr Admin (HTTPS) in your browser (`https://.ddev.site:8943`) | 63 | | `ddev launch :8983` | Open Solr Admin (HTTP) in your browser (`http://.ddev.site:8983`) | 64 | | `ddev describe` | View service status and used ports for Solr | 65 | | `ddev logs -s solr` | Check Solr logs | 66 | 67 | ## Explanation 68 | 69 | 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 | 71 | * It installs a [`.ddev/docker-compose.solr.yaml`](docker-compose.solr.yaml) using the `solr:8` docker image. 72 | * A standard Drupal 9+ Solr configuration is included in [.ddev/solr/conf](solr/conf). 73 | * 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`. 74 | 75 | ## Interacting with Apache Solr 76 | 77 | * The Solr Admin interface will be accessible at: `https://.ddev.site:8943/solr/` and `http://.ddev.site:8983/solr/`. For example, if the project is named `myproject` the hostname will be: `https://myproject.ddev.site:8943/solr/`. 78 | * To access the Solr container from inside the web container use: `http://solr:8983/solr/` 79 | * A Solr core is automatically created by default with the name "dev"; it can be accessed (from inside the web container) at the URL: `http://solr:8983/solr/dev` or from the host at `https://.ddev.site:8943/solr/#/~cores/dev`. You can obviously create other cores to meet your needs. 80 | 81 | ## Alternate Core Name 82 | 83 | If you want to use a core name other than the default "dev", add a `.ddev/docker-compose.solr-env.yaml` with these contents, using the core name you want to use: 84 | 85 | ```yaml 86 | services: 87 | solr: 88 | environment: 89 | - SOLR_CORENAME=somecorename 90 | ``` 91 | 92 | 1. Change `SOLR_CORENAME` environment variable in the `environment:` section. 93 | 2. Change your Drupal configuration to use the new core. 94 | 95 | You can delete the "dev" core from `https://.ddev.site:8943/solr/#/~cores/dev` by clicking "Unload". 96 | 97 | ## Multiple Solr Cores 98 | 99 | If you would like to use more than one Solr core, add a `.ddev/docker-compose.solr_extra.yaml` to override some of the default configuration. 100 | 101 | 1. Define a mount point for each core you require. Add new mount points for each core, for example: 102 | 103 | ```yaml 104 | services: 105 | solr: 106 | volumes: 107 | - ./solr:/solr-conf 108 | - ./core2:/core2-conf 109 | - ./core3:/core3-conf 110 | ``` 111 | 112 | 2. Create the directories for your new cores' config, and copy the desired solr config in to it, eg: 113 | 114 | ```bash 115 | cp -R .ddev/solr .ddev/core2 116 | cp -R .ddev/solr .ddev/core3 117 | cp -R path/to/core2-config/* .ddev/core2/conf/ 118 | cp -R path/to/core3-config/* .ddev/core3/conf/ 119 | ``` 120 | 121 | 3. Set the `entrypoint` value to use `precreate-core` instead of `solr-precreate` and add the additional cores, along with a command to start solr afterwards: 122 | 123 | ```yaml 124 | services: 125 | solr: 126 | entrypoint: 'bash -c "VERBOSE=yes docker-entrypoint.sh precreate-core solrconf /solr-conf ; precreate-core core2 /core2-conf ; precreate-core core3 /core3-conf ; exec solr -f "' 127 | ``` 128 | 129 | 4. Your finished `.ddev/docker-compose.solr_extra.yaml` file should now look something like this: 130 | 131 | ```yaml 132 | services: 133 | solr: 134 | volumes: 135 | - ./solr:/solr-conf 136 | - ./core2:/core2-conf 137 | - ./core3:/core3-conf 138 | entrypoint: 'bash -c "VERBOSE=yes docker-entrypoint.sh precreate-core solrconf /solr-conf ; precreate-core core2 /core2-conf ; precreate-core core3 /core3-conf ; exec solr -f "' 139 | ``` 140 | 141 | 5. Finally, `ddev restart` to pick up the changes and create the new cores. 142 | 143 | ## Caveats 144 | 145 | * This recipe won't work with versions of Solr before `solr:8`, and Acquia's hosting [requires Solr 7](https://docs.acquia.com/acquia-cloud-platform/docs/features/acquia-search). You'll want to see the [contributed recipes](https://github.com/ddev/ddev-contrib) for older versions of Solr. 146 | 147 | ## Credits 148 | 149 | **Contributed by [@rfay](https://github.com/rfay)** 150 | 151 | **Maintained by [@mkalkbrenner](https://github.com/mkalkbrenner), [@bserem](https://github.com/bserem), and the [DDEV team](https://ddev.com/support-ddev/)** 152 | -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | # Usage of this container in other frameworks 2 | 3 | [Silverstripe](Silverstripe.md) -------------------------------------------------------------------------------- /doc/Silverstripe.md: -------------------------------------------------------------------------------- 1 | # Installation and usage on Silverstripe 4+ 2 | 3 | 1. `ddev add-on get ddev/ddev-drupal9-solr && ddev restart` 4 | 2. Install the required/relevant Silverstripe requirements: `ddev composer require firesphere/solr-search` 5 | * Note that there are currently some known issues around Guzzle dependencies in the module, that are currently in the process of being resolved. 6 | 3. Solr is set to use the FileConfigStore. Ensure its data location is at `.ddev/solr` and the host is set to `solr`: 7 | ```yml 8 | --- 9 | Name: LocalSolrSearch 10 | After: 11 | - 'SolrSearch' 12 | Only: 13 | environment: 'dev' 14 | --- 15 | Firesphere\SolrSearch\Services\SolrCoreService: 16 | config: 17 | endpoint: 18 | localhost: 19 | host: solr 20 | store: 21 | path: './.ddev/solr' 22 | Firesphere\SolrSearch\Indexes\BaseIndex: 23 | dev: 24 | Classes: 25 | - Page 26 | FulltextFields: 27 | - Title 28 | - Content 29 | ``` 30 | 4. Edit `.ddev/docker-compose.solr.yml` and on line 60, change `- ./solr:/solr-conf` to `- ./solr/{your-core-name}:/solr-conf` 31 | * Historically, Silverstripe uses the name of the core as sub-folder for the location of the core, which is why the location in the YML needs updating. 32 | * [Refer to the documentation of the Silverstripe Solr module](https://firesphere.github.io/solr-docs/) for how to configure it. 33 | * Remove the `#ddev-generated` line from the yml. 34 | 5. Run the Silverstripe Solr configuration command `ddev exec sake dev/tasks/SolrConfigureTask` or with the ddev-contrib add-on installed `ddev sake dev/tasks/SolrConfigureTask` 35 | 6. Restart ddev with `ddev restart` 36 | 7. Now your core configuration should be visible in Solr by visiting {yourproject}.ddev.site:8983, and check the schema for `dev`* 37 | 8. Now you can add documents, update your index, etc. [as per the documentation](https://firesphere.github.io/solr-docs/). 38 | * **NOTE** You will need to restart your solr engine, every time you change your core configuration with `ddev restart`. 39 | * **NOTE** Be aware you'll need to either rename or copy your Solr configuration, for production environments and update it as such. 40 | 41 | ## Core name in Silverstripe 42 | 43 | At point 7, it is mentioned that the core will be named `dev` in the Solr administration interface. This is because the mountpoint 44 | from the YML is updated to take the Silverstripe generated Solr configuration and treat it as if it is the `dev` core. 45 | 46 | In Silverstripe, if you change the name of your core, you will also have to update the mount point in the `.ddev/docker-compose.solr.yml` configuration (point 4 above). 47 | -------------------------------------------------------------------------------- /docker-compose.solr.yaml: -------------------------------------------------------------------------------- 1 | # DDEV Apache Solr recipe file. 2 | #ddev-generated 3 | # 4 | # 5 | # To use this in your own project: 6 | # 1. Copy this file to your project's ".ddev" directory. 7 | # 2. Create the folder path ".ddev/solr/conf". 8 | # 3. Copy the Solr configuration files for the appropriate plugin/module to 9 | # ".ddev/solr/conf". For example, using Drupal 8's Search API Solr module, 10 | # you'll get the config files as a file config.zip from 11 | # /admin/config/search/search-api/server/solr and unzip it into .ddev/solr/conf 12 | # so that a file exists with the path ".ddev/solr/conf/solrconfig.xml". 13 | # 14 | # To access Solr after it is installed: 15 | # - The Solr admin interface will be accessible at: 16 | # http://.ddev.site:8983/solr/ 17 | # For example, if the project is named "myproject" the hostname will be: 18 | # http://myproject.ddev.site:8983/solr/ 19 | # - To access the Solr container from the web container use: 20 | # http://solr:8983/solr/ 21 | # - A Solr core is automatically created with the name "dev" unless you 22 | # change that usage throughout. It can be 23 | # accessed at the URL: http://solr:8983/solr/dev (inside web container) 24 | # or at http://myproject.ddev.site:8983/solr/dev (on the host) 25 | 26 | services: 27 | solr: 28 | # Name of container using standard ddev convention 29 | container_name: ddev-${DDEV_SITENAME}-solr 30 | # The solr docker image is at https://hub.docker.com/_/solr/ 31 | # and code at https://github.com/docker-solr/docker-solr 32 | # README: https://github.com/docker-solr/docker-solr/blob/master/README.md 33 | # It's almost impossible to work with it if you don't read the docs there 34 | build: 35 | dockerfile_inline: | 36 | ARG SOLR_BASE_IMAGE="scratch" 37 | FROM $$SOLR_BASE_IMAGE 38 | # Fix HTTPS redirect to HTTP which breaks URL for Solr Admin UI. 39 | # The reason for this problem is that Solr uses Jetty as a webserver. 40 | # Jetty has X-Forwarded- headers disabled by default, enable them here: 41 | USER root 42 | RUN sed -i '/X-Forwarded-/,/-->/ {//d}' /opt/solr/server/etc/jetty.xml 43 | USER solr 44 | args: 45 | SOLR_BASE_IMAGE: ${SOLR_BASE_IMAGE:-solr:8} 46 | restart: "no" 47 | # Solr is served from this port inside the container. 48 | expose: 49 | - 8983 50 | # These labels ensure this service is discoverable by ddev. 51 | labels: 52 | com.ddev.site-name: ${DDEV_SITENAME} 53 | com.ddev.approot: ${DDEV_APPROOT} 54 | environment: 55 | # This defines the host name the service should be accessible from. This 56 | # will be sitename.ddev.site. 57 | - VIRTUAL_HOST=$DDEV_HOSTNAME 58 | # HTTP_EXPOSE exposes http traffic from the container port 8983 59 | # to the host port 8983 vid ddev-router reverse proxy. 60 | - HTTP_EXPOSE=8983:8983 61 | - HTTPS_EXPOSE=8943:8983 62 | volumes: 63 | # solr core *data* is stored on the 'solr' docker volume 64 | # This mount is optional; without it your search index disappears 65 | # each time the ddev project is stopped and started. 66 | - solr:/var/solr 67 | 68 | # This mounts the conf in .ddev/solr into the container where 69 | # the solr-precreate command in the entrypoint uses it as a one-time 70 | # configuration to copy config into the newly-created core. It is not 71 | # used if the core has previously been created. 72 | - ./solr:/solr-conf 73 | 74 | - ".:/mnt/ddev_config" 75 | - ddev-global-cache:/mnt/ddev-global-cache 76 | 77 | # solr-configupdate.sh copies fresh configuration files into the 78 | # solr container on each 79 | # startup, so if you change the config in .ddev/solr/conf 80 | # it will be refreshed on `ddev start`. It must be executable, 81 | # `chmod +x solr 82 | - "./solr/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d" 83 | 84 | # The odd need to use $$SOLR_CORENAME here is explained in 85 | # https://stackoverflow.com/a/48189916/215713 86 | entrypoint: 'bash -c "VERBOSE=yes docker-entrypoint.sh solr-precreate $${SOLR_CORENAME:-dev} /solr-conf"' 87 | 88 | external_links: 89 | - "ddev-router:${DDEV_SITENAME}.${DDEV_TLD}" 90 | healthcheck: 91 | test: ["CMD-SHELL", "curl --fail -s localhost:8983/solr/"] 92 | 93 | volumes: 94 | # solr is a persistent Docker volume for solr data 95 | solr: 96 | name: "ddev-${DDEV_SITENAME}_solr" 97 | -------------------------------------------------------------------------------- /install.yaml: -------------------------------------------------------------------------------- 1 | name: solr 2 | 3 | project_files: 4 | - solr/conf 5 | - solr/docker-entrypoint-initdb.d/solr-configupdate.sh 6 | - docker-compose.solr.yaml 7 | 8 | post_install_actions: 9 | - | 10 | #ddev-description:Make sure solr-configupdate.sh is executable 11 | chmod +x solr/docker-entrypoint-initdb.d/solr-configupdate.sh 12 | 13 | ddev_version_constraint: '>= v1.24.3' 14 | -------------------------------------------------------------------------------- /solr/conf/accents_en.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | # À => A 3 | "\u00C0" => "A" 4 | # Á => A 5 | "\u00C1" => "A" 6 | #  => A 7 | "\u00C2" => "A" 8 | # à => A 9 | "\u00C3" => "A" 10 | # Ä => A 11 | "\u00C4" => "A" 12 | # Å => A 13 | "\u00C5" => "A" 14 | # Ą => A 15 | "\u0104" => "A" 16 | # Æ => AE 17 | "\u00C6" => "AE" 18 | # Ç => C 19 | "\u00C7" => "C" 20 | # Ć => C 21 | "\U0106" => "C" 22 | # È => E 23 | "\u00C8" => "E" 24 | # É => E 25 | "\u00C9" => "E" 26 | # Ê => E 27 | "\u00CA" => "E" 28 | # Ë => E 29 | "\u00CB" => "E" 30 | # Ę => E 31 | "\u0118" => "E" 32 | # Ì => I 33 | "\u00CC" => "I" 34 | # Í => I 35 | "\u00CD" => "I" 36 | # Î => I 37 | "\u00CE" => "I" 38 | # Ï => I 39 | "\u00CF" => "I" 40 | # IJ => IJ 41 | "\u0132" => "IJ" 42 | # Ð => D 43 | "\u00D0" => "D" 44 | # Ł => L 45 | "\u0141" => "L" 46 | # Ñ => N 47 | "\u00D1" => "N" 48 | # Ń => N 49 | "\u0143" => "N" 50 | # Ò => O 51 | "\u00D2" => "O" 52 | # Ó => O 53 | "\u00D3" => "O" 54 | # Ô => O 55 | "\u00D4" => "O" 56 | # Õ => O 57 | "\u00D5" => "O" 58 | # Ö => O 59 | "\u00D6" => "O" 60 | # Ø => O 61 | "\u00D8" => "O" 62 | # Œ => OE 63 | "\u0152" => "OE" 64 | # Þ 65 | "\u00DE" => "TH" 66 | # Ù => U 67 | "\u00D9" => "U" 68 | # Ú => U 69 | "\u00DA" => "U" 70 | # Û => U 71 | "\u00DB" => "U" 72 | # Ü => U 73 | "\u00DC" => "U" 74 | # Ý => Y 75 | "\u00DD" => "Y" 76 | # Ÿ => Y 77 | "\u0178" => "Y" 78 | # à => a 79 | "\u00E0" => "a" 80 | # á => a 81 | "\u00E1" => "a" 82 | # â => a 83 | "\u00E2" => "a" 84 | # ã => a 85 | "\u00E3" => "a" 86 | # ä => a 87 | "\u00E4" => "a" 88 | # å => a 89 | "\u00E5" => "a" 90 | # æ => ae 91 | "\u00E6" => "ae" 92 | # ç => c 93 | "\u00E7" => "c" 94 | # è => e 95 | "\u00E8" => "e" 96 | # é => e 97 | "\u00E9" => "e" 98 | # ê => e 99 | "\u00EA" => "e" 100 | # ë => e 101 | "\u00EB" => "e" 102 | # ì => i 103 | "\u00EC" => "i" 104 | # í => i 105 | "\u00ED" => "i" 106 | # î => i 107 | "\u00EE" => "i" 108 | # ï => i 109 | "\u00EF" => "i" 110 | # ij => ij 111 | "\u0133" => "ij" 112 | # ð => d 113 | "\u00F0" => "d" 114 | # ñ => n 115 | "\u00F1" => "n" 116 | # ò => o 117 | "\u00F2" => "o" 118 | # ó => o 119 | "\u00F3" => "o" 120 | # ô => o 121 | "\u00F4" => "o" 122 | # õ => o 123 | "\u00F5" => "o" 124 | # ö => o 125 | "\u00F6" => "o" 126 | # ø => o 127 | "\u00F8" => "o" 128 | # œ => oe 129 | "\u0153" => "oe" 130 | # ß => ss 131 | "\u00DF" => "ss" 132 | # Ś => S 133 | "\u015a" => "S" 134 | # þ => th 135 | "\u00FE" => "th" 136 | # ù => u 137 | "\u00F9" => "u" 138 | # ú => u 139 | "\u00FA" => "u" 140 | # û => u 141 | "\u00FB" => "u" 142 | # ü => u 143 | "\u00FC" => "u" 144 | # ý => y 145 | "\u00FD" => "y" 146 | # ÿ => y 147 | "\u00FF" => "y" 148 | # Ź => Z 149 | "\u0179" => "Z" 150 | # Ż => Z 151 | "\u017b" => "Z" 152 | # ff => ff 153 | "\uFB00" => "ff" 154 | # fi => fi 155 | "\uFB01" => "fi" 156 | # fl => fl 157 | "\uFB02" => "fl" 158 | # ffi => ffi 159 | "\uFB03" => "ffi" 160 | # ffl => ffl 161 | "\uFB04" => "ffl" 162 | # ſt => st 163 | "\uFB05" => "st" 164 | # st => st 165 | "\uFB06" => "st" 166 | # Māori macrons. 167 | # Ā => A 168 | "\u0100" => "A" 169 | # Ē => E 170 | "\u0112" => "E" 171 | # Ī => I 172 | "\u012A" => "I" 173 | # Ō => O 174 | "\u014C" => "O" 175 | # Ū => U 176 | "\u016A" => "U" 177 | # ā => a 178 | "\u0101" => "a" 179 | # ē => e 180 | "\u0113" => "e" 181 | # ī => i 182 | "\u012B" => "i" 183 | # ō => o 184 | "\u014D" => "o" 185 | # ū => u 186 | "\u016B" => "u" 187 | -------------------------------------------------------------------------------- /solr/conf/accents_und.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | # À => A 3 | "\u00C0" => "A" 4 | # Á => A 5 | "\u00C1" => "A" 6 | #  => A 7 | "\u00C2" => "A" 8 | # à => A 9 | "\u00C3" => "A" 10 | # Ä => A 11 | "\u00C4" => "A" 12 | # Å => A 13 | "\u00C5" => "A" 14 | # Æ => AE 15 | "\u00C6" => "AE" 16 | # Ç => C 17 | "\u00C7" => "C" 18 | # È => E 19 | "\u00C8" => "E" 20 | # É => E 21 | "\u00C9" => "E" 22 | # Ê => E 23 | "\u00CA" => "E" 24 | # Ë => E 25 | "\u00CB" => "E" 26 | # Ì => I 27 | "\u00CC" => "I" 28 | # Í => I 29 | "\u00CD" => "I" 30 | # Î => I 31 | "\u00CE" => "I" 32 | # Ï => I 33 | "\u00CF" => "I" 34 | # IJ => IJ 35 | "\u0132" => "IJ" 36 | # Ð => D 37 | "\u00D0" => "D" 38 | # Ñ => N 39 | "\u00D1" => "N" 40 | # Ò => O 41 | "\u00D2" => "O" 42 | # Ó => O 43 | "\u00D3" => "O" 44 | # Ô => O 45 | "\u00D4" => "O" 46 | # Õ => O 47 | "\u00D5" => "O" 48 | # Ö => O 49 | "\u00D6" => "O" 50 | # Ø => O 51 | "\u00D8" => "O" 52 | # Œ => OE 53 | "\u0152" => "OE" 54 | # Þ 55 | "\u00DE" => "TH" 56 | # Ù => U 57 | "\u00D9" => "U" 58 | # Ú => U 59 | "\u00DA" => "U" 60 | # Û => U 61 | "\u00DB" => "U" 62 | # Ü => U 63 | "\u00DC" => "U" 64 | # Ý => Y 65 | "\u00DD" => "Y" 66 | # Ÿ => Y 67 | "\u0178" => "Y" 68 | # à => a 69 | "\u00E0" => "a" 70 | # á => a 71 | "\u00E1" => "a" 72 | # â => a 73 | "\u00E2" => "a" 74 | # ã => a 75 | "\u00E3" => "a" 76 | # ä => a 77 | "\u00E4" => "a" 78 | # å => a 79 | "\u00E5" => "a" 80 | # æ => ae 81 | "\u00E6" => "ae" 82 | # ç => c 83 | "\u00E7" => "c" 84 | # è => e 85 | "\u00E8" => "e" 86 | # é => e 87 | "\u00E9" => "e" 88 | # ê => e 89 | "\u00EA" => "e" 90 | # ë => e 91 | "\u00EB" => "e" 92 | # ì => i 93 | "\u00EC" => "i" 94 | # í => i 95 | "\u00ED" => "i" 96 | # î => i 97 | "\u00EE" => "i" 98 | # ï => i 99 | "\u00EF" => "i" 100 | # ij => ij 101 | "\u0133" => "ij" 102 | # ð => d 103 | "\u00F0" => "d" 104 | # ñ => n 105 | "\u00F1" => "n" 106 | # ò => o 107 | "\u00F2" => "o" 108 | # ó => o 109 | "\u00F3" => "o" 110 | # ô => o 111 | "\u00F4" => "o" 112 | # õ => o 113 | "\u00F5" => "o" 114 | # ö => o 115 | "\u00F6" => "o" 116 | # ø => o 117 | "\u00F8" => "o" 118 | # œ => oe 119 | "\u0153" => "oe" 120 | # ß => ss 121 | "\u00DF" => "ss" 122 | # þ => th 123 | "\u00FE" => "th" 124 | # ù => u 125 | "\u00F9" => "u" 126 | # ú => u 127 | "\u00FA" => "u" 128 | # û => u 129 | "\u00FB" => "u" 130 | # ü => u 131 | "\u00FC" => "u" 132 | # ý => y 133 | "\u00FD" => "y" 134 | # ÿ => y 135 | "\u00FF" => "y" 136 | # ff => ff 137 | "\uFB00" => "ff" 138 | # fi => fi 139 | "\uFB01" => "fi" 140 | # fl => fl 141 | "\uFB02" => "fl" 142 | # ffi => ffi 143 | "\uFB03" => "ffi" 144 | # ffl => ffl 145 | "\uFB04" => "ffl" 146 | # ſt => st 147 | "\uFB05" => "st" 148 | # st => st 149 | "\uFB06" => "st" 150 | -------------------------------------------------------------------------------- /solr/conf/elevate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 19 | 20 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /solr/conf/protwords_en.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | -------------------------------------------------------------------------------- /solr/conf/protwords_und.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | 3 | -------------------------------------------------------------------------------- /solr/conf/schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 21 | 22 | ]> 23 | 24 | 52 | 53 | 54 | 71 | 72 | 73 | 109 | 110 | 116 | 117 | 120 | 121 | 122 | 123 | 126 | 127 | 128 | 132 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 160 | 161 | 162 | 169 | 170 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 252 | 253 | 254 | 255 | 262 | 263 | 267 | 268 | 269 | 270 | 271 | 272 | 286 | 287 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 307 | 308 | 309 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 350 | 351 | 352 | 363 | 364 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 397 | 398 | 399 | 400 | 401 | 403 | 404 | 405 | 416 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 430 | 431 | 434 | 436 | 437 | 438 | 454 | 456 | 457 | 458 | &extrafields; 459 | 460 | 461 | &extratypes; 462 | 463 | 466 | id 467 | 468 | 473 | 478 | 479 | 480 | -------------------------------------------------------------------------------- /solr/conf/schema_extra_fields.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /solr/conf/schema_extra_types.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 73 | 74 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 189 | 190 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | -------------------------------------------------------------------------------- /solr/conf/solrconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | ]> 10 | 11 | 15 | 16 | 23 | 24 | 34 | ${solr.abortOnConfigurationError:true} 35 | 36 | 42 | ${solr.luceneMatchVersion:LUCENE_80} 43 | 44 | 64 | 65 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 95 | 98 | 99 | 106 | ${solr.data.dir:} 107 | 108 | 109 | 122 | 124 | 125 | 126 | 129 | 130 | ${solr.hdfs.home:} 131 | 132 | ${solr.hdfs.confdir:} 133 | 134 | ${solr.hdfs.blockcache.enabled:true} 135 | 137 | ${solr.hdfs.blockcache.global:true} 138 | 139 | 140 | 141 | 150 | 151 | 152 | 154 | 155 | 156 | 163 | 164 | 168 | 169 | 170 | 171 | 174 | 175 | 176 | 184 | 185 | 186 | 187 | 193 | 199 | 200 | 206 | 209 | 210 | 229 | ${solr.lock.type:native} 230 | 231 | 242 | 245 | 246 | 247 | 248 | 249 | 253 | 257 | 260 | 261 | 270 | true 271 | 272 | 273 | &index; 274 | 275 | 276 | 277 | 278 | 279 | 280 | 286 | 287 | ${solr.ulog.dir:} 288 | 289 | 290 | 311 | 312 | ${solr.autoCommit.MaxDocs:-1} 313 | ${solr.autoCommit.MaxTime:15000} 314 | false 315 | 316 | 317 | 322 | 323 | 324 | ${solr.autoSoftCommit.MaxDocs:-1} 325 | ${solr.autoSoftCommit.MaxTime:-1} 326 | 327 | 328 | 336 | 346 | 350 | 359 | 360 | 361 | 362 | 384 | 389 | 390 | 393 | 394 | 395 | &query; 396 | 397 | 413 | 416 | 417 | 418 | 422 | 423 | 424 | 425 | 426 | 427 | static firstSearcher warming in solrconfig.xml 428 | 429 | 430 | 431 | 432 | 439 | false 440 | 441 | 442 | 443 | 444 | 449 | 450 | 483 | 484 | &requestdispatcher; 485 | 486 | 487 | 488 | 530 | 531 | 532 | &extra; 533 | 534 | 538 | 539 | 540 | 541 | 542 | 545 | 546 | 100 547 | 548 | 549 | 550 | 553 | 555 | 556 | 557 | 70 558 | 559 | 0.5 560 | 561 | [-\w ,/\n\"']{20,200} 562 | 563 | 564 | 565 | 566 | 569 | 570 | ]]> 571 | ]]> 572 | 573 | 574 | 575 | 576 | 578 | 579 | 580 | 582 | 583 | 584 | 586 | 587 | 588 | 591 | 592 | 593 | 596 | 601 | 602 | 603 | 604 | 606 | 607 | ,, 609 | ,, 610 | ,, 611 | ,, 612 | ,]]> 613 | ]]> 614 | 615 | 616 | 617 | 620 | 621 | 10 622 | .,!? 623 | 624 | 625 | 626 | 628 | 629 | 630 | WORD 631 | 632 | 633 | en 634 | US 635 | 636 | 637 | 638 | 639 | 640 | 649 | 658 | 671 | 672 | 682 | 693 | 694 | 700 | 711 | 712 | 723 | 726 | 738 | 739 | 740 | 741 | 742 | 745 | 747 | 752 | 753 | 757 | 758 | 5 759 | 760 | 761 | 769 | 770 | 773 | 774 | 781 | 782 | 786 | 787 | 788 | 791 | 811 | 812 | 813 | -------------------------------------------------------------------------------- /solr/conf/solrconfig_extra.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | en 5 | spellcheck_en 6 | solr.DirectSolrSpellChecker 7 | internal 8 | 0.5 9 | 2 10 | 1 11 | 5 12 | 4 13 | 0.01 14 | .01 15 | true 16 | 17 | 18 | 19 | und 20 | spellcheck_und 21 | solr.DirectSolrSpellChecker 22 | internal 23 | 0.5 24 | 2 25 | 1 26 | 5 27 | 4 28 | 0.01 29 | .01 30 | true 31 | 32 | 33 | 34 | 35 | en 36 | AnalyzingInfixLookupFactory 37 | DocumentDictionaryFactory 38 | twm_suggest 39 | text_en 40 | sm_context_tags 41 | true 42 | false 43 | 44 | 45 | 46 | und 47 | AnalyzingInfixLookupFactory 48 | DocumentDictionaryFactory 49 | twm_suggest 50 | text_und 51 | sm_context_tags 52 | true 53 | false 54 | 55 | 56 | 60 | 61 | 62 | false 63 | false 64 | false 65 | true 66 | false 67 | 1 68 | false 69 | 10 70 | 71 | 72 | terms 73 | spellcheck 74 | suggest 75 | 76 | 77 | 78 | 82 | 83 | 84 | true 85 | ignored_ 86 | true 87 | links 88 | ignored_ 89 | 90 | 91 | 92 | 96 | 97 | 98 | 1 99 | 1 100 | false 101 | ${solr.mlt.timeAllowed:2000} 102 | 103 | 104 | 105 | 109 | 110 | 111 | lucene 112 | id 113 | explicit 114 | true 115 | ${solr.selectSearchHandler.timeAllowed:-1} 116 | false 117 | 118 | 119 | spellcheck 120 | elevator 121 | 122 | 123 | 124 | 128 | 129 | 130 | id 131 | und 132 | on 133 | false 134 | false 135 | 1 136 | 5 137 | 5 138 | true 139 | true 140 | 10 141 | 5 142 | 143 | 144 | spellcheck 145 | 146 | 147 | 148 | 152 | 153 | 154 | true 155 | und 156 | 10 157 | 158 | 159 | suggest 160 | 161 | 162 | 163 | 167 | 168 | 169 | id 170 | true 171 | 172 | 173 | tvComponent 174 | 175 | 176 | 177 | 181 | 182 | string 183 | elevate.xml 184 | 185 | 189 | 190 | -------------------------------------------------------------------------------- /solr/conf/solrconfig_index.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /solr/conf/solrconfig_query.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 12 | 13 | 14 | 18 | 19 | 20 | 24 | 25 | 26 | 30 | 31 | 32 | 36 | true 37 | 41 | false 42 | 46 | 20 47 | 200 48 | 1024 49 | -------------------------------------------------------------------------------- /solr/conf/solrconfig_requestdispatcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /solr/conf/solrcore.properties: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | solr.replication.master=false 3 | solr.replication.slave=false 4 | solr.replication.pollInterval=00:00:60 5 | solr.replication.masterUrl=http://localhost:8983/solr 6 | solr.replication.confFiles=schema.xml,schema_extra_types.xml,schema_extra_fields.xml,elevate.xml,stopwords_en.txt,synonyms_en.txt,protwords_en.txt,accents_en.txt,stopwords_und.txt,synonyms_und.txt,protwords_und.txt,accents_und.txt 7 | solr.mlt.timeAllowed=2000 8 | solr.selectSearchHandler.timeAllowed=-1 9 | solr.autoCommit.MaxDocs=-1 10 | solr.autoCommit.MaxTime=15000 11 | solr.autoSoftCommit.MaxDocs=-1 12 | solr.autoSoftCommit.MaxTime=-1 13 | solr.install.dir=/opt/solr 14 | solr.luceneMatchVersion=8.11 15 | -------------------------------------------------------------------------------- /solr/conf/stopwords_en.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | a 3 | an 4 | and 5 | are 6 | as 7 | at 8 | be 9 | but 10 | by 11 | for 12 | if 13 | in 14 | into 15 | is 16 | it 17 | no 18 | not 19 | of 20 | on 21 | or 22 | s 23 | such 24 | t 25 | that 26 | the 27 | their 28 | then 29 | there 30 | these 31 | they 32 | this 33 | to 34 | was 35 | will 36 | with 37 | -------------------------------------------------------------------------------- /solr/conf/stopwords_und.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | 3 | -------------------------------------------------------------------------------- /solr/conf/synonyms_und.txt: -------------------------------------------------------------------------------- 1 | #ddev-generated 2 | drupal, durpal 3 | -------------------------------------------------------------------------------- /solr/docker-entrypoint-initdb.d/solr-configupdate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #ddev-generated 3 | set -e 4 | 5 | # Ensure "dev" (or alternate SOLR_CORENAME) core config is always up to date even after the 6 | # core has been created. This does not execute the first time, 7 | # when solr-precreate has not yet run. 8 | CORENAME=${SOLR_CORENAME:-dev} 9 | if [ -d /var/solr/data/${CORENAME}/conf ]; then 10 | cp /solr-conf/conf/* /var/solr/data/${CORENAME}/conf 11 | fi 12 | -------------------------------------------------------------------------------- /tests/test.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | # Bats is a testing framework for Bash 4 | # Documentation https://bats-core.readthedocs.io/en/stable/ 5 | # Bats libraries documentation https://github.com/ztombol/bats-docs 6 | 7 | # For local tests, install bats-core, bats-assert, bats-file, bats-support 8 | # And run this in the add-on root directory: 9 | # bats ./tests/test.bats 10 | # To exclude release tests: 11 | # bats ./tests/test.bats --filter-tags '!release' 12 | # For debugging: 13 | # bats ./tests/test.bats --show-output-of-passing-tests --verbose-run --print-output-on-failure 14 | 15 | setup() { 16 | set -eu -o pipefail 17 | 18 | # Override this variable for your add-on: 19 | export GITHUB_REPO=ddev/ddev-drupal-solr 20 | 21 | TEST_BREW_PREFIX="$(brew --prefix 2>/dev/null || true)" 22 | export BATS_LIB_PATH="${BATS_LIB_PATH}:${TEST_BREW_PREFIX}/lib:/usr/lib/bats" 23 | bats_load_library bats-assert 24 | bats_load_library bats-file 25 | bats_load_library bats-support 26 | 27 | export DIR="$(cd "$(dirname "${BATS_TEST_FILENAME}")/.." >/dev/null 2>&1 && pwd)" 28 | export PROJNAME="test-$(basename "${GITHUB_REPO}")" 29 | mkdir -p ~/tmp 30 | export TESTDIR=$(mktemp -d ~/tmp/${PROJNAME}.XXXXXX) 31 | export DDEV_NONINTERACTIVE=true 32 | export DDEV_NO_INSTRUMENTATION=true 33 | ddev delete -Oy "${PROJNAME}" >/dev/null 2>&1 || true 34 | cd "${TESTDIR}" 35 | run ddev config --project-name="${PROJNAME}" --project-tld=ddev.site --project-type=drupal9 --docroot=web --php-version=8.1 36 | assert_success 37 | run ddev start -y 38 | assert_success 39 | 40 | echo "# Setting up Drupal project via composer ${PROJNAME} in $(pwd)" >&3 41 | ddev composer create-project -n --no-install drupal/recommended-project:^9 >/dev/null 42 | ddev composer require -n --no-install drush/drush:* drupal/search_api_solr >/dev/null 43 | ddev composer config --append -- allow-plugins true 44 | ddev composer install >/dev/null 45 | ddev import-db --file=${DIR}/tests/testdata/db.sql.gz >/dev/null 46 | } 47 | 48 | health_checks() { 49 | run ddev exec 'drush sapi-sl --format=json | jq -r .default_solr_server.status' 50 | assert_success 51 | assert_output "enabled" 52 | 53 | run ddev drush search-api-solr:reload default_solr_server 54 | assert_success 55 | 56 | # Make sure the solr admin UI via HTTP from outside is redirected to HTTP /solr/ 57 | run curl -sfI http://${PROJNAME}.ddev.site:8983 58 | assert_success 59 | assert_output --partial "HTTP/1.1 302" 60 | assert_output --partial "Location: http://${PROJNAME}.ddev.site:8983/solr/" 61 | 62 | # Make sure the solr admin UI via HTTPS from outside is redirected to HTTPS /solr/ 63 | run curl -sfI https://${PROJNAME}.ddev.site:8943 64 | assert_success 65 | assert_output --partial "HTTP/2 302" 66 | assert_output --partial "location: https://${PROJNAME}.ddev.site:8943/solr/" 67 | 68 | # Make sure the solr admin UI is working from outside 69 | run curl -sfL https://${PROJNAME}.ddev.site:8943 70 | assert_success 71 | assert_output --partial "Solr Admin" 72 | } 73 | 74 | teardown() { 75 | set -eu -o pipefail 76 | ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 77 | [ "${TESTDIR}" != "" ] && rm -rf ${TESTDIR} 78 | } 79 | 80 | @test "install from directory" { 81 | set -eu -o pipefail 82 | echo "# ddev add-on get ${DIR} with project ${PROJNAME} in $(pwd)" >&3 83 | run ddev add-on get "${DIR}" 84 | assert_success 85 | run ddev restart -y 86 | assert_success 87 | health_checks 88 | } 89 | 90 | # bats test_tags=release 91 | @test "install from release" { 92 | set -eu -o pipefail 93 | echo "# ddev add-on get ${GITHUB_REPO} with project ${PROJNAME} in $(pwd)" >&3 94 | run ddev add-on get "${GITHUB_REPO}" 95 | assert_success 96 | run ddev restart -y 97 | assert_success 98 | health_checks 99 | } 100 | -------------------------------------------------------------------------------- /tests/testdata/db.sql.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ddev/ddev-drupal-solr/94a7aeb80608205e253d780e077815364145ce56/tests/testdata/db.sql.gz --------------------------------------------------------------------------------