Slow bool query

The following request takes at least 500ms every time we execute it. This is on a an index with 5 primary shards of 1.2GB each. Is there anything in the query that would explain the slowness ? The cluster is otherwise performant. We're still running ES 2.4.1.

{
  "query": {
    "filtered": {
      "filter": {
        "bool": {
          "must": [
            {
              "has_parent": {
                "type": "article",
                "filter": {
                  "bool": {
                    "must": [
                      {
                        "term": {
                          "account_id": 67316
                        }
                      },
                      {
                        "term": {
                          "brand_id": 3600001925
                        }
                      },
                      {
                        "terms": {
                          "section_id": [
                            200923332,
                            3600117465
                          ]
                        }
                      }
                    ],
                    "must_not": []
                  }
                }
              }
            },
            {
              "term": {
                "is_active": true
              }
            },
            {
              "terms": {
                "status": [
                  "draft",
                  "published"
                ]
              }
            },
            {
              "terms": {
                "is_source": [
                  true
                ]
              }
            }
          ],
          "must_not": []
        }
      },
      "query": {
        "multi_match": {
          "fields": [
            "body*^1.5",
            "title*^2"
          ],
          "query": "",
          "type": "phrase_prefix",
          "zero_terms_query": "all"
        }
      }
    }
  },
  "sort": {
    "updated.timestamp": {
      "nested_path": "updated",
      "order": "desc"
    }
  }
}

Parent/Child + Nested fields (sort) are most likely the ones I'd think about.

1 Like

I remember seeing similar problem with the project that I am working on.
Initially, we were using parent-child documents where the search response times are way higher. We migrated to nested structure and noticed considerable change in the search response times.

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