Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accent insensitive search on CategorySearch #2085

Open
Gpapidas opened this issue Sep 30, 2022 · 1 comment
Open

Accent insensitive search on CategorySearch #2085

Gpapidas opened this issue Sep 30, 2022 · 1 comment

Comments

@Gpapidas
Copy link

Hello, I am using reactive search in a web application, which supports languages with diacritics and accents.

However there are cases where database values contain EUR characters but you wish to search using Non-EUR characters.
E.g. Database has "Gräsö" and you wish this to be found only by typing "Graso".

Would it be possible to add support for accent ignore?
In the language that I am using, a possible solution would be to add fuzziness, however fuzziness is not supported when using queryFormat="and" option, which is needed in order to get preferred results.

@Gpapidas
Copy link
Author

Gpapidas commented Oct 3, 2022

I managed to solve my issue partly using the following customQuery. I will leave the issue open, since this suggestion will not work for languages using more than one accent in their words, and is only a work-around.

customQuery = {(searchText) => {
  if (!searchText) {
    return {}
  }
  return {
    "query": {
      "bool": {
        "should": [
          {
            "match_phrase_prefix": {
              "field_name": searchText
            }
          },
          {
            "fuzzy": {
              "field_name": searchText
            }
          }
        ],
        "minimum_should_match": "0"
      }
    }
 }
}

@Gpapidas Gpapidas closed this as completed Oct 3, 2022
@Gpapidas Gpapidas reopened this Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant