Elasticsearch the terms filter raise “filter does not support [mediatest]”

后端 未结 1 1602
一个人的身影
一个人的身影 2021-02-19 11:11

my query is like this:

{
  \"query\": {
    \"filtered\": {
      \"filter\": {
        \"bool\": {
          \"must\": [
            {
              \"term\": {         


        
相关标签:
1条回答
  • 2021-02-19 11:27

    The above is not a valid Query DSL. In the above Terms filter the values to "mediaType" field should be an array

    It should be the following :

    {
      "query": {
        "filtered": {
          "filter": {
            "bool": {
              "must": [
                {
                  "term": {
                    "online": 1
                  }
                },
                {
                  "terms": {
                    "mediaType": ["flash"]
                  }
                }
              ]
            }
          }
        }
      }
    }
    
    0 讨论(0)
提交回复
热议问题