I'm an ElasticNoob, but I've been playing around with some simple phrase matching as follows:
query: {
match_phrase: {
my_field: {
query: "silly dogs playing about",
slop: 100
}
}
}
But this only matches entries that have all 4 terms (silly, dogs, playing, about). Ideally it'd still match something like "silly dogs that are playing" which doesn't have the "about" keyword (it would get a lower score because of this).
This seems like a very common use case for a text search engine so I figured my Google-fu must be weak because I can't find anything about partial phrase matching in elastic search.
Can someone point me in the right direction here? Just to be clear:
- The order of keywords matters (
match_phrase
andslop
allow us to do this) - The number of keywords matched matters (
match_phrase
simply excludes items if any keywords are missing - this is not ideal for my situation)
Thanks!