lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Manuel <>
Subject Custom DoubleValuesSource to Read from Multiple Indexed DocValue Fields
Date Thu, 16 Jul 2020 22:10:57 GMT

I'm trying to write a custom DoubleValuesSource for use with a
FunctionScoreQuery instance.

To generate the final score of a document I need to:
1) Read from three indexed docValue fields and
2) Use the score of the wrapped query passed in to the FunctionScoreQuery

For example, a document A would be scored using a formula like:
((docA's_score_from_wrapped_query * some_value_x) + (docA's_field1_value *
some_value_y) + (docA's_field2_value * some_value_z)) * docA's_field3_value

How do I accomplish this?
Can this be done using one custom DoubleValuesSource or do I need one for
reading from each of the indexed docValue fields and then use a combination
of MultiFloatFunctions and SumFloatFunctions to achieve this?

Appreciate your time and help.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message