# Search documents with apostrophes in fields

**URL:** <https://discuss.elastic.co/t/search-documents-with-apostrophes-in-fields/292162>\
**Category:** Elasticsearch\
**Created:** [December 16, 2021, 1:37pm UTC](https://discuss.elastic.co/t/search-documents-with-apostrophes-in-fields/292162 "2021-12-16T13:37:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabriel\_DE\_RAMECOURT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gabriel_de_ramecourt/32/99120_2.png) [@Gabriel\_DE\_RAMECOURT](https://discuss.elastic.co/u/Gabriel_DE_RAMECOURT)\
**Post date:** [December 16, 2021, 1:37pm UTC](https://discuss.elastic.co/t/search-documents-with-apostrophes-in-fields/292162/1 "2021-12-16T13:37:44Z")

</div>

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 :

```auto
    {
        "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 :

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

```

it works, but with :

```auto
{
  "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

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 16, 2021, 5:25pm UTC](https://discuss.elastic.co/t/search-documents-with-apostrophes-in-fields/292162/2 "2021-12-16T17:25:16Z")

</div>

Bonjour Gabriel ! 😉

You need to use the [elision token filter](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-elision-tokenfilter.html) to analyze such a text.

It's also built in the [french analyzer](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-lang-analyzer.html#french-analyzer).

---

<div class="post-metadata">

**Author:** ![Gabriel\_DE\_RAMECOURT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gabriel_de_ramecourt/32/99120_2.png) [@Gabriel\_DE\_RAMECOURT](https://discuss.elastic.co/u/Gabriel_DE_RAMECOURT)\
**Post date:** [December 17, 2021, 1:47pm UTC](https://discuss.elastic.co/t/search-documents-with-apostrophes-in-fields/292162/3 "2021-12-17T13:47:00Z")

</div>

Merci Dadoonet,  
it works!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 14, 2022, 1:47pm UTC](https://discuss.elastic.co/t/search-documents-with-apostrophes-in-fields/292162/4 "2022-01-14T13:47:13Z")

</div>

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