Skip to content

Instantly share code, notes, and snippets.

@rcullito
Created May 6, 2014 01:51
Show Gist options
  • Save rcullito/cd4513766e112387b9c8 to your computer and use it in GitHub Desktop.
Save rcullito/cd4513766e112387b9c8 to your computer and use it in GitHub Desktop.
ElasticSearch Fuzzy Query, Favor Exact Matches
{
"query": {
"bool": {
"should": [
{
"match": {
"_all": search_term
}
},
{
"match": {
"_all": {
"query": search_term,
"fuzziness": "1",
"prefix_length": 2
}
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment