# Error: \_analyze request throws NPE

**URL:** <https://discuss.elastic.co/t/error--analyze-request-throws-npe/44564>\
**Category:** Elasticsearch\
**Created:** [March 16, 2016, 2:26pm UTC](https://discuss.elastic.co/t/error--analyze-request-throws-npe/44564 "2016-03-16T14:26:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralphlevan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ralphlevan/32/5580_2.png) [@ralphlevan](https://discuss.elastic.co/u/ralphlevan)\
**Post date:** [March 16, 2016, 2:26pm UTC](https://discuss.elastic.co/t/error--analyze-request-throws-npe/44564/1 "2016-03-16T14:26:15Z")

</div>

When I send "GET \_analyze?analyzer=bob&text="test"" to ES (using Sense), I get no response. When I look in the logs, I see that TransportSingleShardAction$AsyncSingleAction has thrown a NullPointerException.

[2016-03-15 16:36:03,634][ERROR][transport] [esap01] failed to handle exception for action [indices:admin/analyze[s]], handler [org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction$1@7304fe5c]  
java.lang.NullPointerException  
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.perform(TransportSingleShardAction.java:195)  
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.access$700(TransportSingleShardAction.java:115)  
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction$1.handleException(TransportSingleShardAction.java:174)

Now, clearly the "bob" analyzer is bogus and the source of the error. When I replace "bob" with "standard", it works just fine. The real problem for me is that I'm trying to test a custom analyzer and I get the same result when I use it. The unhelpfulness of the response and the logging doesn't tell me if my code is bad or if the analyzer is unrecognized. (I'm pretty sure the analyzer is recognized because I can use it in a mapping.)

Any suggestions for how to work around this problem?

Using ES 2.1.0.

Thanks!

---

<div class="post-metadata">

**Author:** ![ralphlevan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ralphlevan/32/5580_2.png) [@ralphlevan](https://discuss.elastic.co/u/ralphlevan)\
**Post date:** [March 16, 2016, 2:40pm UTC](https://discuss.elastic.co/t/error--analyze-request-throws-npe/44564/2 "2016-03-16T14:40:25Z")

</div>

I just installed analysis-phonetic and get the same lack of response when I try it:  
GET \_analyze?analyzer=analysis-phonetic&text="test"

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 16, 2016, 3:18pm UTC](https://discuss.elastic.co/t/error--analyze-request-throws-npe/44564/3 "2016-03-16T15:18:38Z")

</div>

There is a glitch in ES regarding `_analyze` endpoint without a given index name.

Please use

```auto
GET /test/_analyze?analyzer=bob&text=alice

```

Then, on an endpoint for index `test` for an undefined analyzer `bob`, you will see a message like

```auto
{
   "error": {
      "root_cause": [
         {
            "type": "remote_transport_exception",
            "reason": "[Nathaniel Essex][10.3.2.32:9300][indices:admin/analyze[s]]"
         }
      ],
      "type": "illegal_argument_exception",
      "reason": "failed to find analyzer [bob]"
   },
   "status": 400
}

```

---

<div class="post-metadata">

**Author:** ![ralphlevan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ralphlevan/32/5580_2.png) [@ralphlevan](https://discuss.elastic.co/u/ralphlevan)\
**Post date:** [March 16, 2016, 5:26pm UTC](https://discuss.elastic.co/t/error--analyze-request-throws-npe/44564/4 "2016-03-16T17:26:33Z")

</div>

It's not quite that simple, because it does work with analyzer=standard and no index.

Thanks! That gets me another step further!

Ralph

---

<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:** [July 5, 2017, 11:07pm UTC](https://discuss.elastic.co/t/error--analyze-request-throws-npe/44564/5 "2017-07-05T23:07:49Z")

</div>


