Hello,
I have the following situation. The Devices are documents, the components nested documents.
device_1 (sum_of_component_importance: 3.2)
component_1 (importance: 1)
component_2 (importance: 0.5)
component_3 (importance: 0.2)
component_4 (importance: 1.5)
device_2 (sum_of_component_importance: 3.3)
component_1 (importance: 0.3)
component_3 (importance: 2)
component_4 (importance: 1)
I`m querying the components with a nested query. When I e.g. query for component_1 and component_3, the score for the documents should be:
device_1: 1.2
device_2: 2.3
But it is not, because searching for 2 terms causes the lucene queryNorm factor to be < 1 and change the score for the found documents.
This is no problem in most cases , but in my case it is: I want to subtract the importance sum of the NOT found components from the score.
device_1: 1.2 - (3.2 - 1.2) = -0.8
device_2: 2.3 - (3.3 - 2.3) = 1.3
It is important for me, how high the score for the not hit elements is. But sum_of_component_importance is a precalculated value, and when the score from the modules hits is multiplied by the queryNorm, I can`t just use it without knowing the queryNorm factor.
I see 4 ways to a solution:
- Disable the queryNorm somehow
- Get the queryNorm as value in a script to use it in a function_score query
- Execute the query two times, and get the queryNorm factor in the first execution. (Is it possible to get the queryNorm after a query was executed?)
- Find a complete other concept of handling this.
What are your thoughts, can you help me with this issue?
Thank you!