Created
May 6, 2014 01:51
-
-
Save rcullito/cd4513766e112387b9c8 to your computer and use it in GitHub Desktop.
ElasticSearch Fuzzy Query, Favor Exact Matches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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