Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

term query on long type field on version 1.6 and on 2.3 plays completely different #18888

Closed
armadilo opened this issue Jun 15, 2016 · 1 comment

Comments

@armadilo
Copy link

on version 1.6 term query on long type field act like a constant score while it's not on 2.3.

the query:
"query": { "bool": { "should": [ { "term": { "field": { "value": 13310 } } } ], "disable_coord": true }

explain on 1.6:
"_explanation": { "value": 1, "description": "ConstantScore(field: \u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000g~), product of:", "details": [ { "value": 1, "description": "boost" }, { "value": 1, "description": "queryNorm" } ] }

explain on 2.3:
"_explanation": { "value": 0.30685282, "description": "sum of:", "details": [ { "value": 0.30685282, "description": "weight(field: \u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000g~ in 0) [PerFieldSimilarity], result of:", "details": [ { "value": 0.30685282, "description": "fieldWeight in 0, product of:", "details": [ { "value": 1, "description": "tf(freq=1.0), with freq of:", "details": [ { "value": 1, "description": "termFreq=1.0", "details": [] } ] }, { "value": 0.30685282, "description": "idf(docFreq=1, maxDocs=1)", "details": [] }, { "value": 1, "description": "fieldNorm(doc=0)", "details": [] } ] } ] }, { "value": 0, "description": "match on required clause, product of:", "details": [ { "value": 0, "description": "# clause", "details": [] }, { "value": 3.2588913, "description": "_type:tweet, product of:", "details": [ { "value": 1, "description": "boost", "details": [] }, { "value": 3.2588913, "description": "queryNorm", "details": [] } ] } ] } ] }

Is this known? I couldn't find anything about this change.

@jpountz
Copy link
Contributor

jpountz commented Jun 15, 2016

See discussion at #10628 for the background of this change. This was not considered a break since the fact that queries on numerics return constant scores was not documented. Interestingly, these queries will have constant scores again in 5.0 since we are indexing numbers with a different data-stucture which cannot score.

@jpountz jpountz closed this as completed Jun 15, 2016
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

No branches or pull requests

2 participants