I couldn't see anything in the module or issue queues, but having a way to explode the path using specific characters would be awesome.
User-case, clean URL's use hyphen replacement for spaces.
/my-fat-cat
Which literally searches for "my-fat-cat" as a single word
Quick hack to the Search404Controller::search404GetKeys() made the results search for everything :)
return str_replace('-', ' OR ', $keys);
which searches for "my OR fat OR cat", and starts to return useful results.
I can't see the feature, so opening as a support request in case it is there, otherwise, a feature request for white space substitution replacements.
Comment | File | Size | Author |
---|---|---|---|
#4 | Screenshot from 2018-05-23 17:12:56.png | 143.13 KB | chippyjacob |
Comments
Comment #2
idiaz.ronceroTotally support this. I am using a SearchAPI view for searchs, and hyphens make Search404 useless (the view interpret the @keys as a single word, not AND or OR keywords) Can use SearchAPI filters, though, but it would be useful to have this option also on Search404
Comment #3
pradeeshrajd CreditAttribution: pradeeshrajd at Zyxware Technologies commentedYou can still achieve this without any modifications in the module. Please enable the option 'Use OR between keywords when searching' under the advanced setting section. If that is not the case please make your requirement little more clear.
Comment #4
chippyjacob CreditAttribution: chippyjacob at Zyxware Technologies commented@pradeeshrajd yes it works for me.
When I enable the option 'Use OR between keywords when searching' under the advanced setting section, each word in a sentence is searched seperately.
Comment #5
akhilavnairHi All,
Based on the comment from #3 and #4, issue seems fixed.
Thanks.
Comment #7
nrambeck CreditAttribution: nrambeck commentedUsing the advanced " OR " option does not work for me.
When I enter the URL "/my-fat-cat", I get a resulting search for "my-fat-cat" instead of "my fat cat". I don't really want the OR at all just to replace the hyphens with spaces. In my case, I'm using the Custom Search Path feature. I think that may have something to do with the problem.
Comment #8
froboyI'm having the same issue as in #7. We have a custom search path too and are using Search API Solr as our search backend. I'm wondering if the OR isn't getting passed to non-core searches?
Comment #9
joshua.boltz CreditAttribution: joshua.boltz at Mediacurrent commentedI'm facing this same issue using Search API Solr and the "OR" setting in Search404.
If i have a URL like
https://demo.ddev.site/search?search=two-words
It performs a search for `two-words`, whereas I need it to perform a search for `two` OR `words`.