You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
5. Search in default catch-all field using query string rewritten to prefix query
curl -XPOST 'http://localhost:9200/messages/_search' -d '{ "query" : { "query_string" : { "query" : "tes*" , "rewrite" : "top_terms_boost_10" } } , "explain" : true }'| python -mjson.tool
The first query (step 4) works as expected -- document with id equal to 2 has higher score.
The second query (step 5) returns two documents with equal score.
The text was updated successfully, but these errors were encountered:
Sorry it has taken a while to get to this issue. You are using the wrong rewrite method - instead of top_terms_boost_10 (which applies a constant boost) you want top_terms_10, which takes the actual term weights into account.
ES ignores field level boost factors specified in mapping when computing documents' score for query string rewritten to prefix query.
Sample setup:
1. Create index and mapping.
curl -XPUT 'http://localhost:9200/messages/'
2. Create sample docs
3. Wait for ES to be synced
curl -XPOST 'http://localhost:9200/messages/_refresh'
4. Search in default catch-all field using query string rewritten to term query
5. Search in default catch-all field using query string rewritten to prefix query
The text was updated successfully, but these errors were encountered: