# NullPointerException with default analyzer

**URL:** <https://discuss.elastic.co/t/nullpointerexception-with-default-analyzer/3377>\
**Category:** Elasticsearch\
**Created:** [September 28, 2010, 12:19pm UTC](https://discuss.elastic.co/t/nullpointerexception-with-default-analyzer/3377 "2010-09-28T12:19:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sezgin\_kucukkaraasla](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@sezgin\_kucukkaraasla](https://discuss.elastic.co/u/sezgin_kucukkaraasla)\
**Post date:** [September 28, 2010, 12:19pm UTC](https://discuss.elastic.co/t/nullpointerexception-with-default-analyzer/3377/1 "2010-09-28T12:19:07Z")

</div>

Hi,  
I'm trying to set a default analyzer for my index with the following  
settings:

index.analysis.analyzer.default.tokenizer: keyword  
index.analysis.analyzer.default.filter.0: lowercase

But when I try to index some entry without providing a mapping, I got a null  
pointer exception. The entry as simple as the following:

{"name":"sezgin"}

Here is the trace:

org.elasticsearch.transport.RemoteTransportException: [Jim  
Hammond][inet[/192.168.1.102:9300]][indices/index/shard/index]  
Caused by: org.elasticsearch.action.support.replication.ReplicationShardOperationFailedException:  
[topo\_topology\_09280306][4]  
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:392)  
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.access$400(TransportShardReplicationOperationAction.java:208)  
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:278)  
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)  
at java.lang.Thread.run(Thread.java:619)  
Caused by: java.lang.NullPointerException  
at org.elasticsearch.common.lucene.all.AllTokenStream.incrementToken(AllTokenStream.java:59)  
at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:137)  
at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:246)  
at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:821)  
at org.apache.lucene.index.DocumentsWriter.addDocument(DocumentsWriter.java:797)  
at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1981)  
at org.elasticsearch.index.engine.robin.RobinEngine.create(RobinEngine.java:189)  
at org.elasticsearch.index.shard.service.InternalIndexShard.innerCreate(InternalIndexShard.java:213)  
at org.elasticsearch.index.shard.service.InternalIndexShard.create(InternalIndexShard.java:201)  
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:135)  
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:60)  
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:381)  
... 5 more

Thanks in advance,  
Sezgin Kucukkaraaslan

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 28, 2010, 12:55pm UTC](https://discuss.elastic.co/t/nullpointerexception-with-default-analyzer/3377/2 "2010-09-28T12:55:36Z")

</div>

Hey,

This exception comes from the \_all field which also ends up using the  
keyword analyzer. I have pushed a fix for it, but note that it does not make  
sense to have the \_all field use the keyword analyzer (think of the \_all  
field as long text of all the json values in the document). You can either  
disable the \_all field if what you want is just keyword based analyzed  
fields, or configure it to use a different analyzer.

-shay.banon

2010/9/28 sezgin küçükkaraaslan [sezo104@gmail.com](mailto:sezo104@gmail.com)

> Hi,  
> I'm trying to set a default analyzer for my index with the following  
> settings:
> 
> index.analysis.analyzer.default.tokenizer: keyword  
> index.analysis.analyzer.default.filter.0: lowercase
> 
> But when I try to index some entry without providing a mapping, I got a  
> null pointer exception. The entry as simple as the following:
> 
> {"name":"sezgin"}
> 
> Here is the trace:
> 
> org.elasticsearch.transport.RemoteTransportException: [Jim Hammond][inet[/192.168.1.102:9300]][indices/index/shard/index]  
> Caused by: org.elasticsearch.action.support.replication.ReplicationShardOperationFailedException: [topo\_topology\_09280306][4]  
> at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:392)  
> at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.access$400(TransportShardReplicationOperationAction.java:208)  
> at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:278)  
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)  
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)  
> at java.lang.Thread.run(Thread.java:619)  
> Caused by: java.lang.NullPointerException  
> at org.elasticsearch.common.lucene.all.AllTokenStream.incrementToken(AllTokenStream.java:59)  
> at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:137)  
> at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:246)  
> at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:821)  
> at org.apache.lucene.index.DocumentsWriter.addDocument(DocumentsWriter.java:797)  
> at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1981)  
> at org.elasticsearch.index.engine.robin.RobinEngine.create(RobinEngine.java:189)  
> at org.elasticsearch.index.shard.service.InternalIndexShard.innerCreate(InternalIndexShard.java:213)  
> at org.elasticsearch.index.shard.service.InternalIndexShard.create(InternalIndexShard.java:201)  
> at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:135)  
> at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:60)  
> at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:381)  
> ... 5 more
> 
> Thanks in advance,  
> Sezgin Kucukkaraaslan

