I am planning to use elasticsearch to index product attributes. Each document should have around 60 fixed fields. I was reading the documentation about tuning for search speed. It mentions that when query_string or multi_match query targets more fields, the performance is slower. Does that statement apply for match or match_phrase queries?
Example
Query 1:
{
"mappings": {
"properties": {
"case_color": {
"type": "text", // keyword type is not flexible enough in my case
},
"case_finish": {
"type": "text",
}
}
}
}
{
"query": {
"bool": {
"must": [
{
"match": {
"case_color": {
"query": "blue"
}
}
},
{
"match": {
"case_finish": {
"query": "polished"
}
}
}
]
}
}
}
Query 2:
{
"mappings": {
"properties": {
"case": {
"type": "text",
},
}
}
}
{
"query": {
"bool": {
"must": [
{
"match": {
"case": {
"query": "blue color"
}
}
},
{
"match": {
"case": {
"query": "polished finish"
}
}
}
]
}
}
}
Is it better to put case color and finish attributes into one big field "case" than splitting them into different fields?
However, by putting all case related attributes into the "case" field, it would contain more words:
case: blue color, brushed and matte finish, plastic material
By splitting them into different fields, each field will have fewer words:
case_color: blue
case_finish: brushed and matte
material: plastic
I would like to know which approach is better.