Query cache is empty


(Dhananjoy Biswas) #1

I'am using this same query for each keyword:

{
    'query': {
      'bool': {
        'filter': [
            { 'exists': { 'field': 'title' } },
            { 'exists': { 'field': 'price' } },
            { 'exists': { 'field': 'description' } },
            { 'exists': { 'field': 'images' } },
            { 'exists': { 'field': 'dimensions.width' } },
            { 'exists': { 'field': 'dimensions.length' } },
            { 'exists': { 'field': 'dimensions.weight' } },
            { 'exists': { 'field': 'dimensions.height' } },
            { 'range' : { 'price' : { 'gt' : 400 } } },
            { 'range' : { 'dimensions.weight' : { 'gt' : 6 } } },
        ],
        'should': [
          { 'match': { 'title': { 'query': keyword, 'boost': 2 } } },
          { 'match': { 'description': { 'query': keyword } } },
          { 'match': { 'brand': { 'query': keyword, 'boost': 2 } } }
        ]
      }
    }
}

But the queries are very slow (~2-3s in average, total docs are ~10M) and I'm seeing no cache in stats. Aren't the filters supposed to get cached automatically?

"query_cache": {
  "memory_size": "0b",
  "memory_size_in_bytes": 0,
  "total_count": 0,
  "hit_count": 0,
  "miss_count": 0,
  "cache_size": 0,
  "cache_count": 0,
  "evictions": 0
},
"fielddata": {
  "memory_size": "0b",
  "memory_size_in_bytes": 0,
  "evictions": 0,
  "fields": {}
}

(system) #2

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