I have date field in my mapping and I want to do fuzzy search on my field Below is my code
GET _search
{
"query": {
"fuzzy": {
"death_date": {
"value": "3548"
}
}
}
}
Current result don't return data based as per expectation. Although I have 3548 value it's score is less that 3549 value which appears on the top of the result I have changed my query to include range parameter as suggested
GET _search
{
"query" : {
"bool": {
"must":
{
"match": {
"marriages.marriage_year": "1630"
}
},
"should":
{
"match": {
"first_name":
{ "query" : "mary",
"fuzziness":"2"
}
}
},
"must":
{
"range" : {
"marriages.marriage_year": {
"gt" : "1620",
"lte" : "1740"
}
}
}
}
}
}
It is returning data with marriages.marriage_year= "1630" with Mary as first_name as highest score.I also want to include marriages.marriage_year between 1620 - 1740 which are not shown in the results. It is showing data only for marraige_year 1630