Query with multiple values on a property with one value in Elasticsearch

后端 未结 1 900
有刺的猬
有刺的猬 2021-02-12 14:03

I am trying to build on this query a little bit. The index I am searching also has a field \"entity\" with an id. So a few records will have \"entity\" : 16, \"entity\" 156 etc,

1条回答
  •  醉话见心
    2021-02-12 14:42

    Use "terms" instead of "term".

    https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-filter.html

    { "terms" : { "entity" : [ 123, 1234, ... ] }}

    0 讨论(0)
提交回复
热议问题