I recently upgraded Solr from 7.3 to 9.5 and noticed results weren’t returned as expected. Here is the request handler I’m using which hasn’t changed from 7.3 to 9.5:
edismax
truestate_province_long_desc_tokenized
event_name_tokenized^100explicit
xml
trueevent_name^5
3
100%</lst>
spellcheck
The issue is that a phrase of a city and event name no longer return documents. For example, “creed florida”. Note, if I include AND, then the documents are returned but I can’t change the behavior of end uses after all these years.
I looked at the debugged query and noticed that in the old version, the parsed query is different:
“parsedquery”:”+(DisjunctionMaxQuery(( | (event_name_tokenized:creed)^100.0 | state_province_long_desc_tokenized:creed )) DisjunctionMaxQuery((event_name_tokenized:florida)^100.0 | state_province_long_desc_tokenized:florida ))”
So the old, working one has two DisjunctionMaxQuery where it’s looking through each field for existence of creed and florida. The new parsed query:
“parsedquery”:”+(+DisjunctionMaxQuery(((+state_province_long_desc_tokenized:florida +state_province_long_desc_tokenized:creed) | (+event_name_tokenized:florida +event_name_tokenized:creed)
There is one DisjunctionMaxQuery and it’s looking for florida and creed in the state OR florida and creed in the event name. My expectation of how the edismax request handler was working for me previously, is that each word in the phrase would be queries against each field, ie “return all documents where event name or state includes (florida, creed) and event name or state includes (florida, creed. I cant find anything in release notes between the two versions why the edismax query parser would interpret the query differently. Ideally, a search of Florida Creed would implicitly add an AND in there like how my solr instance on 7.3 behaved.
Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.