Hello, I use a really strong request for my project. I tried to follow Elasticsearch tunes for search speed but it looks like its slower than before. Here you can find my request before I did the optimizations :
{
"query": {
"bool": {
"filter": [
{
"bool": {
"must": [
{
"bool": {
"must": [
{
"bool": {
"must": [
{
"bool": {
"must": [
{
"term": {
"countryId": {
"value": "fr"
}
}
},
{
"term": {
"siteId": {
"value": "vz"
}
}
},
{
"term": {
"periodicityId": {
"value": 3
}
}
},
{
"bool": {
"should": [
{
"range": {
"budgetMin": {
"lte": 479000
}
}
},
{
"bool": {
"must_not": [
{
"exists": {
"field": "budgetMin"
}
}
]
}
}
]
}
},
{
"bool": {
"should": [
{
"range": {
"budgetMax": {
"gte": 479000
}
}
},
{
"bool": {
"must_not": [
{
"exists": {
"field": "budgetMax"
}
}
]
}
}
]
}
},
{
"bool": {
"should": [
{
"range": {
"roomMin": {
"lte": 4
}
}
},
{
"bool": {
"must_not": [
{
"exists": {
"field": "roomMin"
}
}
]
}
}
]
}
},
{
"bool": {
"should": [
{
"range": {
"roomMax": {
"gte": 4
}
}
},
{
"bool": {
"must_not": [
{
"exists": {
"field": "roomMax"
}
}
]
}
}
]
}
},
{
"bool": {
"should": [
{
"range": {
"bedRoomMin": {
"lte": 3
}
}
},
{
"bool": {
"must_not": [
{
"exists": {
"field": "bedRoomMin"
}
}
]
}
}
]
}
},
{
"bool": {
"should": [
{
"range": {
"bedRoomMax": {
"gte": 3
}
}
},
{
"bool": {
"must_not": [
{
"exists": {
"field": "bedRoomMax"
}
}
]
}
}
]
}
},
{
"bool": {
"should": [
{
"range": {
"surfaceMin": {
"lte": 88
}
}
},
{
"bool": {
"must_not": [
{
"exists": {
"field": "surfaceMin"
}
}
]
}
}
]
}
},
{
"bool": {
"should": [
{
"range": {
"surfaceMax": {
"gte": 88
}
}
},
{
"bool": {
"must_not": [
{
"exists": {
"field": "surfaceMax"
}
}
]
}
}
]
}
},
{
"term": {
"propertyTypes": {
"value": 6
}
}
},
{
"term": {
"indiv": {
"value": false
}
}
},
{
"term": {
"withVisual3DLink": {
"value": false
}
}
}
],
"must_not": [
{
"term": {
"advertType": {
"value": "rentals"
}
}
},
{
"exists": {
"field": "landSurfaceMin"
}
},
{
"exists": {
"field": "landSurfaceMax"
}
}
]
}
},
{
"bool": {
"should": [
{
"bool": {
"must": [
{
"bool": {
"should": [
{
"term": {
"cityIds": {
"value": 19270
}
}
},
{
"term": {
"departmentIds": {
"value": 4325
}
}
},
{
"term": {
"regionIds": {
"value": 979
}
}
}
]
}
},
{
"match": {
"searchMode": {
"query": "default"
}
}
}
]
}
},
{
"bool": {
"must": [
{
"geo_shape": {
"polygonalShapes": {
"shape": {
"type": "point",
"coordinates": [
-1.7193224,
48.0779145
]
}
}
}
},
{
"bool": {
"should": [
{
"match": {
"searchMode": {
"query": "polygonal"
}
}
},
{
"match": {
"searchMode": {
"query": "isochrone"
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"geo_shape": {
"radius": {
"shape": {
"type": "point",
"coordinates": [
-1.7193224,
48.0779145
]
}
}
}
},
{
"match": {
"searchMode": {
"query": "radius"
}
}
}
]
}
},
{
"bool": {
"must": [
{
"geo_shape": {
"polygonalShapes": {
"shape": {
"type": "point",
"coordinates": [
-1.7193224,
48.0779145
]
},
"relation": "contains"
}
}
},
{
"match": {
"searchMode": {
"query": "aspirational_search"
}
}
}
],
"must_not": [
{
"geo_shape": {
"polygonalHoles": {
"shape": {
"type": "point",
"coordinates": [
-1.7193224,
48.0779145
]
},
"relation": "contains"
}
}
}
]
}
}
]
}
},
{
"term": {
"reducePrice": {
"value": false
}
}
},
{
"term": {
"withVideoLink": {
"value": false
}
}
},
{
"term": {
"isNotOverlooked": {
"value": false
}
}
},
{
"term": {
"isNorthFacing": {
"value": false
}
}
},
{
"term": {
"isWestFacing": {
"value": false
}
}
},
{
"term": {
"isEastFacing": {
"value": false
}
}
},
{
"term": {
"isLastFloor": {
"value": false
}
}
}
]
}
},
{
"bool": {
"should": [
{
"term": {
"floorPreference": {
"value": "no_ground_floor"
}
}
},
{
"term": {
"floorPreference": {
"value": "none"
}
}
},
{
"bool": {
"must_not": [
{
"exists": {
"field": "floorPreference"
}
}
]
}
}
]
}
}
]
}
},
{
"bool": {
"should": [
{
"bool": {
"must": [
{
"term": {
"isFurnished": {
"value": false
}
}
}
],
"must_not": [
{
"term": {
"unfurnished": {
"value": true
}
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"unfurnished": {
"value": true
}
}
}
],
"must_not": [
{
"term": {
"isFurnished": {
"value": false
}
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"isFurnished": {
"value": false
}
}
},
{
"term": {
"unfurnished": {
"value": true
}
}
}
]
}
}
]
}
},
{
"term": {
"hasPool": {
"value": false
}
}
},
{
"term": {
"hasCellar": {
"value": false
}
}
},
{
"term": {
"hasGarage": {
"value": false
}
}
},
{
"term": {
"hasHandicapAccess": {
"value": false
}
}
},
{
"term": {
"hasTerrace": {
"value": false
}
}
},
{
"term": {
"hasFireplace": {
"value": false
}
}
},
{
"term": {
"hasClosets": {
"value": false
}
}
},
{
"term": {
"hasParquet": {
"value": false
}
}
},
{
"term": {
"hasBuildingManager": {
"value": false
}
}
},
{
"term": {
"hasAlarm": {
"value": false
}
}
}
]
}
}
]
}
},
"size": 10000
}
Sorry for the long request.
Do you have any idea what can I do to have faster request and to limit CPU/Disk usage ?
Thanks for the time you'll take for me