Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Custom Search uses element matching with AND operator, as it probably depends upon drupal core SEARCH. Can it be changed to OR operator. On my site of people search more than one element without using OR then search results show nothing, unless there are all the elements in the results.
Comment | File | Size | Author |
---|---|---|---|
#7 | custom-search-operator-7.patch | 1.75 KB | jdanthinne |
Comments
Comment #1
rliwma CreditAttribution: rliwma commentedComment #2
heddnI'm taking some liberty but a support request from over a year ago is probably
fixed or irrelevant. If you disagree, please reopen and provide more
details.
Comment #4
tz_ CreditAttribution: tz_ commentedWhile this may be an old question, I still wonder the same. Hours of googling and poring over code and admin interface has yielded no help. Switching from AND to OR would be very very helpful.
Comment #5
jdanthinne CreditAttribution: jdanthinne commentedComment #6
dtamajon CreditAttribution: dtamajon commentedI agree... changing default behavior from AND to OR can be very helpful.
Comment #7
jdanthinne CreditAttribution: jdanthinne as a volunteer and at Synthèse commentedCan you try this patch?
There's a new option in the Custom Search config to choose between AND and OR operator.
Comment #8
dtamajon CreditAttribution: dtamajon commentedI have tested and it's working when using from the search block, but not in results page.
And if you include some words between ", then OR is included inside avoiding any match.
Additionally, maybe should need some work to clean OR when showing results because it's quite odd for a user that the words he entered has changed including 'OR' words in the middle.
Comment #9
jdanthinne CreditAttribution: jdanthinne as a volunteer and at Synthèse commentedI have to override this form as well then…
Between what? What's the resulting search keywords?
Yes, it's just the default behavior of core Search module. I have to override that as well.
Comment #10
dtamajon CreditAttribution: dtamajon commentedI mean, when you do a search like -->Drupal "Custom Search"<--, the resulting search keywords are -->Drupal OR "Custom OR Search"<--