1

Suppose the model has a list of fields, and one of them - id list some related fields:

{
    'name': 'bla-bla',
    'field1': 'value1',
    'array': [
        1, 2, 3, 4
    ]
}

Necessary select those records whose values coincide with the array transmits a set of id, i.e. if I give 1, 2, 3, or vice versa 1, 2, 3, 4, 5, the row will not find, but if you pass 3, 2, 4, 1 (i.e. the order does not address), the row should be found.

Maroun
  • 94,125
  • 30
  • 188
  • 241

1 Answers1

0

You can do the following using script:

{
  "query": {
    "match_all": {}
  },
  "filter": {
    "script": {
      "script": "_source.array == [1, 2, 3, 4]"
    }
  }
}
Maroun
  • 94,125
  • 30
  • 188
  • 241
  • Do you know whether I can do this using [Yii2 ElasticSearch extension](https://github.com/yiisoft/yii2-elasticsearch)? – ErickSkrauch Aug 03 '15 at 09:47