Problem/Motivation
This is a bit complicated, maybe even a bit more complicated then the summary suggests. I confirmed with SearchStax today their default is changed to dismax. I'll explain the situation triggering this and here's the relevant code that's causing a problem:
https://git.drupalcode.org/project/search_api_solr/-/blob/eb6bf21b8a8051...
Basically we have a view that by default shows all results and then users can search it. Before they search it triggers the above code.
defType is empty and 'edismax' !== $params['def Type'] assumes that the parser is going to be lucene and sends {!boost b=boost_document}. Since SearchStax uses dismax by default this fails to parse and query fails leaving an empty page until the user searches.
Steps to reproduce
Proposed resolution
While this might be a search_api_solr bug, it seems its behavior is more or less reasonable and maybe this module could just alter in a defType or some other interaction? Not really sure, the search_api_solr backen is pretty complex so I'm not sure all the other implications there might be.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3200246-2--fix_edismax_problems.patch | 5.35 KB | drunken monkey |
Comments
Comment #2
drunken monkeyHi James,
Here, too, sorry for the delay.
Yes, it seems Search API Solr assumes the default is
defType=lucene, and as they provide their own config files with this default, I think that’s a fair assumption. As SearchStax usesedismaxby default, we should probably just change the query type toluceneexplicitly to avoid this whole problem. (SettingdefType=edismaxwould also solve this bug, but as the Search API Solr module works better with thelucenetype than withedismax(that’s why they switched – I keep forgetting the exact details, but there are problems in how EDisMax handles searches for multiple words across multiple fields, which they wanted to avoid), I think that’s what we should use.)Patch attached, please test/review.
Comment #3
neclimdulOh hugh. Didn't notice there was a subscriber trying to do this already. That seems like it would have been a better fix it if worked. That's unfortunate. :-/
This is basically the same hack I had just with a few more sanity checks in front of it. Looks great.
Comment #5
drunken monkeyGreat to hear, thanks for testing/reviewing!
Committed.