Reputation: 804
I wanted to take a look at query time synonyms. I just downloaded solr 7.1.0, started it up and created a core and added this to the synonym file 'db,database,data base'. When I go to the analysis page and select text_general for the field and enter "getting to first base is necessary" into the index text box and add "db" to the query text box. When I run analysis it shows a hit on the term "base".
Is there a way around this? Are the synonyms setup incorrectly?
Upvotes: 0
Views: 170
Reputation: 1114
According to your configuration you are stating that "db" "database" "data base" are synonyms.
The analysis tool will highlight the term base just because it calculates a quick intersection I guess.
If you actually index a document and run a query, this is the query parsed and expanded:
"rawquerystring": "name:db",
"querystring": "name:db",
"parsedquery": "((+name:data +name:base) name:database name:db)",
"parsedquery_toString": "((+name:data +name:base) name:database name:db)",
Focusing on this part of the expansion (+name:data +name:base) , you can see that both the terms are required.
So the document containing "getting to first base is necessary" in a text_general field, will not match the query.
Upvotes: 1