Very Slow query on ElasticSearch

I have the next Elastic query :

{
  "_source":  {"includes": ["sample.id*"]},
  "query": {
    "filtered": {
      "query": { "match_all": {} },
      "filter": {
        "nested": {
          "path": "sample.covered_region",
          "query": {
            "filtered": {
               "query": {
                    "term": {"sample.covered_region.chr": "chr10"}
               },
               "filter": {
                   "bool": {
                       "must": [
                        {
                          "range": {
                            "sample.covered_region.start": {
                              "lte": "87713311"
                            }
                          }
                        },
                        {
                          "range": {
                            "sample.covered_region.end": {
                              "gte": "87713311"
                            }
                          }
                        }
                        ]
                   }
               }
            }
          }
        }
      }
    }
  }
}

but runs very very very slow... (8 seconds!)

Anybody knows a more efficient way to search? Thanks!!!

If I do the same query only with one range I have very good time result (300 ms)

{
  "_source":  {"includes": ["sample.id*"]},
  "query": {
    "filtered": {
      "query": { "match_all": {} },
      "filter": {
        "nested": {
          "path": "sample.covered_region",
          "query": {
            "filtered": {
               "query": {
                    "term": {"sample.covered_region.chr": "chr10"}
               },
               "filter": {
                   "bool": {
                       "must": [
                        {
                          "range": {
                            "sample.covered_region.start": {
                              "lte": "87713311"
                            }
                          }
                        }
                        ]
                   }
               }
            }
          }
        }
      }
    }
  }
}

whats wrong here??

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