Hello Ere, The q.op parameter is not a dismax parameter. instead i think you are being bitten bij de mm parameter [1] which by default is 100%, meaning all terms must match. Multi word synonym handing and mm are not a very intuitive match, and can lead to crazy problems. Also beware of mm and stopword handling and check out mm.autoRelax [2]. But it is best not to use stopwords at all.
Check it out, Markus [1] https://solr.apache.org/guide/6_6/the-dismax-query-parser.html [2] https://solr.apache.org/guide/6_6/the-extended-dismax-query-parser.html Op wo 28 apr. 2021 om 15:02 schreef Ere Maijala <ere.maij...@helsinki.fi>: > Hi, > > Here's one that I can't wrap my head around. The main question is: why > are the search terms treated differently in eDisMax if the query expands > to a multi-word synonym, and there are different field types and q.op=AND? > > This gets complicated quickly, so I tried to reproduce the results with > the techproducts example: > > 1. Start with vanilla Solr 8.8.2 > > 2. echo "cor => Corsair" >> > server/solr/configsets/sample_techproducts_configs/conf/synonyms.txt > > 4. echo "cmi => Corsair Microsystems" >> > server/solr/configsets/sample_techproducts_configs/conf/synonyms.txt > > 4. bin/solr start -e techproducts > > > Now, a basic query that works fine produces 2 results: > > > http://localhost:8983/solr/techproducts/select?q=corsair+microsystems+memory&debugQuery=true&defType=edismax&qf=name+manu+cat&q.op=AND > > But if I use the synonym, I don't get any results: > > > http://localhost:8983/solr/techproducts/select?q=cmi+memory&debugQuery=true&defType=edismax&qf=name+manu+cat&q.op=AND > > If I leave cat field out, however, I get 2 results: > > > http://localhost:8983/solr/techproducts/select?q=cmi+memory&debugQuery=true&defType=edismax&qf=name+manu&q.op=AND > > Also if leave q.op out and add AND between the terms, I get 2 results > even with the cat field: > > > http://localhost:8983/solr/techproducts/select?q=cmi+AND+memory&debugQuery=true&defType=edismax&qf=name+manu+cat > > The single-word synonym works just fine: > > > http://localhost:8983/solr/techproducts/select?q=cor+memory&debugQuery=true&defType=edismax&qf=name+manu+cat&q.op=AND > > > Can anyone shine a light on what's happening here? > > Additional notes: > > 1. This is a simplified example, and the real-world case is much more > complicated. It has our custom class create the synonyms for compound > words in Finnish, and the queries come from users. > > 2. As far as I can see mm doesn't affect the results in any meaningful > way, but I just might be doing something wrong. > > 3. I included the debugQuery parameter so that it's easy to see how > different the queries become. > > Best Regards, > Ere > > -- > Ere Maijala > Kansalliskirjasto / The National Library of Finland >