Es 5.5.1 [size] query malformed, no start_object after query name


(Jean Noé Kollo) #1

Hello Es community !

We are upgrading Elasticsearch 1.7 to 5.5 in my company.

Always got this exceptions :

{"error":{"root_cause":[{"type":"parsing_exception","reason":"[size]
query malformed, no start_object after query name","line":1,"col":355}],"type":"parsing_exception","reason":"
[field_sort] failed to parse field [nested_filter]","line":1,"col":355,"caused_by":
{"type":"parsing_exception","reason":"Expected nested_filter element.","line":1,"col":355,"caused_by":
{"type":"parsing_exception","reason":"[size] query malformed, no start_object after query 
name","line":1,"col":355}}},"status":400}

The query :

{
   "from": 0,
   "size": 48,
   "query": {
      "bool": {
         "must": null,
         "filter": {
            "bool": {
               "must": [
                  {
                     "term": {
                        "published_countries.raw": "FR"
                     }
                  },
                  {
                     "nested": {
                        "path": "categories",
                        "query": {
                           "term": {
                              "categories.slug.raw": "engrais/engrais-complexes"
                           }
                        }
                     }
                  }
               ]
            }
         }
      }
   },
   "sort": [
      {
         "isProductRunOut": {
            "order": "asc"
         }
      },
      {
         "is_featured": {
            "order": "desc"
         }
      },
      {
         "total_va": {
            "order": "desc",
            "nested_filter": {
               "size": 12
            }
         }
      },
      {
         "createdAt": {
            "order": "desc"
         }
      }
   ],
   "aggs": {
      "top_12_total_va": {
         "top_hits": {
            "sort": {
               "total_va": {
                  "order": "desc"
               }
            },
            "size": 12
         }
      }
   }
}

I use Elasticsearch php client on a symfony project.

Can someone please help me ?

Thx.


(system) #3

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