This is a very ambiguous question since I don't know exactly where to start. We require the most optimized ES performance for a mission critical system. Currently our ES queries are taking somewhere around 100-200 ms to complete and the goal is to reduce this to 20 ms.
There are 2 aspects that I would like to get your inputs.
1 - What are the most important considerations and best practices for defining a ES schema for the most optimal request.
2- What are the most important consideration and best practices for querying ES to be most optimal.
And additionally how to troubleshoot where is the time spent and why are the queries so slow.
A little bit of context of the system, is a typeahead system that would take the input of the string and return a list of suggestion that match the input.
The schema that I have looks like this:
{
"domain": String
"documentId": String
"localizedText": Map<String, String>
"score": Map<String, double>
}
Here is a sample of the document:
{
"domain": "fast-food",
"documentId": "123",
"localizedText": {
"en_US": "Hamburger",
"es_ES": "Hamburguesa"
},
"score": {
"en_US": 0.5,
"es_ES": 0.4
}
}
I also expect to have thousands of different domain
The queries that I'm doing are first filtering on the domain
, to trim down the search, as you can specify multiple domains, the second step is try to do text match on the localizedText
for a given locale passed on the request, and lastly sort the candidates based on the score
, also for the same locale.
Any insights and resources will be much appreciated.
Thank you