This works great, however, I want to also be able to handle mistypes
such as pish or fish, should match phish:
My Query:
{
"from": 0,
"size": 5,
"sort": [
{
"date": {
"order": "asc"
}
}
],
"query": {
"bool": {
"must": [
{
"match_phrase_prefix": {
"text": {
"query": "phish",
"slop": 20
}
}
},
{
"match": {
"type": "performer"
}
}
],
"must_not": [
{
"bool": {
"should": [
{
"exists": {
"field": "date"
}
}
],
"must": [
{
"range": {
"date": {
"lte": "2022-08-23"
}
}
}
]
}
}
]
}
}
My mapping:
{
"id": {
"type": "long"
},
"type": {
"type": "keyword",
"ignore_above": 32766
},
"text": {
"type": "search_as_you_type"
},
"image":{
"type": "text"
},
"date": {
"type": "date",
"format": "strict_date"
}
}