Based on the document "tune for search speed", searching fewer fields should result into faster search response time.
But, actually it does not ....
We have previously used a multiMatch query on 4 fileds. After a reindex we have designed the new index mapping to include an aggregatedText
field, in which all those 4 fields were copied.
after a month of running the previous query (still a multiMatch on 4 fields) we chaned our query to make a single Match query on the aggregatedText
field, in the hope of making it faster!
However, unfortunately it gets worse! the response time increased by about 1.5X to 2X.
the only important thing which I found was that the Query and requestCache of the index has been decreased a lot. event after passing many hours of the initial change, they are still much lower than the previous approach.
this is my index mapping:
{
"aggregatedText":{
"type":"text",
"analyzer":"edge_ngram_index",
"search_analyzer":"edge_ngram_search"
},
"alias":{
"type":"text",
"copy_to":[
"aggregatedText"
],
"analyzer":"edge_ngram_index",
"search_analyzer":"edge_ngram_search"
},
"creationTime":{
"type":"long"
},
"creatorId":{
"type":"integer"
},
"description":{
"type":"text"
},
"documentId":{
"type":"keyword"
},
"groupLicense":{
"type":"keyword"
},
"groupStatus":{
"type":"keyword"
},
"groupType":{
"type":"keyword"
},
"memberCount":{
"type":"integer"
},
"ownerId":{
"type":"keyword"
},
"participantId":{
"type":"keyword"
},
"participantType":{
"type":"constant_keyword",
"value":"GROUP"
},
"rank":{
"type":"integer"
},
"safe":{
"type":"keyword"
},
"suspendUntil":{
"type":"integer"
},
"title":{
"type":"text",
"copy_to":[
"aggregatedText"
],
"analyzer":"edge_ngram_index",
"search_analyzer":"edge_ngram_search"
},
"verified":{
"type":"boolean"
},
"visibility":{
"type":"boolean"
}
}