Поскольку вы не упомянули в вопросе о том, сколько полей вы проиндексировали, я взял только одно поле, т.е. title
Проиндексированные документы:
{
"title":"This is an example date for effective calculation of the problems"
}
{
"title":"date date date is what he said to the children"
}
Поисковый запрос:
{
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "effective date",
"operator": "or",
"fields": [
"title" --> If you have more fields, you can
add them here
]
}
}
]
}
}
}
Результат поиска:
"hits": [
{
"_index": "my_index",
"_type": "_doc",
"_id": "1",
"_score": 0.85874003,
"_source": {
"title": "This is an example date for effective calculation of the problems"
}
},
{
"_index": "my_index",
"_type": "_doc",
"_id": "2",
"_score": 0.289459,
"_source": {
"title": "date date date is what he said to the children"
}
}
]
Чтобы получить подробное описание запроса с несколькими совпадениями, вы можете обратиться к этой официальной документации
ОБНОВЛЕНИЕ 1:
Используя query_string
{
"query": {
"query_string": {
"default_field": "title",
"query": "effective OR date"
}
}
}
Чтобы получить подробное объяснение query_string, вы можете обратиться к this
UPDATE 2:
Использование simple_query_string
{
"query": {
"simple_query_string" : {
"query": "effective date",
"fields": ["title"],
"default_operator": "or"
}
}
}
Используя все три вышеупомянутых поисковых запроса, вы получаете тот же результат поиска, и нет никакой разницы в _score