Search sas you type working great, but I need fuzziness / misspell correction

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"
    }
}

Hi @pthreat

I believe that not be possible. Read this issue git.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.