Hey there ,
I know that this type of question asked before in some other cases but i really need this to be sure if in my case, Match query or Term query is faster.
I'm gonna ask the question with an example :
The text that i'm gonna search "john-doe-amsterdam-other-field-other-field-...."
In my index ;
person: "john-doe",
city:"amsterdam",
other_field : "other-field",
other_field : "other-field",
I know that amsterdam is a city and can handle extra fields but "john-doe" in my application. So in this case i have two options.
1- Split the text remove amsterdam and other extra fields before search and do a Term query on person.
2- Analyze the text("john-doe-amsterdam-other-field-other-field) while indexing with pattern tokinizer ("-") and do a Match Query.
(The output of analyze will be indexed i think and match query will check a list of string.)
So in this case, i guess text = field will be faster than list = list
Anyway which method would you choose ? Doing string process in web server and then ask Elasticsearch or leave it to ElasticSearch completely ? Does match query run as well as term query in any circumstances?