You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2015/07/24 13:48:04 UTC

[jira] [Comment Edited] (LUCENE-6695) BlendedTermQuery

    [ https://issues.apache.org/jira/browse/LUCENE-6695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14640343#comment-14640343 ] 

Uwe Schindler edited comment on LUCENE-6695 at 7/24/15 11:47 AM:
-----------------------------------------------------------------

bq. Eventually I would like to remove this rewrite() method from the public API of Query, it should really be an implementation detail of createWeight!

I would make rewrite() a protected method in Query and let the default impl of createWeight() call it. If a query does not implement createWeight (therefore, default impl is used), that one does the rewrite loop and calls createWeight on the final one. Currently createWeight throws UOE, this would also repair that. Of course default rewrite impl would need to be fixed (and rewrite should throw UOE by default). A query that implement createWeight, would not call rewrite.

Alternatively add a "RewriteableQuery" with a final createWeight doing the loop) that has an abstract rewrite() method...

By that no "consumer" of the query would ever call rewrite, they just call createWeight() before execution.

(this are just ideas, maybe let's create separate issue)


was (Author: thetaphi):
bq. Eventually I would like to remove this rewrite() method from the public API of Query, it should really be an implementation detail of createWeight!

I would make rewrite() a protected method in Query and let the default impl of createWeight() call it. If a query does not implement createWeight (therefore, default impl is used), that one does the rewrite loop and calls createWeight on the final one. Currently createWeight throws UOE, this would also repair that. Of course default rewrite impl would need to be fixed (and rewrite should throw UOE by default). A query that implement createWeight, would not call rewrite.

By that no "consumer" of the query would ever call rewrite, they just call createWeight() before execution.

(this are just ideas, maybe let's create separate issue)

> BlendedTermQuery
> ----------------
>
>                 Key: LUCENE-6695
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6695
>             Project: Lucene - Core
>          Issue Type: New Feature
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Minor
>         Attachments: LUCENE-6695.patch, LUCENE-6695.patch
>
>
> It is sometimes desirable to ignore differences between index statistics of several terms so that they produce the same scores, for instance if you resolve synonyms at search time or if you want to search across several fields. Elasticsearch has been using this approach for its multi_match query for some time now.
> We already blend statistics in TopTermsBlendedFreqScoringRewrite (used by FuzzyQuery) but it could be helpful to have a dedicated query to choose manually which terms to blend stats from.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org