-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-word synonyms are unaffected by slop settings #5
Comments
I'd propose that it is contructed as a phrase query, and that you add another config option for phraseSlop which will then be set for the generated phrases, i.e. "canis familiaris"~5 If you do not specify a phrase slop, all phrases will probably inherit the global "qs" parameter, but not sure about this. |
It seems to me now that this is not a bug so much as missing functionality. It's not actually true that we want I would be more inclined to say that we should inherit the global settings for each of these parameters, but more on that in a moment... Investigating a bit more with the code, it appears that with the synonyms:
... the
and with
Both of these are correct. However, Probably what I ought to be doing is just deferring to the superclass to handle all of this phrase boosting, rather than rewriting everything myself. But in any case, this bug is not as severe as I originally thought. Really, I think it's just a new feature: Apply |
I still see no way of having multi-word synonyms being applied as a phrase. The qs parameter only comes into play for explicit phrase queries. I think some users may want the MM functionality to apply for multi-word synonyms, but others need explicit phrase. Perhaps a config synonyms.constructPhrases=true that would construct phrase instead of MM-style, and that would inherit the "qs" setting for slop. |
Ah, I see what you're saying. I suppose some users would prefer for Question, though: should this only apply if the user query is a single token and the synonym is multi-token? If the user enters |
I think most users enter queries without quotes, and we cannot know whether it is an AND or a PHRASE query in their head. But when we expand a synonym from the dictionary we KNOW that it is a phrase, and should be searched as a phrase in my opinion. Doesn't matter if user enters the original query quoted or not. But if you have a param to enable/disable phrasing then those that see a need for MM treatment of phrases from the synonym dictionary can use that, but those who want prases will get that, possibly with a slop from qs. |
Point well taken. So just to summarize, |
👍 |
Environment: Mac OS X, Solr 4.1.0
Steps to reproduce: Follow the "Getting Started" instructions, then enter the following test data:
Then browse to the url:
http://localhost:8983/solr/select/?q=dog&debugQuery=on&qf=text&defType=synonym_edismax&synonyms=true
Expected result: "pooch","dog","hound",and "canis familiaris" are matched.
Actual result: In addition to these 4, "familiaris canis" is also matched, because the query parser doesn't construct the multi-word synonym as a phrase query.
The text was updated successfully, but these errors were encountered: