We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A terms query can query the _id field, as can a term filter, but not a terms filter:
terms
_id
term
curl -XPUT 'http://127.0.0.1:9200/test/?pretty=1' curl -XPUT 'http://127.0.0.1:9200/test/test/1?pretty=1' -d ' { "foo" : "bar" } ' curl -XPUT 'http://127.0.0.1:9200/test/test/2?pretty=1' -d ' { "foo" : "baz" } '
terms query works:
curl -XGET 'http://127.0.0.1:9200/test/test/_search?pretty=1' -d ' { "query" : { "terms" : { "_id" : [ 1, 2 ] } } } ' # [Fri Nov 9 18:00:28 2012] Response: # { # "hits" : { # "hits" : [ # { # "_source" : { # "foo" : "bar" # }, # "_score" : 0.35355338, # "_index" : "test", # "_id" : "1", # "_type" : "test" # }, # { # "_source" : { # "foo" : "baz" # }, # "_score" : 0.35355338, # "_index" : "test", # "_id" : "2", # "_type" : "test" # } # ], # "max_score" : 0.35355338, # "total" : 2 # }, # "timed_out" : false, # "_shards" : { # "failed" : 0, # "successful" : 5, # "total" : 5 # }, # "took" : 0 # }
terms filter doesn't work:
curl -XGET 'http://127.0.0.1:9200/test/test/_search?pretty=1' -d ' { "query" : { "constant_score" : { "filter" : { "terms" : { "_id" : [ 1, 2 ] } } } } } ' # { # "hits" : { # "hits" : [], # "max_score" : null, # "total" : 0 # }, # "timed_out" : false, # "_shards" : { # "failed" : 0, # "successful" : 5, # "total" : 5 # }, # "took" : 1 # }
term filter works:
curl -XGET 'http://127.0.0.1:9200/test/test/_search?pretty=1' -d ' { "query" : { "constant_score" : { "filter" : { "term" : { "_id" : 1 } } } } } ' # [Fri Nov 9 17:58:13 2012] Response: # { # "hits" : { # "hits" : [ # { # "_source" : { # "foo" : "bar" # }, # "_score" : 1, # "_index" : "test", # "_id" : "1", # "_type" : "test" # } # ], # "max_score" : 1, # "total" : 1 # }, # "timed_out" : false, # "_shards" : { # "failed" : 0, # "successful" : 5, # "total" : 5 # }, # "took" : 1 # }
The text was updated successfully, but these errors were encountered:
@clintongormley this seems to be fixed in master I am closing this
Sorry, something went wrong.
No branches or pull requests
A
terms
query can query the_id
field, as can aterm
filter, but not aterms
filter:terms
query works:terms
filter doesn't work:term
filter works:The text was updated successfully, but these errors were encountered: