Malformed Query

Hi,
I am running following query.

GET products/_search 
{
  "size": 0, 
  "aggs": {
    "products": {
      "terms": {
        "field": "product_id",
        "size": 10
      },"aggs": {
        "result": {
           "top_hits": {
             "size": 1, 
            "_source": {"includes": []}
          }
        }
      }
    }
  },
  "query": {
    "bool": {
      "must": [
        {
          "multi_match": {
            "query": "top"
          }
        }
      ],
      "filter": {
        "script": {
          "script": {
            "source": "doc['display_product_color_id'].value == doc['color_id'].value",
            "lang": "painless"
          }
        }
        , "and": {
          "filters": [
            {
              "script": {
                "script": {
                  "source": "doc['image_src'].value != ''",
                  "lang": "painless"
                }
              }
            }
          ]
        }
      }
    }
  }
}

I am getting following error

[script] malformed query, expected [END_OBJECT] but found [FIELD_NAME]

thanks

guys I need help please any one ?

filter does not have an and field. Perhaps you meant to write something like

"filter": [
  {"script": ...},
  {"script": ...}
]

instead?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.