---

<div class="post-metadata">

**Author:** ![sezgin\_kucukkaraasla](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@sezgin\_kucukkaraasla](https://discuss.elastic.co/u/sezgin_kucukkaraasla)\
**Post date:** [September 28, 2010, 12:59pm UTC](https://discuss.elastic.co/t/nullpointerexception-with-default-analyzer/3377/3 "2010-09-28T12:59:12Z")

</div>

I see, I'd better disable the \_all field. Thank you very much...

On Tue, Sep 28, 2010 at 3:55 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Hey,
> 
> This exception comes from the \_all field which also ends up using the  
> keyword analyzer. I have pushed a fix for it, but note that it does not make  
> sense to have the \_all field use the keyword analyzer (think of the \_all  
> field as long text of all the json values in the document). You can either  
> disable the \_all field if what you want is just keyword based analyzed  
> fields, or configure it to use a different analyzer.
> 
> -shay.banon
> 
> 2010/9/28 sezgin küçükkaraaslan [sezo104@gmail.com](mailto:sezo104@gmail.com)
> 
> Hi,
> 
> > I'm trying to set a default analyzer for my index with the following  
> > settings:
> > 
> > index.analysis.analyzer.default.tokenizer: keyword  
> > index.analysis.analyzer.default.filter.0: lowercase
> > 
> > But when I try to index some entry without providing a mapping, I got a  
> > null pointer exception. The entry as simple as the following:
> > 
> > {"name":"sezgin"}
> > 
> > Here is the trace:
> > 
> > org.elasticsearch.transport.RemoteTransportException: [Jim Hammond][inet[/192.168.1.102:9300]][indices/index/shard/index]  
> > Caused by: org.elasticsearch.action.support.replication.ReplicationShardOperationFailedException: [topo\_topology\_09280306][4]  
> > at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:392)  
> > at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.access$400(TransportShardReplicationOperationAction.java:208)  
> > at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:278)  
> > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)  
> > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)  
> > at java.lang.Thread.run(Thread.java:619)  
> > Caused by: java.lang.NullPointerException  
> > at org.elasticsearch.common.lucene.all.AllTokenStream.incrementToken(AllTokenStream.java:59)  
> > at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:137)  
> > at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:246)  
> > at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:821)  
> > at org.apache.lucene.index.DocumentsWriter.addDocument(DocumentsWriter.java:797)  
> > at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1981)  
> > at org.elasticsearch.index.engine.robin.RobinEngine.create(RobinEngine.java:189)  
> > at org.elasticsearch.index.shard.service.InternalIndexShard.innerCreate(InternalIndexShard.java:213)  
> > at org.elasticsearch.index.shard.service.InternalIndexShard.create(InternalIndexShard.java:201)  
> > at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:135)  
> > at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:60)  
> > at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:381)  
> > ... 5 more
> > 
> > Thanks in advance,  
> > Sezgin Kucukkaraaslan

---

<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 6, 2017, 4:18am UTC](https://discuss.elastic.co/t/nullpointerexception-with-default-analyzer/3377/4 "2017-07-06T04:18:49Z")

</div>


