lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fernando Wasylyszyn (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-1608) CustomScoreQuery should support arbitrary Queries
Date Thu, 10 Feb 2011 01:24:57 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-1608?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Fernando Wasylyszyn updated LUCENE-1608:
----------------------------------------

    Attachment: CustomScoreQueryWithSubqueries.java

I upload a class (for demonstration purposes only, is not clean enough for a patch, that is
why is not a patch) that allows secondary queries to be any type of query, not only ValueSourceQuery.
For example, the main query could be (field1:value OR field2:value) and one secondary query
(field3:anotherValue). There are more optimizations to be done on this class: continuing the
previous example, if the secondary query would be (field1:value), then some type of "scorer
cache" would be useful in order to avoid keeping two scorers for the same query (first clause
in main query and secondary query). Comments are more than welcome.

> CustomScoreQuery should support arbitrary Queries
> -------------------------------------------------
>
>                 Key: LUCENE-1608
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1608
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Query/Scoring
>            Reporter: Steven Bethard
>            Assignee: Doron Cohen
>            Priority: Minor
>         Attachments: CustomScoreQueryWithSubqueries.java, LUCENE-1608.patch
>
>
> CustomScoreQuery only allows the secondary queries to be of type ValueSourceQuery instead
of allowing them to be any type of Query. As a result, what you can do with CustomScoreQuery
is pretty limited.
> It would be nice to extend CustomScoreQuery to allow arbitrary Query objects. Most of
the code should stay about the same, though a little more care would need to be taken in CustomScorer.score()
to use 0.0 when the sub-scorer does not produce a score for the current document.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message