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

Fernando Wasylyszyn edited comment on LUCENE-1608 at 2/10/11 1:24 AM:
----------------------------------------------------------------------

I upload a class (for demonstration purposes only, is not clean enough for a 
patch, that is why is not one) 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.

      was (Author: ferwasy):
    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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to