Concept "Full text queries > match_phrase (aka proximity)"
C0089068485
Jump to navigation
Jump to search
|
- does take a single field; does not take multiple fields
https://marcobonzanini.com/2015/02/09/phrase-match-and-proximity-search-in-elasticsearch/
- if we need to match all the query terms in their relative position
Proximity Search
- the order of the terms doesn’t really matter, as long as they occur somehow within the same context
- flag slop: define the search window, so how far we allow the terms to be
Within-Sentence Proximity Search
- need to match terms occurring in a specific context
- have a specific structure (sections, sentences, …)
- but not a specific window/slop size
- https://www.elastic.co/guide/en/elasticsearch/reference/current/position-increment-gap.html
- When indexing text fields with multiple values a "fake" gap is added between the values to prevent most phrase queries from matching across the values.
Examples
Query: "WikiAhoi Mitarbeiter"
Content: "Für die Arbeit im Wiki steht WikiAhoi Ihren Mitarbeiterinnen und Mitarbeitern gerne auch nach dem Rollout beratend zur Seite.".