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

Alan Woodward updated LUCENE-7623:
----------------------------------
    Attachment: LUCENE-7623.patch

Here is a patch with two new queries, FunctionScoreQuery and FunctionMatchQuery.

* FunctionScoreQuery takes a query to wrap and a DoubleValuesSource, and 
modifies the internal query's score using the per-document values.  This can 
act as a replacement for FunctionQuery using a constant or per-field 
DoubleValuesSource, or as a replacement for CustomScoreQuery or BoostedQuery 
using an expression.  The wrapped query's scores are passed to any DoubleValues 
created via getValues(LeafReaderContext, DoubleValues).

* FunctionMatchQuery takes a DoubleValuesSource and a Predicate<Double>, and 
returns any documents with a value that matches the predicate.  It works by 
linear scan, but uses two-phase iteration so it should be efficient when 
combined with a more restrictive query.  Unlike FunctionRangeQuery, it returns 
a constant score, so if you want to use the DoubleValues as scores, you will 
need to wrap it with a FunctionScoreQuery.

The patch also adds some more informative toString() implementations to 
expressions and field DoubleValues, to make the Explanations for 
FunctionScoreQuery more useful.

> Add FunctionScoreQuery and FunctionMatchQuery
> ---------------------------------------------
>
>                 Key: LUCENE-7623
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7623
>             Project: Lucene - Core
>          Issue Type: New Feature
>            Reporter: Alan Woodward
>            Assignee: Alan Woodward
>            Priority: Minor
>         Attachments: LUCENE-7623.patch
>
>
> We should update the various function scoring queries to use the new 
> DoubleValues API



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to