Created
April 24, 2021 10:42
-
-
Save mfsiat/5992c07054547a9b75babd003bb46b33 to your computer and use it in GitHub Desktop.
Prefix query in Elasticsearch
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": { | |
"must": [ | |
{ | |
"prefix": {"business_name_filtered": "johukum"} | |
} | |
] | |
} | |
} , | |
"suggest": { | |
"namesuggester": { | |
"text": "johukum", | |
"term": { | |
"field": "business_name" | |
} | |
} | |
}, | |
"from": 0, | |
"size": 5, | |
"sort": [ | |
{ | |
"_geo_distance": { | |
"geo": { | |
"lat": 23.761546526247017, | |
"lon": 90.43369546206912 | |
}, | |
"order": "asc", | |
"unit": "km" | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment