Search documents with apostrophes in fields

Hello,

I am quite new to Elascticsearch and try to write and search documents.
I have no problem writing documents, but I have one when I try searching for documents using a word that is stored in a field with an apostrophe :

I have a the following document :

    {
        "id": "M1_wtH0BGSGXR1CgouJc",
        "title": "Harry Potter et le prisonier d'Azkaban",
        "resume": "trop bien",
        "authors": [
            {
                "name": "Johanne"
            }
        ]
    }

When I try to search with the request :

{
  "query": {
    "multi_match" : {
      "query" : "d'azkaban",
      "fields" : [ "*"] 
    }
  }
}

it works, but with :

{
  "query": {
    "multi_match" : {
      "query" : "azkaban",
      "fields" : [ "*"] 
    }
  }
}

it does not.

Is there a way to have the search work with 'azkaban' ? Ignoring the apostrophe ?

Thank you in advance,

Gabriel de Ramecourt

Bonjour Gabriel ! :wink:

You need to use the elision token filter to analyze such a text.

It's also built in the french analyzer.

Merci Dadoonet,
it works!

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