You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Koji Sekiguchi <ko...@rondhuit.com> on 2017/05/23 10:00:59 UTC
setMinimumNumberShouldMatch() for SynonymQuery
Hi,
Can we implement setMinimumNumberShouldMatch() for SynonymQuery, like BooleanQuery?
SynonymQuery was introduced in this ticket before I was aware:
https://issues.apache.org/jira/browse/LUCENE-6789
By this, analyzeBoolean() of QueryBuilder no longer creates BooleanQuery but SynonymQuery
instead, and then precision of certain queries decreased because mm parameter cannot be set.
First, I thought we should revert analyzeBoolean() so it uses BooleanQuery just like it used to be,
but we are already in 6.6, I think it is better for us to implement setMinimumNumberShouldMatch()
for SynonymQuery so we can set mm parameter for it.
Thought?
Thanks,
Koji
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: setMinimumNumberShouldMatch() for SynonymQuery
Posted by Adrien Grand <jp...@gmail.com>.
Le mar. 23 mai 2017 à 16:43, David Smiley <da...@gmail.com> a
écrit :
> I'm unconvinced it makes sense for SynonymQuery to have minShouldMatch.
> Shouldn't the scenario of synonyms be a pure disjunction? If you don't
> think so can you give a practical counter-example?
> ~ David
>
+1
Re: setMinimumNumberShouldMatch() for SynonymQuery
Posted by Koji Sekiguchi <ko...@rondhuit.com>.
Indeed!
After I posted the question, I thought same thing. :) I withdraw it but let me explain the
background of the issue.
In a project, we've been using NGramTokenFilter since Solr 5.5 and the field which uses the
TokenFilter is used from edismax. The problem I mentioned became actual when we moved to 6.3.0.
After SynonymQuery was introduced in LUCENE-6789, query string which is analyzed by NGramTokenFilter
produces SynonymQuery and hence mm parameter for edismax couldn't be set to it.
By seeing branch_6x, I'm not sure it's been improved, but I think that tokens which are produced by
NGramTokenFilter shouldn't be converted to SynonymQuery because they are not synonyms.
I'll check the latest branch and if it still produces SynonymQuery, I'll open a ticket.
Thanks,
Koji
On 2017/05/23 23:43, David Smiley wrote:
> Koji,
> I'm unconvinced it makes sense for SynonymQuery to have minShouldMatch. Shouldn't the scenario of
> synonyms be a pure disjunction? If you don't think so can you give a practical counter-example?
> ~ David
>
> On Tue, May 23, 2017 at 6:01 AM Koji Sekiguchi <koji.sekiguchi@rondhuit.com
> <ma...@rondhuit.com>> wrote:
>
> Hi,
>
> Can we implement setMinimumNumberShouldMatch() for SynonymQuery, like BooleanQuery?
>
> SynonymQuery was introduced in this ticket before I was aware:
> https://issues.apache.org/jira/browse/LUCENE-6789
>
> By this, analyzeBoolean() of QueryBuilder no longer creates BooleanQuery but SynonymQuery
> instead, and then precision of certain queries decreased because mm parameter cannot be set.
>
> First, I thought we should revert analyzeBoolean() so it uses BooleanQuery just like it used to be,
> but we are already in 6.6, I think it is better for us to implement setMinimumNumberShouldMatch()
> for SynonymQuery so we can set mm parameter for it.
>
> Thought?
>
> Thanks,
>
> Koji
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org <ma...@lucene.apache.org>
> For additional commands, e-mail: dev-help@lucene.apache.org <ma...@lucene.apache.org>
>
> --
> Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
> LinkedIn: http://linkedin.com/in/davidwsmiley | Book: http://www.solrenterprisesearchserver.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: setMinimumNumberShouldMatch() for SynonymQuery
Posted by David Smiley <da...@gmail.com>.
Koji,
I'm unconvinced it makes sense for SynonymQuery to have minShouldMatch.
Shouldn't the scenario of synonyms be a pure disjunction? If you don't
think so can you give a practical counter-example?
~ David
On Tue, May 23, 2017 at 6:01 AM Koji Sekiguchi <ko...@rondhuit.com>
wrote:
> Hi,
>
> Can we implement setMinimumNumberShouldMatch() for SynonymQuery, like
> BooleanQuery?
>
> SynonymQuery was introduced in this ticket before I was aware:
> https://issues.apache.org/jira/browse/LUCENE-6789
>
> By this, analyzeBoolean() of QueryBuilder no longer creates BooleanQuery
> but SynonymQuery
> instead, and then precision of certain queries decreased because mm
> parameter cannot be set.
>
> First, I thought we should revert analyzeBoolean() so it uses BooleanQuery
> just like it used to be,
> but we are already in 6.6, I think it is better for us to implement
> setMinimumNumberShouldMatch()
> for SynonymQuery so we can set mm parameter for it.
>
> Thought?
>
> Thanks,
>
> Koji
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
> --
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com