Skip to content

Translate function_score with one function over match_all into a Solr function query - #178

Open
serhiy-bzhezytskyy wants to merge 3 commits into
apache:mainfrom
serhiy-bzhezytskyy:function-score-to-func
Open

serhiy-bzhezytskyy wants to merge 3 commits into
apache:mainfrom
serhiy-bzhezytskyy:function-score-to-func

Conversation

@serhiy-bzhezytskyy

Copy link
Copy Markdown
Contributor

A converted function_score became q=*:*, so the operation matched every document with a constant score and measured none of the scoring. A function_score whose query is match_all (or absent) and that has a single field_value_factor (any modifier) or a gauss, exp or linear decay on a geo point now becomes {!func} with the same function. With match_all every document scores 1, so boost_mode does not change the result. Anything else (several functions, weight, missing, numeric or date decays, a scoring inner query) stays untranslated with the existing warning.

Each form was compared with OpenSearch on the same geonames documents, score by score: the ten modifiers, gauss and exp agree to a relative 1.4e-06 or better, and linear to an absolute 1.7e-07. For geonames' two operations the converter now writes what solr-orbit-workloads ships, and over 300 documents each its scores match OpenSearch's to 1.4e-07 (field_value_factor) and 3.3e-06 (gauss). The new tests fail without the change.

… function query

A converted function_score became q=*:*, so the operation matched every document with a constant score and measured none of the scoring. A function_score whose query is match_all, or absent, and that has a single field_value_factor (any modifier) or a gauss, exp or linear decay on a geo point now becomes {!func} with the same function. Each form was compared with OpenSearch document by document. Anything else (several functions, weight, missing, numeric or date decays, a scoring inner query) stays untranslated with the warning.
…tion-score-to-func

# Conflicts:
#	tests/unit/solr/test_workload_converter.py
# Conflicts:
#	tests/unit/solr/test_workload_converter.py

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant