Вопрос

This is about reducing index space without reducing search flexibility. I have fields A and B. I want to search fields A, B, or a block of A and B with a query of terms X Y. To do this I have the following fields in my index:

field A: A
field B: B
field AB: A + B

The resulting index duplicates data and wastes space. Is there a way to have only fields A and B in my index, but still allow searching of field AB? This is different from a search of field A or field B (hit is returned when A contains X Y or B contains X Y) and it is different from a search of field A and field B (hit is returned when A contains X Y and B contains X Y). I want to catch the situation where A contains X and B contains Y, for example. Please advise.

Это было полезно?

Решение

You have all kinds of settings for a multi match query to achieve what you want.
See here - http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top