I am using fuzzy and want elasticsearch to return the searched word not just the hit.
When i am searching for the word dogo and my fuzzy search fi
Named queries is the right choice to understand your query name in results. You could also try suggestion if you want to know the possible corrected terms for your query term.
{
"query": {
"bool": {
"should": [
{
"fuzzy": {
"title": "dogo"
}
},
{
"fuzzy": {
"title": "fox"
}
}
]
}
},
"highlight" : {
"fields" : {
"title":{
"pre_tags": [
"===>"
],
"post_tags": [
"<==="
],
"fragment_size": 200,
"number_of_fragments": 100
}
}
} ,
"suggest" : {
"title_suggestion" : {
"text" : "fox dogo",
"term" : {
"field" : "title"
}
}
}
}