My Elasticsearch index is full of large English-text documents. When I search for "it is rare"
, I get 20 hits with that exact phrase and when I search for "it is rarely"
I get a different 10. How can I get all 30 hits at once?
I've tried creating creating a multi-field with the english analyzer (below), but if I search in that field then I only get results from parts of phrase (e.g., documents matchin it
or is
or rare
) instead of the whole phrase.
"mappings" : {
...
"text" : {
"type" : "string",
"fields" : {
"english" : {
"type" : "string",
"store" : true,
"term_vector" : "with_positions_offsets_payloads",
"analyzer" : "english"
}
}
},
...
Figured it out!
text
) and a sub-field with the English-ified stem words (text.english
).Here's my index configuration:
And here's what a query looks like: