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": {}
}