# Getting Null Pointer while using reloadable synonyms

**URL:** <https://discuss.elastic.co/t/getting-null-pointer-while-using-reloadable-synonyms/339775>\
**Category:** Elasticsearch\
**Created:** [August 1, 2023, 8:50am UTC](https://discuss.elastic.co/t/getting-null-pointer-while-using-reloadable-synonyms/339775 "2023-08-01T08:50:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Siddharth\_Gupta1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/siddharth_gupta1/32/124157_2.png) [@Siddharth\_Gupta1](https://discuss.elastic.co/u/Siddharth_Gupta1)\
**Post date:** [August 1, 2023, 8:50am UTC](https://discuss.elastic.co/t/getting-null-pointer-while-using-reloadable-synonyms/339775/1 "2023-08-01T08:50:32Z")

</div>

Hi Team  
I am currently facing an issue while utilizing readable synonyms from a file with my completion suggestor. The problem seems to be related to the search\_analyzers in my mappings. Strangely, the completion suggestor works fine when I use it with the \_analyze API.

I would like to provide you with the mappings and suggestor details that I am using:

```auto
"master_synonyms": {
          "type": "synonym_graph",
          "synonyms_path": "search_synonyms/master_synonyms.txt",
          "updateable": true
        },

```

```auto
"synonym_analyzer": {
          "filter": [
            "lowercase",
            "asciifolding",
            "master_synonyms"
          ],
          "tokenizer": "standard"
        },

```

```auto
"smartSuggestor": {
      "type": "completion",
      "analyzer": "smart_analyzer",
      "search_analyzer": "synonym_analyzer",
      "preserve_separators": true,
      "preserve_position_increments": true,
      "max_input_length": 100,
      "contexts": [
        {
          "name": "hybrid-context",
          "type": "CATEGORY",
          "path": "contextMapperFilter"
        },
        {
          "name": "provider-context",
          "type": "CATEGORY",
          "path": "provider"
        },
        {
          "name": "subCategory-context",
          "type": "CATEGORY",
          "path": "contentType.subCategory"
        },
        {
          "name": "category-context",
          "type": "CATEGORY",
          "path": "contentType.category"
        }
      ]
    }

```

```auto
ker,kera,keral,kerala=>Malayalam
chand,chandi,chandig,chandiga,chandigar,chandigarh=>Punjabi
guj,gujj,gujju=>Gujarati
bihari,bihar=>Bhojpuri
Karna,Karnat,Karnata,Karnatak,Karnataka=>Kannada

```

I am encountering this issue in my current implementation, and it is impacting the functionality of the completion suggestor. I have checked the \_analyze API, and it seems to be functioning as expected with the synonyms from the file.

Also if I am using mapping the synonyms directly without using the file it is working fine with the suggestors.

Any insights or potential solutions you can provide to address this issue would be greatly appreciated.

Thank you for your prompt attention to this matter. I look forward to your guidance.

---

<div class="post-metadata">

**Author:** ![Siddharth\_Gupta1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/siddharth_gupta1/32/124157_2.png) [@Siddharth\_Gupta1](https://discuss.elastic.co/u/Siddharth_Gupta1)\
**Post date:** [August 1, 2023, 8:51am UTC](https://discuss.elastic.co/t/getting-null-pointer-while-using-reloadable-synonyms/339775/2 "2023-08-01T08:51:47Z")

</div>

Want to know if its a known issue, or there is any issue in my configurations.

---

<div class="post-metadata">

**Author:** ![Siddharth\_Gupta1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/siddharth_gupta1/32/124157_2.png) [@Siddharth\_Gupta1](https://discuss.elastic.co/u/Siddharth_Gupta1)\
**Post date:** [August 1, 2023, 10:06am UTC](https://discuss.elastic.co/t/getting-null-pointer-while-using-reloadable-synonyms/339775/3 "2023-08-01T10:06:17Z")

</div>

Please find the error below:

```auto
Caused by: java.lang.NullPointerException: Cannot invoke \”org.elasticsearch.index.analysis.AnalyzerComponents.getCharFilters()\” because \”components\” is null

```

---

<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:** [August 29, 2023, 10:06am UTC](https://discuss.elastic.co/t/getting-null-pointer-while-using-reloadable-synonyms/339775/4 "2023-08-29T10:06:53Z")

</div>

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