Nested filter error "child query must only match non-parent docs"

Hi, elasticsearch response return an error:
// [500 Server Exception] illegal_state_exception: child query must only match non-parent docs, but parent docID=4 matched childScorer=class org.apache.lucene.search.ConjunctionScorer

My request:

   {
  "size": 9,
  "sort": [
    {
      "category.position": {
        "order": "asc",
        "missing": "_last",
        "unmapped_type": "string",
        "nested_path": "category",
        "mode": "min",
        "nested_filter": {
          "nested": {
            "path": "category",
            "score_mode": "none",
            "query": {
              "terms": {
                "category.category_id": [
                  "98"
                ],
                "boost": 1
              }
            },
            "boost": 1
          }
        }
      }
    },
    {
      "_score": {
        "order": "desc"
      }
    },
    {
      "entity_id": {
        "order": "desc",
        "missing": "_first",
        "unmapped_type": "string"
      }
    }
  ],
  "from": 0,
  "query": {
    "constant_score": {
      "filter": {
        "bool": {
          "must": [
            {
              "nested": {
                "path": "category",
                "score_mode": "none",
                "query": {
                  "bool": {
                    "must": [
                      {
                        "bool": {
                          "must_not": [
                            {
                              "term": {
                                "category.is_virtual": {
                                  "value": true,
                                  "boost": 1
                                }
                              }
                            }
                          ],
                          "boost": 1
                        }
                      },
                      {
                        "terms": {
                          "category.category_id": [
                            "98"
                          ],
                          "boost": 1
                        }
                      }
                    ],
                    "must_not": [],
                    "should": [],
                    "boost": 1
                  }
                },
                "boost": 1
              }
            },
            {
              "terms": {
                "visibility": [
                  2,
                  4
                ],
                "boost": 1
              }
            }
          ],
          "must_not": [],
          "should": [],
          "boost": 1
        }
      },
      "boost": 1
    }
  },
  "aggregations": {
    "categories": {
      "filters": {
        "filters": []
      }
    },
    "option_text_collection_product": {
      "terms": {
        "field": "option_text_collection_product",
        "size": 10,
        "order": {
          "_count": "desc"
        }
      }
    },
    "option_text_classification": {
      "terms": {
        "field": "option_text_classification.untouched",
        "size": 10,
        "order": {
          "_count": "desc"
        }
      }
    },
    "option_text_colorfamily": {
      "terms": {
        "field": "option_text_colorfamily",
        "size": 10,
        "order": {
          "_count": "desc"
        }
      }
    },
    "option_text_size_name": {
      "terms": {
        "field": "option_text_size_name",
        "size": 20,
        "order": {
          "_count": "desc"
        }
      }
    }
  }
}

Could someone advise what is wrong with query?
Elasticsearch 2.4.5
PHP 7.0.6

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