Andrew Fletcher published: 13 January 2022 2 minutes read
What am I setting out to achieve?
I want to meet the following requirements:
- Boolean operators in the search. Tested against the following terms
- abalone NOT salmon – 1159
- abalone -salmon – 1159
- abalone AND salmon – 478
- abalone +salmon – 1195
- abalone OR salmon – 2316
- abalone || salmon – 2316
- Phrases in quotations marks - this time to be tested against
- "of this stimulates an interest in the sea and a love for the marine environment" – 1
- of this stimulates an interest in the sea and a love for the marine environment - 5686
Note:
- The numbers after the dash are the results returned from the query;
- In phrases - the difference between first and second is the first look for the text in quotation marks in its entirety. Whereas, the second, looks for any of the words in the string.
Set up
OK, this is over the top information, but I wanted to provide more details about the current structure.
| Solr Version | 8.11.1 |
| Drupal search_api | drupal-4.2.4-solr-8.x-0 |
Server:
Most of the settings noted below are stock standard with your install.
| Solr Connector | Standard |
| Solr Host | localhost |
| Query timeout | 5 |
| Index timeout | 5 |
| Optimize timeout | 10 |
| Finalize timeout | 30 |
Advanced
OK, this is over the top information, but I wanted to provide more details about the current structure.
| Default result rows | 10 |
| Index single document fallback count | 10 |
Index:
| Cron batch size | 250 |
View set-up
Filter criteria - Search: Fulltext search (and)
| Expose this filter | Yes |
| Single filter | Yes |
| Label | Search |
| Operator | Contains all of these words |
| Parse mode | Direct query |
| Filter identifier | search |
| Searched fields | Select what is required. I left blank to select all |