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

**URL:** <https://discuss.elastic.co/t/caused-by-java-lang-nullpointerexception-cannot-invoke-org-elasticsearch-index-analysis-analyzercomponents-getcharfilters-because-components-is-null/251824>\
**Category:** Elasticsearch\
**Created:** [October 13, 2020, 12:03am UTC](https://discuss.elastic.co/t/caused-by-java-lang-nullpointerexception-cannot-invoke-org-elasticsearch-index-analysis-analyzercomponents-getcharfilters-because-components-is-null/251824 "2020-10-13T00:03:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdoucy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jdoucy/32/77059_2.png) [@jdoucy](https://discuss.elastic.co/u/jdoucy)\
**Post date:** [October 13, 2020, 12:03am UTC](https://discuss.elastic.co/t/caused-by-java-lang-nullpointerexception-cannot-invoke-org-elasticsearch-index-analysis-analyzercomponents-getcharfilters-because-components-is-null/251824/1 "2020-10-13T00:03:25Z")

</div>

Hi there,  
I get an issue with \_reload\_search\_analyzers

I simply try to reload a synonym file but it doesn't reload it, no error, just the new file is not taken into account.

So I tried the old way, closing and re-opening the index and I get this error:

`org.elasticsearch.ElasticsearchException$1: Cannot invoke \"org.elasticsearch.index.analysis.AnalyzerComponents.getCharFilters()\" because \"components\" is null"`

My config:

```
"analyzer": {
        "synonym": {
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "kstem",
            "synonyms"
          ]
        }
      },
      "filter": {
        "synonyms": {
          "type": "synonym",
          "synonyms_path": "synonyms/all.txt",
          "updateable": true
        }
      },

```

The synonym analyzer is used on search\_analyzer for a completion type and on standard text field. It only fails with the completion type:

```
  "suggest": {
    "type": "completion",
    "analyzer": "simple",
    "search_analyzer": "synonym"
  },

```

Tried on 7.3.2 7.8.0 7.8.1 and 7.9.3

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [October 14, 2020, 12:25pm UTC](https://discuss.elastic.co/t/caused-by-java-lang-nullpointerexception-cannot-invoke-org-elasticsearch-index-analysis-analyzercomponents-getcharfilters-because-components-is-null/251824/2 "2020-10-14T12:25:05Z")

</div>

Hi,

let me see if I can help.

> [@jdoucy](#):
>
> So I tried the old way, closing and re-opening the index and I get this error:

Where do you see this error and when? Directly after reopening or after searching/indexing again? Is there anything else in the error message? Can you find any longer stack traces in the elasticsearch logs that relate to this error? It would be interesting to see where the exception actually happens.

If the synonym file isn't super large, can you add it here? What parts of it are you adding that you don't see being used after the reload? Does the rest (the synonyms from the "old" file") still work?

---

<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:** [November 11, 2020, 12:25pm UTC](https://discuss.elastic.co/t/caused-by-java-lang-nullpointerexception-cannot-invoke-org-elasticsearch-index-analysis-analyzercomponents-getcharfilters-because-components-is-null/251824/3 "2020-11-11T12:25:19Z")

</div>

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