Issue Details (XML | Word | Printable)

Key: LUCENE-1608
Type: New Feature New Feature
Status: Open Open
Priority: Minor Minor
Assignee: Doron Cohen
Reporter: Steven Bethard
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Lucene - Java

CustomScoreQuery should support arbitrary Queries

Created: 21/Apr/09 11:06 PM   Updated: 13/May/09 06:52 PM
Return to search
Component/s: Query/Scoring
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works LUCENE-1608.patch 2009-04-22 09:21 PM Doron Cohen 11 kB
Issue Links:
Reference
 

Lucene Fields: New


 Description  « Hide
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.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mike Klaas made changes - 21/Apr/09 11:18 PM
Field Original Value New Value
Link This issue is related to LUCENE-850 [ LUCENE-850 ]
Mike Klaas added a comment - 21/Apr/09 11:18 PM
This is probably related to my attempt at refactoring DisjunctionMaxQuery to be a query that performs an arbitrary function on its constituent subqueries.

Doron Cohen made changes - 22/Apr/09 04:01 PM
Assignee Doron Cohen [ doronc ]
Doron Cohen added a comment - 22/Apr/09 09:08 PM
I thought I had written a class exactly for this purpose but I was wrong - my class was different in that it had an actual value source, just that it was sparse - values for quite many docs were missing. It is similar in a way, but different since here the input is a query.

But I did promise... so I wrote a quick wrapper for a query to create a value source.
That value source can be used to create a value source query.

Although the patch coming soon is tested and all, I am not considering to commit this patch, because it is not clean.

I would like to reorganize this package to take better care of this request and other related issues (like LUCENE-850) and to make it worth for Solr to move to use this package. (last time I checked it wasn't). But this is a different issue...


Doron Cohen added a comment - 22/Apr/09 09:21 PM
Patch for passing arbitrary queries to custom-score-query.
Not intended for committing.
See TestQueryWrapperValueSource for usage of this wrapper.
  • Doron

Doron Cohen made changes - 22/Apr/09 09:21 PM
Attachment LUCENE-1608.patch [ 12406169 ]
Steven Bethard added a comment - 13/May/09 06:52 PM
Sorry it took so long for me to try this out, but yes, this does exactly what I need. I'd love to see the package reorganized so that this kind of thing would be easier. I'm far from a Lucene expert, but if there's anything I can do to help, let me know and I'll try to make some time for it.