# Custom analyzer not applied on property in query

**URL:** <https://discuss.elastic.co/t/custom-analyzer-not-applied-on-property-in-query/7630>\
**Category:** Elasticsearch\
**Created:** [May 10, 2012, 10:03am UTC](https://discuss.elastic.co/t/custom-analyzer-not-applied-on-property-in-query/7630 "2012-05-10T10:03:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Filip](https://avatars.discourse-cdn.com/v4/letter/f/919ad9/32.png) [@Filip](https://discuss.elastic.co/u/Filip)\
**Post date:** [May 10, 2012, 10:03am UTC](https://discuss.elastic.co/t/custom-analyzer-not-applied-on-property-in-query/7630/1 "2012-05-10T10:03:55Z")

</div>

Hi,

I'm using a custom Lucene analyzer, made available through a plugin.  
In my index mapping file, I specified this analyzer using:

{  
"article" : {  
"\_all" : {  
"indexAnalyzer" : "foo\_analyzer",  
"searchAnalyzer" : "foo\_analyzer"  
}  
"properties" : {  
"title" : {  
"type" : "string",  
"index" : "analyzed"  
}  
"content" : {  
"type" : "string",  
"index" : "analyzed"  
}  
...  
}

It turns out that the analyzer is used properly when searching over  
the entire article, e.g.  
[http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)

But the analyzer is not used when I search on a specific property, it  
seems to use the default analyzer:  
[http://localhost:9200/development\_articles/\_search?q=someproperty:foo-bar](http://localhost:9200/development_articles/_search?q=someproperty:foo-bar)

The goal of this analyzer is to make sure words concatenated with a  
hyphen (foo-bar) are considered one word, and that the query doesn't  
match on one part of the word only (foo or bar separately)

Any idea?

---

<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:** [May 13, 2012, 9:44am UTC](https://discuss.elastic.co/t/custom-analyzer-not-applied-on-property-in-query/7630/2 "2012-05-13T09:44:36Z")

</div>

You only specified your analyzer on the \_all field, and not all the other  
fields (title, content). If you want it to apply to all (string) fields,  
you can simply name it "default".

On Thu, May 10, 2012 at 1:03 PM, Filip [filip.neven@gmail.com](mailto:filip.neven@gmail.com) wrote:

> Hi,
> 
> I'm using a custom Lucene analyzer, made available through a plugin.  
> In my index mapping file, I specified this analyzer using:
> 
> {  
> "article" : {  
> "\_all" : {  
> "indexAnalyzer" : "foo\_analyzer",  
> "searchAnalyzer" : "foo\_analyzer"  
> }  
> "properties" : {  
> "title" : {  
> "type" : "string",  
> "index" : "analyzed"  
> }  
> "content" : {  
> "type" : "string",  
> "index" : "analyzed"  
> }  
> ...  
> }
> 
> It turns out that the analyzer is used properly when searching over  
> the entire article, e.g.  
> [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> 
> But the analyzer is not used when I search on a specific property, it  
> seems to use the default analyzer:  
> [http://localhost:9200/development\_articles/\_search?q=someproperty:foo-bar](http://localhost:9200/development_articles/_search?q=someproperty:foo-bar)
> 
> The goal of this analyzer is to make sure words concatenated with a  
> hyphen (foo-bar) are considered one word, and that the query doesn't  
> match on one part of the word only (foo or bar separately)
> 
> Any idea?

---

<div class="post-metadata">

**Author:** ![Filip](https://avatars.discourse-cdn.com/v4/letter/f/919ad9/32.png) [@Filip](https://discuss.elastic.co/u/Filip)\
**Post date:** [May 14, 2012, 12:52pm UTC](https://discuss.elastic.co/t/custom-analyzer-not-applied-on-property-in-query/7630/3 "2012-05-14T12:52:14Z")

</div>

I tried specifying my analyzer on each field individually, but that  
didn't work (same effect as with \_all). I have also tried setting it  
as the default analyzer in elasticsearch.yml:

index.analysis.analyzer.default.type:  
my.elasticsearch.FooAnalyzerProvider

But then I get this NPE when recreating the index for each store:

java.lang.NullPointerException  
at  
org.elasticsearch.index.analysis.FieldNameAnalyzer.reusableTokenStream(FieldNameAnalyzer.java:  
60)  
at  
org.elasticsearch.common.lucene.all.AllTokenStream.allTokenStream(AllTokenStream.java:  
38)  
at  
org.elasticsearch.common.lucene.all.AllField.tokenStreamValue(AllField.java:  
64)  
at  
org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:  
111)  
at  
org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:  
276)  
at  
org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:  
766)  
at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:  
2060)  
at  
org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:  
567)  
at  
org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:  
479)  
at  
org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
323)  
at  
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
206)  
at  
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
532)  
at  
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
$AsyncShardOperationAction  
$1.run(TransportShardReplicationOperationAction.java:430)  
at java.util.concurrent.ThreadPoolExecutor  
$Worker.runTask(ThreadPoolExecutor.java:886)  
at java.util.concurrent.ThreadPoolExecutor  
$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:680)

On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> You only specified your analyzer on the \_all field, and not all the other  
> fields (title, content). If you want it to apply to all (string) fields,  
> you can simply name it "default".
> 
> On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> 
> > Hi,
> 
> > I'm using a custom Lucene analyzer, made available through a plugin.  
> > In my index mapping file, I specified this analyzer using:
> 
> > {  
> > "article" : {  
> > "\_all" : {  
> > "indexAnalyzer" : "foo\_analyzer",  
> > "searchAnalyzer" : "foo\_analyzer"  
> > }  
> > "properties" : {  
> > "title" : {  
> > "type" : "string",  
> > "index" : "analyzed"  
> > }  
> > "content" : {  
> > "type" : "string",  
> > "index" : "analyzed"  
> > }  
> > ...  
> > }
> 
> > It turns out that the analyzer is used properly when searching over  
> > the entire article, e.g.  
> > [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> 
> > But the analyzer is not used when I search on a specific property, it  
> > seems to use the default analyzer:  
> > [http://localhost:9200/development\_articles/\_search?q=someproperty:foo](http://localhost:9200/development_articles/_search?q=someproperty:foo)...
> 
> > The goal of this analyzer is to make sure words concatenated with a  
> > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > match on one part of the word only (foo or bar separately)
> 
> > Any idea?

---

<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:** [May 15, 2012, 8:41pm UTC](https://discuss.elastic.co/t/custom-analyzer-not-applied-on-property-in-query/7630/4 "2012-05-15T20:41:05Z")

</div>

That NPE is strange..., is there a chance for a recreation?

On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com) wrote:

> I tried specifying my analyzer on each field individually, but that  
> didn't work (same effect as with \_all). I have also tried setting it  
> as the default analyzer in elasticsearch.yml:
> 
> index.analysis.analyzer.default.type:  
> my.elasticsearch.FooAnalyzerProvider
> 
> But then I get this NPE when recreating the index for each store:
> 
> java.lang.NullPointerException  
> at
> 
> org.elasticsearch.index.analysis.FieldNameAnalyzer.reusableTokenStream(FieldNameAnalyzer.java:  
> 60)  
> at
> 
> org.elasticsearch.common.lucene.all.AllTokenStream.allTokenStream(AllTokenStream.java:  
> 38)  
> at
> 
> org.elasticsearch.common.lucene.all.AllField.tokenStreamValue(AllField.java:  
> 64)  
> at
> 
> org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:  
> 111)  
> at
> 
> org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:  
> 276)  
> at
> 
> org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:  
> 766)  
> at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:  
> 2060)  
> at
> 
> org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:  
> 567)  
> at  
> org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:  
> 479)  
> at
> 
> org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> 323)  
> at
> 
> org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> 206)  
> at
> 
> org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
> 
> $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> 532)  
> at
> 
> org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> $AsyncShardOperationAction  
> $1.run(TransportShardReplicationOperationAction.java:430)  
> at java.util.concurrent.ThreadPoolExecutor  
> $Worker.runTask(ThreadPoolExecutor.java:886)  
> at java.util.concurrent.ThreadPoolExecutor  
> $Worker.run(ThreadPoolExecutor.java:908)  
> at java.lang.Thread.run(Thread.java:680)
> 
> On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> 
> > You only specified your analyzer on the \_all field, and not all the other  
> > fields (title, content). If you want it to apply to all (string) fields,  
> > you can simply name it "default".
> > 
> > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > 
> > > Hi,
> > 
> > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > In my index mapping file, I specified this analyzer using:
> > 
> > > {  
> > > "article" : {  
> > > "\_all" : {  
> > > "indexAnalyzer" : "foo\_analyzer",  
> > > "searchAnalyzer" : "foo\_analyzer"  
> > > }  
> > > "properties" : {  
> > > "title" : {  
> > > "type" : "string",  
> > > "index" : "analyzed"  
> > > }  
> > > "content" : {  
> > > "type" : "string",  
> > > "index" : "analyzed"  
> > > }  
> > > ...  
> > > }
> > 
> > > It turns out that the analyzer is used properly when searching over  
> > > the entire article, e.g.  
> > > [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > 
> > > But the analyzer is not used when I search on a specific property, it  
> > > seems to use the default analyzer:  
> > > [http://localhost:9200/development\_articles/\_search?q=someproperty:foo](http://localhost:9200/development_articles/_search?q=someproperty:foo).  
> > > ..
> > 
> > > The goal of this analyzer is to make sure words concatenated with a  
> > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > match on one part of the word only (foo or bar separately)
> > 
> > > Any idea?

---

<div class="post-metadata">

**Author:** ![Filip](https://avatars.discourse-cdn.com/v4/letter/f/919ad9/32.png) [@Filip](https://discuss.elastic.co/u/Filip)\
**Post date:** [May 16, 2012, 10:28am UTC](https://discuss.elastic.co/t/custom-analyzer-not-applied-on-property-in-query/7630/5 "2012-05-16T10:28:11Z")

</div>

Yes, I tried recreating the index, first destroy the current one using:

curl -X DELETE [http://localhost:9200/\_all](http://localhost:9200/_all)

and then execute the program that indexes the articles, but I get the NPE  
for each index-attempt.

Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:

> That NPE is strange..., is there a chance for a recreation?
> 
> On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> 
> > I tried specifying my analyzer on each field individually, but that  
> > didn't work (same effect as with \_all). I have also tried setting it  
> > as the default analyzer in elasticsearch.yml:
> > 
> > index.analysis.analyzer.default.type:  
> > my.elasticsearch.FooAnalyzerProvider
> > 
> > But then I get this NPE when recreating the index for each store:
> > 
> > java.lang.NullPointerException  
> > at
> > 
> > org.elasticsearch.index.analysis.FieldNameAnalyzer.reusableTokenStream(FieldNameAnalyzer.java:  
> > 60)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllTokenStream.allTokenStream(AllTokenStream.java:  
> > 38)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllField.tokenStreamValue(AllField.java:  
> > 64)  
> > at
> > 
> > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:  
> > 111)  
> > at
> > 
> > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:  
> > 276)  
> > at
> > 
> > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:  
> > 766)  
> > at  
> > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:  
> > 2060)  
> > at
> > 
> > org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:  
> > 567)  
> > at  
> > org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:  
> > 479)  
> > at
> > 
> > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > 323)  
> > at
> > 
> > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > 206)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
> > 
> > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > 532)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction  
> > $1.run(TransportShardReplicationOperationAction.java:430)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:886)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:680)
> > 
> > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > 
> > > You only specified your analyzer on the \_all field, and not all the  
> > > other  
> > > fields (title, content). If you want it to apply to all (string) fields,  
> > > you can simply name it "default".
> > > 
> > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > 
> > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > In my index mapping file, I specified this analyzer using:
> > > 
> > > > {  
> > > > "article" : {  
> > > > "\_all" : {  
> > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > }  
> > > > "properties" : {  
> > > > "title" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > "content" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > ...  
> > > > }
> > > 
> > > > It turns out that the analyzer is used properly when searching over  
> > > > the entire article, e.g.  
> > > > [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > 
> > > > But the analyzer is not used when I search on a specific property, it  
> > > > seems to use the default analyzer:  
> > > > [http://localhost:9200/development\_articles/\_search?q=someproperty:foo](http://localhost:9200/development_articles/_search?q=someproperty:foo).  
> > > > ..
> > > 
> > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > match on one part of the word only (foo or bar separately)
> > > 
> > > > Any idea?

Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:

> That NPE is strange..., is there a chance for a recreation?
> 
> On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> 
> > I tried specifying my analyzer on each field individually, but that  
> > didn't work (same effect as with \_all). I have also tried setting it  
> > as the default analyzer in elasticsearch.yml:
> > 
> > index.analysis.analyzer.default.type:  
> > my.elasticsearch.FooAnalyzerProvider
> > 
> > But then I get this NPE when recreating the index for each store:
> > 
> > java.lang.NullPointerException  
> > at
> > 
> > org.elasticsearch.index.analysis.FieldNameAnalyzer.reusableTokenStream(FieldNameAnalyzer.java:  
> > 60)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllTokenStream.allTokenStream(AllTokenStream.java:  
> > 38)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllField.tokenStreamValue(AllField.java:  
> > 64)  
> > at
> > 
> > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:  
> > 111)  
> > at
> > 
> > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:  
> > 276)  
> > at
> > 
> > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:  
> > 766)  
> > at  
> > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:  
> > 2060)  
> > at
> > 
> > org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:  
> > 567)  
> > at  
> > org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:  
> > 479)  
> > at
> > 
> > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > 323)  
> > at
> > 
> > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > 206)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
> > 
> > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > 532)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction  
> > $1.run(TransportShardReplicationOperationAction.java:430)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:886)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:680)
> > 
> > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > 
> > > You only specified your analyzer on the \_all field, and not all the  
> > > other  
> > > fields (title, content). If you want it to apply to all (string) fields,  
> > > you can simply name it "default".
> > > 
> > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > 
> > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > In my index mapping file, I specified this analyzer using:
> > > 
> > > > {  
> > > > "article" : {  
> > > > "\_all" : {  
> > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > }  
> > > > "properties" : {  
> > > > "title" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > "content" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > ...  
> > > > }
> > > 
> > > > It turns out that the analyzer is used properly when searching over  
> > > > the entire article, e.g.  
> > > > [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > 
> > > > But the analyzer is not used when I search on a specific property, it  
> > > > seems to use the default analyzer:  
> > > > [http://localhost:9200/development\_articles/\_search?q=someproperty:foo](http://localhost:9200/development_articles/_search?q=someproperty:foo).  
> > > > ..
> > > 
> > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > match on one part of the word only (foo or bar separately)
> > > 
> > > > Any idea?

Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:

> That NPE is strange..., is there a chance for a recreation?
> 
> On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> 
> > I tried specifying my analyzer on each field individually, but that  
> > didn't work (same effect as with \_all). I have also tried setting it  
> > as the default analyzer in elasticsearch.yml:
> > 
> > index.analysis.analyzer.default.type:  
> > my.elasticsearch.FooAnalyzerProvider
> > 
> > But then I get this NPE when recreating the index for each store:
> > 
> > java.lang.NullPointerException  
> > at
> > 
> > org.elasticsearch.index.analysis.FieldNameAnalyzer.reusableTokenStream(FieldNameAnalyzer.java:  
> > 60)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllTokenStream.allTokenStream(AllTokenStream.java:  
> > 38)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllField.tokenStreamValue(AllField.java:  
> > 64)  
> > at
> > 
> > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:  
> > 111)  
> > at
> > 
> > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:  
> > 276)  
> > at
> > 
> > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:  
> > 766)  
> > at  
> > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:  
> > 2060)  
> > at
> > 
> > org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:  
> > 567)  
> > at  
> > org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:  
> > 479)  
> > at
> > 
> > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > 323)  
> > at
> > 
> > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > 206)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
> > 
> > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > 532)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction  
> > $1.run(TransportShardReplicationOperationAction.java:430)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:886)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:680)
> > 
> > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > 
> > > You only specified your analyzer on the \_all field, and not all the  
> > > other  
> > > fields (title, content). If you want it to apply to all (string) fields,  
> > > you can simply name it "default".
> > > 
> > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > 
> > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > In my index mapping file, I specified this analyzer using:
> > > 
> > > > {  
> > > > "article" : {  
> > > > "\_all" : {  
> > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > }  
> > > > "properties" : {  
> > > > "title" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > "content" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > ...  
> > > > }
> > > 
> > > > It turns out that the analyzer is used properly when searching over  
> > > > the entire article, e.g.  
> > > > [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > 
> > > > But the analyzer is not used when I search on a specific property, it  
> > > > seems to use the default analyzer:  
> > > > [http://localhost:9200/development\_articles/\_search?q=someproperty:foo](http://localhost:9200/development_articles/_search?q=someproperty:foo).  
> > > > ..
> > > 
> > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > match on one part of the word only (foo or bar separately)
> > > 
> > > > Any idea?

Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:

> That NPE is strange..., is there a chance for a recreation?
> 
> On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> 
> > I tried specifying my analyzer on each field individually, but that  
> > didn't work (same effect as with \_all). I have also tried setting it  
> > as the default analyzer in elasticsearch.yml:
> > 
> > index.analysis.analyzer.default.type:  
> > my.elasticsearch.FooAnalyzerProvider
> > 
> > But then I get this NPE when recreating the index for each store:
> > 
> > java.lang.NullPointerException  
> > at
> > 
> > org.elasticsearch.index.analysis.FieldNameAnalyzer.reusableTokenStream(FieldNameAnalyzer.java:  
> > 60)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllTokenStream.allTokenStream(AllTokenStream.java:  
> > 38)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllField.tokenStreamValue(AllField.java:  
> > 64)  
> > at
> > 
> > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:  
> > 111)  
> > at
> > 
> > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:  
> > 276)  
> > at
> > 
> > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:  
> > 766)  
> > at  
> > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:  
> > 2060)  
> > at
> > 
> > org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:  
> > 567)  
> > at  
> > org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:  
> > 479)  
> > at
> > 
> > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > 323)  
> > at
> > 
> > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > 206)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
> > 
> > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > 532)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction  
> > $1.run(TransportShardReplicationOperationAction.java:430)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:886)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:680)
> > 
> > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > 
> > > You only specified your analyzer on the \_all field, and not all the  
> > > other  
> > > fields (title, content). If you want it to apply to all (string) fields,  
> > > you can simply name it "default".
> > > 
> > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > 
> > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > In my index mapping file, I specified this analyzer using:
> > > 
> > > > {  
> > > > "article" : {  
> > > > "\_all" : {  
> > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > }  
> > > > "properties" : {  
> > > > "title" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > "content" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > ...  
> > > > }
> > > 
> > > > It turns out that the analyzer is used properly when searching over  
> > > > the entire article, e.g.  
> > > > [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > 
> > > > But the analyzer is not used when I search on a specific property, it  
> > > > seems to use the default analyzer:  
> > > > [http://localhost:9200/development\_articles/\_search?q=someproperty:foo](http://localhost:9200/development_articles/_search?q=someproperty:foo).  
> > > > ..
> > > 
> > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > match on one part of the word only (foo or bar separately)
> > > 
> > > > Any idea?

Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:

> That NPE is strange..., is there a chance for a recreation?
> 
> On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> 
> > I tried specifying my analyzer on each field individually, but that  
> > didn't work (same effect as with \_all). I have also tried setting it  
> > as the default analyzer in elasticsearch.yml:
> > 
> > index.analysis.analyzer.default.type:  
> > my.elasticsearch.FooAnalyzerProvider
> > 
> > But then I get this NPE when recreating the index for each store:
> > 
> > java.lang.NullPointerException  
> > at
> > 
> > org.elasticsearch.index.analysis.FieldNameAnalyzer.reusableTokenStream(FieldNameAnalyzer.java:  
> > 60)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllTokenStream.allTokenStream(AllTokenStream.java:  
> > 38)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllField.tokenStreamValue(AllField.java:  
> > 64)  
> > at
> > 
> > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:  
> > 111)  
> > at
> > 
> > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:  
> > 276)  
> > at
> > 
> > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:  
> > 766)  
> > at  
> > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:  
> > 2060)  
> > at
> > 
> > org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:  
> > 567)  
> > at  
> > org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:  
> > 479)  
> > at
> > 
> > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > 323)  
> > at
> > 
> > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > 206)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
> > 
> > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > 532)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction  
> > $1.run(TransportShardReplicationOperationAction.java:430)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:886)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:680)
> > 
> > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > 
> > > You only specified your analyzer on the \_all field, and not all the  
> > > other  
> > > fields (title, content). If you want it to apply to all (string) fields,  
> > > you can simply name it "default".
> > > 
> > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > 
> > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > In my index mapping file, I specified this analyzer using:
> > > 
> > > > {  
> > > > "article" : {  
> > > > "\_all" : {  
> > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > }  
> > > > "properties" : {  
> > > > "title" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > "content" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > ...  
> > > > }
> > > 
> > > > It turns out that the analyzer is used properly when searching over  
> > > > the entire article, e.g.  
> > > > [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > 
> > > > But the analyzer is not used when I search on a specific property, it  
> > > > seems to use the default analyzer:  
> > > > [http://localhost:9200/development\_articles/\_search?q=someproperty:foo](http://localhost:9200/development_articles/_search?q=someproperty:foo).  
> > > > ..
> > > 
> > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > match on one part of the word only (foo or bar separately)
> > > 
> > > > Any idea?

Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:

> That NPE is strange..., is there a chance for a recreation?
> 
> On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> 
> > I tried specifying my analyzer on each field individually, but that  
> > didn't work (same effect as with \_all). I have also tried setting it  
> > as the default analyzer in elasticsearch.yml:
> > 
> > index.analysis.analyzer.default.type:  
> > my.elasticsearch.FooAnalyzerProvider
> > 
> > But then I get this NPE when recreating the index for each store:
> > 
> > java.lang.NullPointerException  
> > at
> > 
> > org.elasticsearch.index.analysis.FieldNameAnalyzer.reusableTokenStream(FieldNameAnalyzer.java:  
> > 60)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllTokenStream.allTokenStream(AllTokenStream.java:  
> > 38)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllField.tokenStreamValue(AllField.java:  
> > 64)  
> > at
> > 
> > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:  
> > 111)  
> > at
> > 
> > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:  
> > 276)  
> > at
> > 
> > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:  
> > 766)  
> > at  
> > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:  
> > 2060)  
> > at
> > 
> > org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:  
> > 567)  
> > at  
> > org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:  
> > 479)  
> > at
> > 
> > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > 323)  
> > at
> > 
> > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > 206)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
> > 
> > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > 532)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction  
> > $1.run(TransportShardReplicationOperationAction.java:430)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:886)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:680)
> > 
> > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > 
> > > You only specified your analyzer on the \_all field, and not all the  
> > > other  
> > > fields (title, content). If you want it to apply to all (string) fields,  
> > > you can simply name it "default".
> > > 
> > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > 
> > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > In my index mapping file, I specified this analyzer using:
> > > 
> > > > {  
> > > > "article" : {  
> > > > "\_all" : {  
> > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > }  
> > > > "properties" : {  
> > > > "title" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > "content" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > ...  
> > > > }
> > > 
> > > > It turns out that the analyzer is used properly when searching over  
> > > > the entire article, e.g.  
> > > > [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > 
> > > > But the analyzer is not used when I search on a specific property, it  
> > > > seems to use the default analyzer:  
> > > > [http://localhost:9200/development\_articles/\_search?q=someproperty:foo](http://localhost:9200/development_articles/_search?q=someproperty:foo).  
> > > > ..
> > > 
> > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > match on one part of the word only (foo or bar separately)
> > > 
> > > > Any idea?

Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:

> That NPE is strange..., is there a chance for a recreation?
> 
> On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> 
> > I tried specifying my analyzer on each field individually, but that  
> > didn't work (same effect as with \_all). I have also tried setting it  
> > as the default analyzer in elasticsearch.yml:
> > 
> > index.analysis.analyzer.default.type:  
> > my.elasticsearch.FooAnalyzerProvider
> > 
> > But then I get this NPE when recreating the index for each store:
> > 
> > java.lang.NullPointerException  
> > at
> > 
> > org.elasticsearch.index.analysis.FieldNameAnalyzer.reusableTokenStream(FieldNameAnalyzer.java:  
> > 60)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllTokenStream.allTokenStream(AllTokenStream.java:  
> > 38)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllField.tokenStreamValue(AllField.java:  
> > 64)  
> > at
> > 
> > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:  
> > 111)  
> > at
> > 
> > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:  
> > 276)  
> > at
> > 
> > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:  
> > 766)  
> > at  
> > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:  
> > 2060)  
> > at
> > 
> > org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:  
> > 567)  
> > at  
> > org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:  
> > 479)  
> > at
> > 
> > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > 323)  
> > at
> > 
> > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > 206)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
> > 
> > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > 532)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction  
> > $1.run(TransportShardReplicationOperationAction.java:430)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:886)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:680)
> > 
> > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > 
> > > You only specified your analyzer on the \_all field, and not all the  
> > > other  
> > > fields (title, content). If you want it to apply to all (string) fields,  
> > > you can simply name it "default".
> > > 
> > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > 
> > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > In my index mapping file, I specified this analyzer using:
> > > 
> > > > {  
> > > > "article" : {  
> > > > "\_all" : {  
> > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > }  
> > > > "properties" : {  
> > > > "title" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > "content" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > ...  
> > > > }
> > > 
> > > > It turns out that the analyzer is used properly when searching over  
> > > > the entire article, e.g.  
> > > > [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > 
> > > > But the analyzer is not used when I search on a specific property, it  
> > > > seems to use the default analyzer:  
> > > > [http://localhost:9200/development\_articles/\_search?q=someproperty:foo](http://localhost:9200/development_articles/_search?q=someproperty:foo).  
> > > > ..
> > > 
> > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > match on one part of the word only (foo or bar separately)
> > > 
> > > > Any idea?

Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:

> That NPE is strange..., is there a chance for a recreation?
> 
> On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> 
> > I tried specifying my analyzer on each field individually, but that  
> > didn't work (same effect as with \_all). I have also tried setting it  
> > as the default analyzer in elasticsearch.yml:
> > 
> > index.analysis.analyzer.default.type:  
> > my.elasticsearch.FooAnalyzerProvider
> > 
> > But then I get this NPE when recreating the index for each store:
> > 
> > java.lang.NullPointerException  
> > at
> > 
> > org.elasticsearch.index.analysis.FieldNameAnalyzer.reusableTokenStream(FieldNameAnalyzer.java:  
> > 60)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllTokenStream.allTokenStream(AllTokenStream.java:  
> > 38)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllField.tokenStreamValue(AllField.java:  
> > 64)  
> > at
> > 
> > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:  
> > 111)  
> > at
> > 
> > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:  
> > 276)  
> > at
> > 
> > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:  
> > 766)  
> > at  
> > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:  
> > 2060)  
> > at
> > 
> > org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:  
> > 567)  
> > at  
> > org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:  
> > 479)  
> > at
> > 
> > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > 323)  
> > at
> > 
> > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > 206)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
> > 
> > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > 532)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction  
> > $1.run(TransportShardReplicationOperationAction.java:430)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:886)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:680)
> > 
> > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > 
> > > You only specified your analyzer on the \_all field, and not all the  
> > > other  
> > > fields (title, content). If you want it to apply to all (string) fields,  
> > > you can simply name it "default".
> > > 
> > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > 
> > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > In my index mapping file, I specified this analyzer using:
> > > 
> > > > {  
> > > > "article" : {  
> > > > "\_all" : {  
> > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > }  
> > > > "properties" : {  
> > > > "title" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > "content" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > ...  
> > > > }
> > > 
> > > > It turns out that the analyzer is used properly when searching over  
> > > > the entire article, e.g.  
> > > > [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > 
> > > > But the analyzer is not used when I search on a specific property, it  
> > > > seems to use the default analyzer:  
> > > > [http://localhost:9200/development\_articles/\_search?q=someproperty:foo](http://localhost:9200/development_articles/_search?q=someproperty:foo).  
> > > > ..
> > > 
> > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > match on one part of the word only (foo or bar separately)
> > > 
> > > > Any idea?

Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:

> That NPE is strange..., is there a chance for a recreation?
> 
> On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> 
> > I tried specifying my analyzer on each field individually, but that  
> > didn't work (same effect as with \_all). I have also tried setting it  
> > as the default analyzer in elasticsearch.yml:
> > 
> > index.analysis.analyzer.default.type:  
> > my.elasticsearch.FooAnalyzerProvider
> > 
> > But then I get this NPE when recreating the index for each store:
> > 
> > java.lang.NullPointerException  
> > at
> > 
> > org.elasticsearch.index.analysis.FieldNameAnalyzer.reusableTokenStream(FieldNameAnalyzer.java:  
> > 60)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllTokenStream.allTokenStream(AllTokenStream.java:  
> > 38)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllField.tokenStreamValue(AllField.java:  
> > 64)  
> > at
> > 
> > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:  
> > 111)  
> > at
> > 
> > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:  
> > 276)  
> > at
> > 
> > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:  
> > 766)  
> > at  
> > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:  
> > 2060)  
> > at
> > 
> > org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:  
> > 567)  
> > at  
> > org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:  
> > 479)  
> > at
> > 
> > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > 323)  
> > at
> > 
> > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > 206)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
> > 
> > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > 532)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction  
> > $1.run(TransportShardReplicationOperationAction.java:430)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:886)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:680)
> > 
> > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > 
> > > You only specified your analyzer on the \_all field, and not all the  
> > > other  
> > > fields (title, content). If you want it to apply to all (string) fields,  
> > > you can simply name it "default".
> > > 
> > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > 
> > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > In my index mapping file, I specified this analyzer using:
> > > 
> > > > {  
> > > > "article" : {  
> > > > "\_all" : {  
> > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > }  
> > > > "properties" : {  
> > > > "title" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > "content" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > ...  
> > > > }
> > > 
> > > > It turns out that the analyzer is used properly when searching over  
> > > > the entire article, e.g.  
> > > > [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > 
> > > > But the analyzer is not used when I search on a specific property, it  
> > > > seems to use the default analyzer:  
> > > > [http://localhost:9200/development\_articles/\_search?q=someproperty:foo](http://localhost:9200/development_articles/_search?q=someproperty:foo).  
> > > > ..
> > > 
> > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > match on one part of the word only (foo or bar separately)
> > > 
> > > > Any idea?

Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:

> That NPE is strange..., is there a chance for a recreation?
> 
> On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> 
> > I tried specifying my analyzer on each field individually, but that  
> > didn't work (same effect as with \_all). I have also tried setting it  
> > as the default analyzer in elasticsearch.yml:
> > 
> > index.analysis.analyzer.default.type:  
> > my.elasticsearch.FooAnalyzerProvider
> > 
> > But then I get this NPE when recreating the index for each store:
> > 
> > java.lang.NullPointerException  
> > at
> > 
> > org.elasticsearch.index.analysis.FieldNameAnalyzer.reusableTokenStream(FieldNameAnalyzer.java:  
> > 60)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllTokenStream.allTokenStream(AllTokenStream.java:  
> > 38)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllField.tokenStreamValue(AllField.java:  
> > 64)  
> > at
> > 
> > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:  
> > 111)  
> > at
> > 
> > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:  
> > 276)  
> > at
> > 
> > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:  
> > 766)  
> > at  
> > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:  
> > 2060)  
> > at
> > 
> > org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:  
> > 567)  
> > at  
> > org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:  
> > 479)  
> > at
> > 
> > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > 323)  
> > at
> > 
> > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > 206)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
> > 
> > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > 532)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction  
> > $1.run(TransportShardReplicationOperationAction.java:430)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:886)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:680)
> > 
> > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > 
> > > You only specified your analyzer on the \_all field, and not all the  
> > > other  
> > > fields (title, content). If you want it to apply to all (string) fields,  
> > > you can simply name it "default".
> > > 
> > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > 
> > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > In my index mapping file, I specified this analyzer using:
> > > 
> > > > {  
> > > > "article" : {  
> > > > "\_all" : {  
> > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > }  
> > > > "properties" : {  
> > > > "title" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > "content" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > ...  
> > > > }
> > > 
> > > > It turns out that the analyzer is used properly when searching over  
> > > > the entire article, e.g.  
> > > > [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > 
> > > > But the analyzer is not used when I search on a specific property, it  
> > > > seems to use the default analyzer:  
> > > > [http://localhost:9200/development\_articles/\_search?q=someproperty:foo](http://localhost:9200/development_articles/_search?q=someproperty:foo).  
> > > > ..
> > > 
> > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > match on one part of the word only (foo or bar separately)
> > > 
> > > > Any idea?

Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:

> That NPE is strange..., is there a chance for a recreation?
> 
> On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> 
> > I tried specifying my analyzer on each field individually, but that  
> > didn't work (same effect as with \_all). I have also tried setting it  
> > as the default analyzer in elasticsearch.yml:
> > 
> > index.analysis.analyzer.default.type:  
> > my.elasticsearch.FooAnalyzerProvider
> > 
> > But then I get this NPE when recreating the index for each store:
> > 
> > java.lang.NullPointerException  
> > at
> > 
> > org.elasticsearch.index.analysis.FieldNameAnalyzer.reusableTokenStream(FieldNameAnalyzer.java:  
> > 60)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllTokenStream.allTokenStream(AllTokenStream.java:  
> > 38)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllField.tokenStreamValue(AllField.java:  
> > 64)  
> > at
> > 
> > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:  
> > 111)  
> > at
> > 
> > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:  
> > 276)  
> > at
> > 
> > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:  
> > 766)  
> > at  
> > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:  
> > 2060)  
> > at
> > 
> > org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:  
> > 567)  
> > at  
> > org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:  
> > 479)  
> > at
> > 
> > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > 323)  
> > at
> > 
> > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > 206)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
> > 
> > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > 532)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction  
> > $1.run(TransportShardReplicationOperationAction.java:430)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:886)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:680)
> > 
> > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > 
> > > You only specified your analyzer on the \_all field, and not all the  
> > > other  
> > > fields (title, content). If you want it to apply to all (string) fields,  
> > > you can simply name it "default".
> > > 
> > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > 
> > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > In my index mapping file, I specified this analyzer using:
> > > 
> > > > {  
> > > > "article" : {  
> > > > "\_all" : {  
> > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > }  
> > > > "properties" : {  
> > > > "title" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > "content" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > ...  
> > > > }
> > > 
> > > > It turns out that the analyzer is used properly when searching over  
> > > > the entire article, e.g.  
> > > > [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > 
> > > > But the analyzer is not used when I search on a specific property, it  
> > > > seems to use the default analyzer:  
> > > > [http://localhost:9200/development\_articles/\_search?q=someproperty:foo](http://localhost:9200/development_articles/_search?q=someproperty:foo).  
> > > > ..
> > > 
> > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > match on one part of the word only (foo or bar separately)
> > > 
> > > > Any idea?

Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:

> That NPE is strange..., is there a chance for a recreation?
> 
> On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> 
> > I tried specifying my analyzer on each field individually, but that  
> > didn't work (same effect as with \_all). I have also tried setting it  
> > as the default analyzer in elasticsearch.yml:
> > 
> > index.analysis.analyzer.default.type:  
> > my.elasticsearch.FooAnalyzerProvider
> > 
> > But then I get this NPE when recreating the index for each store:
> > 
> > java.lang.NullPointerException  
> > at
> > 
> > org.elasticsearch.index.analysis.FieldNameAnalyzer.reusableTokenStream(FieldNameAnalyzer.java:  
> > 60)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllTokenStream.allTokenStream(AllTokenStream.java:  
> > 38)  
> > at
> > 
> > org.elasticsearch.common.lucene.all.AllField.tokenStreamValue(AllField.java:  
> > 64)  
> > at
> > 
> > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:  
> > 111)  
> > at
> > 
> > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:  
> > 276)  
> > at
> > 
> > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:  
> > 766)  
> > at  
> > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:  
> > 2060)  
> > at
> > 
> > org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:  
> > 567)  
> > at  
> > org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:  
> > 479)  
> > at
> > 
> > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > 323)  
> > at
> > 
> > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > 206)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
> > 
> > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > 532)  
> > at
> > 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction  
> > $1.run(TransportShardReplicationOperationAction.java:430)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:886)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:908)  
> > at java.lang.Thread.run(Thread.java:680)
> > 
> > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > 
> > > You only specified your analyzer on the \_all field, and not all the  
> > > other  
> > > fields (title, content). If you want it to apply to all (string) fields,  
> > > you can simply name it "default".
> > > 
> > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > 
> > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > In my index mapping file, I specified this analyzer using:
> > > 
> > > > {  
> > > > "article" : {  
> > > > "\_all" : {  
> > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > }  
> > > > "properties" : {  
> > > > "title" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > "content" : {  
> > > > "type" : "string",  
> > > > "index" : "analyzed"  
> > > > }  
> > > > ...  
> > > > }
> > > 
> > > > It turns out that the analyzer is used properly when searching over  
> > > > the entire article, e.g.  
> > > > [http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > 
> > > > But the analyzer is not used when I search on a specific property, it  
> > > > seems to use the default analyzer:  
> > > > [http://localhost:9200/development\_articles/\_search?q=someproperty:foo](http://localhost:9200/development_articles/_search?q=someproperty:foo).  
> > > > ..
> > > 
> > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > match on one part of the word only (foo or bar separately)
> > > 
> > > > Any idea?

---

<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:** [May 16, 2012, 10:17pm UTC](https://discuss.elastic.co/t/custom-analyzer-not-applied-on-property-in-query/7630/6 "2012-05-16T22:17:17Z")

</div>

A recreation means something that I can run on my end to try and recreate  
it and see why it happens...

On Wed, May 16, 2012 at 1:28 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com) wrote:

> Yes, I tried recreating the index, first destroy the current one using:
> 
> curl -X DELETE [http://localhost:9200/\_all](http://localhost:9200/_all)
> 
> and then execute the program that indexes the articles, but I get the NPE  
> for each index-attempt.
> 
> Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:
> 
> > That NPE is strange..., is there a chance for a recreation?
> > 
> > On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> > 
> > > I tried specifying my analyzer on each field individually, but that  
> > > didn't work (same effect as with \_all). I have also tried setting it  
> > > as the default analyzer in elasticsearch.yml:
> > > 
> > > index.analysis.analyzer.\*\*default.type:  
> > > my.elasticsearch.\*\*FooAnalyzerProvider
> > > 
> > > But then I get this NPE when recreating the index for each store:
> > > 
> > > java.lang.NullPointerException  
> > > at  
> > > org.elasticsearch.index. **analysis.FieldNameAnalyzer.**  
> > > reusableTokenStream(\*\*FieldNameAnalyzer.java:  
> > > 60)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllTokenStream.**  
> > > allTokenStream(AllTokenStream.\*\*java:  
> > > 38)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllField.**  
> > > tokenStreamValue(AllField.\*\*java:  
> > > 64)  
> > > at  
> > > org.apache.lucene.index.\*\*DocInverterPerField.**processFields(**  
> > > DocInverterPerField.java:  
> > > 111)  
> > > at  
> > > org.apache.lucene.index.\*\*DocFieldProcessorPerThread.\*_processDocument(_  
> > > \*DocFieldProcessorPerThread.**java:  
> > > 276)  
> > > at  
> > > org.apache.lucene.index.DocumentsWriter.updateDocument(  
> > > DocumentsWriter.java:  
> > > 766)  
> > > at org.apache.lucene.index.IndexWriter.addDocument(  
> > > IndexWriter.java:  
> > > 2060)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > innerIndex(RobinEngine.java:  
> > > 567)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > index(RobinEngine.java:  
> > > 479)  
> > > at  
> > > org.elasticsearch.index.shard.service.InternalIndexShard.  
> > > index(InternalIndexShard.java:  
> > > 323)  
> > > at  
> > > org.elasticsearch.action.index.TransportIndexAction.  
> > > shardOperationOnPrimary(TransportIndexAction.java:  
> > > 206)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction.performOnPrimary(  
> > > TransportShardReplicationOperationAction.java:  
> > > 532)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOpera**tionAction  
> > > $AsyncShardOperationAction  
> > > $1.run( **TransportShardReplicationOpera** tionAction.java:430)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.runTask(\*\*ThreadPoolExecutor.java:886)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.run(\*\*ThreadPoolExecutor.java:908)  
> > > at java.lang.Thread.run(Thread.\*\*java:680)
> > > 
> > > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > > 
> > > > You only specified your analyzer on the \_all field, and not all the  
> > > > other  
> > > > fields (title, content). If you want it to apply to all (string)  
> > > > fields,  
> > > > you can simply name it "default".
> > > > 
> > > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > > 
> > > > > Hi,
> > > > 
> > > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > > In my index mapping file, I specified this analyzer using:
> > > > 
> > > > > {  
> > > > > "article" : {  
> > > > > "\_all" : {  
> > > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > > }  
> > > > > "properties" : {  
> > > > > "title" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > "content" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > ...  
> > > > > }
> > > > 
> > > > > It turns out that the analyzer is used properly when searching over  
> > > > > the entire article, e.g.  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?\*\*q=foo-bar](http://localhost:9200/ **development_articles/_search?** q=foo-bar)[http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > > 
> > > > > But the analyzer is not used when I search on a specific property, it  
> > > > > seems to use the default analyzer:  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?](http://localhost:9200/**development_articles/_search?)\*\*  
> > > > > q=someproperty:foo.[http://localhost:9200/development\_articles/\_search?q=someproperty:foo.](http://localhost:9200/development_articles/_search?q=someproperty:foo.)  
> > > > > ..
> > > > 
> > > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > > match on one part of the word only (foo or bar separately)
> > > > 
> > > > > Any idea?
> 
> Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:
> 
> > That NPE is strange..., is there a chance for a recreation?
> > 
> > On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> > 
> > > I tried specifying my analyzer on each field individually, but that  
> > > didn't work (same effect as with \_all). I have also tried setting it  
> > > as the default analyzer in elasticsearch.yml:
> > > 
> > > index.analysis.analyzer.\*\*default.type:  
> > > my.elasticsearch.\*\*FooAnalyzerProvider
> > > 
> > > But then I get this NPE when recreating the index for each store:
> > > 
> > > java.lang.NullPointerException  
> > > at  
> > > org.elasticsearch.index. **analysis.FieldNameAnalyzer.**  
> > > reusableTokenStream(\*\*FieldNameAnalyzer.java:  
> > > 60)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllTokenStream.**  
> > > allTokenStream(AllTokenStream.\*\*java:  
> > > 38)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllField.**  
> > > tokenStreamValue(AllField.\*\*java:  
> > > 64)  
> > > at  
> > > org.apache.lucene.index.\*\*DocInverterPerField.**processFields(**  
> > > DocInverterPerField.java:  
> > > 111)  
> > > at  
> > > org.apache.lucene.index.\*\*DocFieldProcessorPerThread.\*_processDocument(_  
> > > \*DocFieldProcessorPerThread.**java:  
> > > 276)  
> > > at  
> > > org.apache.lucene.index.DocumentsWriter.updateDocument(  
> > > DocumentsWriter.java:  
> > > 766)  
> > > at org.apache.lucene.index.IndexWriter.addDocument(  
> > > IndexWriter.java:  
> > > 2060)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > innerIndex(RobinEngine.java:  
> > > 567)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > index(RobinEngine.java:  
> > > 479)  
> > > at  
> > > org.elasticsearch.index.shard.service.InternalIndexShard.  
> > > index(InternalIndexShard.java:  
> > > 323)  
> > > at  
> > > org.elasticsearch.action.index.TransportIndexAction.  
> > > shardOperationOnPrimary(TransportIndexAction.java:  
> > > 206)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction.performOnPrimary(  
> > > TransportShardReplicationOperationAction.java:  
> > > 532)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOpera**tionAction  
> > > $AsyncShardOperationAction  
> > > $1.run( **TransportShardReplicationOpera** tionAction.java:430)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.runTask(\*\*ThreadPoolExecutor.java:886)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.run(\*\*ThreadPoolExecutor.java:908)  
> > > at java.lang.Thread.run(Thread.\*\*java:680)
> > > 
> > > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > > 
> > > > You only specified your analyzer on the \_all field, and not all the  
> > > > other  
> > > > fields (title, content). If you want it to apply to all (string)  
> > > > fields,  
> > > > you can simply name it "default".
> > > > 
> > > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > > 
> > > > > Hi,
> > > > 
> > > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > > In my index mapping file, I specified this analyzer using:
> > > > 
> > > > > {  
> > > > > "article" : {  
> > > > > "\_all" : {  
> > > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > > }  
> > > > > "properties" : {  
> > > > > "title" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > "content" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > ...  
> > > > > }
> > > > 
> > > > > It turns out that the analyzer is used properly when searching over  
> > > > > the entire article, e.g.  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?\*\*q=foo-bar](http://localhost:9200/ **development_articles/_search?** q=foo-bar)[http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > > 
> > > > > But the analyzer is not used when I search on a specific property, it  
> > > > > seems to use the default analyzer:  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?](http://localhost:9200/**development_articles/_search?)\*\*  
> > > > > q=someproperty:foo.[http://localhost:9200/development\_articles/\_search?q=someproperty:foo.](http://localhost:9200/development_articles/_search?q=someproperty:foo.)  
> > > > > ..
> > > > 
> > > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > > match on one part of the word only (foo or bar separately)
> > > > 
> > > > > Any idea?
> 
> Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:
> 
> > That NPE is strange..., is there a chance for a recreation?
> > 
> > On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> > 
> > > I tried specifying my analyzer on each field individually, but that  
> > > didn't work (same effect as with \_all). I have also tried setting it  
> > > as the default analyzer in elasticsearch.yml:
> > > 
> > > index.analysis.analyzer.\*\*default.type:  
> > > my.elasticsearch.\*\*FooAnalyzerProvider
> > > 
> > > But then I get this NPE when recreating the index for each store:
> > > 
> > > java.lang.NullPointerException  
> > > at  
> > > org.elasticsearch.index. **analysis.FieldNameAnalyzer.**  
> > > reusableTokenStream(\*\*FieldNameAnalyzer.java:  
> > > 60)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllTokenStream.**  
> > > allTokenStream(AllTokenStream.\*\*java:  
> > > 38)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllField.**  
> > > tokenStreamValue(AllField.\*\*java:  
> > > 64)  
> > > at  
> > > org.apache.lucene.index.\*\*DocInverterPerField.**processFields(**  
> > > DocInverterPerField.java:  
> > > 111)  
> > > at  
> > > org.apache.lucene.index.\*\*DocFieldProcessorPerThread.\*_processDocument(_  
> > > \*DocFieldProcessorPerThread.**java:  
> > > 276)  
> > > at  
> > > org.apache.lucene.index.DocumentsWriter.updateDocument(  
> > > DocumentsWriter.java:  
> > > 766)  
> > > at org.apache.lucene.index.IndexWriter.addDocument(  
> > > IndexWriter.java:  
> > > 2060)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > innerIndex(RobinEngine.java:  
> > > 567)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > index(RobinEngine.java:  
> > > 479)  
> > > at  
> > > org.elasticsearch.index.shard.service.InternalIndexShard.  
> > > index(InternalIndexShard.java:  
> > > 323)  
> > > at  
> > > org.elasticsearch.action.index.TransportIndexAction.  
> > > shardOperationOnPrimary(TransportIndexAction.java:  
> > > 206)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction.performOnPrimary(  
> > > TransportShardReplicationOperationAction.java:  
> > > 532)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOpera**tionAction  
> > > $AsyncShardOperationAction  
> > > $1.run( **TransportShardReplicationOpera** tionAction.java:430)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.runTask(\*\*ThreadPoolExecutor.java:886)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.run(\*\*ThreadPoolExecutor.java:908)  
> > > at java.lang.Thread.run(Thread.\*\*java:680)
> > > 
> > > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > > 
> > > > You only specified your analyzer on the \_all field, and not all the  
> > > > other  
> > > > fields (title, content). If you want it to apply to all (string)  
> > > > fields,  
> > > > you can simply name it "default".
> > > > 
> > > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > > 
> > > > > Hi,
> > > > 
> > > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > > In my index mapping file, I specified this analyzer using:
> > > > 
> > > > > {  
> > > > > "article" : {  
> > > > > "\_all" : {  
> > > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > > }  
> > > > > "properties" : {  
> > > > > "title" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > "content" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > ...  
> > > > > }
> > > > 
> > > > > It turns out that the analyzer is used properly when searching over  
> > > > > the entire article, e.g.  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?\*\*q=foo-bar](http://localhost:9200/ **development_articles/_search?** q=foo-bar)[http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > > 
> > > > > But the analyzer is not used when I search on a specific property, it  
> > > > > seems to use the default analyzer:  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?](http://localhost:9200/**development_articles/_search?)\*\*  
> > > > > q=someproperty:foo.[http://localhost:9200/development\_articles/\_search?q=someproperty:foo.](http://localhost:9200/development_articles/_search?q=someproperty:foo.)  
> > > > > ..
> > > > 
> > > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > > match on one part of the word only (foo or bar separately)
> > > > 
> > > > > Any idea?
> 
> Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:
> 
> > That NPE is strange..., is there a chance for a recreation?
> > 
> > On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> > 
> > > I tried specifying my analyzer on each field individually, but that  
> > > didn't work (same effect as with \_all). I have also tried setting it  
> > > as the default analyzer in elasticsearch.yml:
> > > 
> > > index.analysis.analyzer.\*\*default.type:  
> > > my.elasticsearch.\*\*FooAnalyzerProvider
> > > 
> > > But then I get this NPE when recreating the index for each store:
> > > 
> > > java.lang.NullPointerException  
> > > at  
> > > org.elasticsearch.index. **analysis.FieldNameAnalyzer.**  
> > > reusableTokenStream(\*\*FieldNameAnalyzer.java:  
> > > 60)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllTokenStream.**  
> > > allTokenStream(AllTokenStream.\*\*java:  
> > > 38)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllField.**  
> > > tokenStreamValue(AllField.\*\*java:  
> > > 64)  
> > > at  
> > > org.apache.lucene.index.\*\*DocInverterPerField.**processFields(**  
> > > DocInverterPerField.java:  
> > > 111)  
> > > at  
> > > org.apache.lucene.index.\*\*DocFieldProcessorPerThread.\*_processDocument(_  
> > > \*DocFieldProcessorPerThread.**java:  
> > > 276)  
> > > at  
> > > org.apache.lucene.index.DocumentsWriter.updateDocument(  
> > > DocumentsWriter.java:  
> > > 766)  
> > > at org.apache.lucene.index.IndexWriter.addDocument(  
> > > IndexWriter.java:  
> > > 2060)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > innerIndex(RobinEngine.java:  
> > > 567)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > index(RobinEngine.java:  
> > > 479)  
> > > at  
> > > org.elasticsearch.index.shard.service.InternalIndexShard.  
> > > index(InternalIndexShard.java:  
> > > 323)  
> > > at  
> > > org.elasticsearch.action.index.TransportIndexAction.  
> > > shardOperationOnPrimary(TransportIndexAction.java:  
> > > 206)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction.performOnPrimary(  
> > > TransportShardReplicationOperationAction.java:  
> > > 532)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOpera**tionAction  
> > > $AsyncShardOperationAction  
> > > $1.run( **TransportShardReplicationOpera** tionAction.java:430)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.runTask(\*\*ThreadPoolExecutor.java:886)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.run(\*\*ThreadPoolExecutor.java:908)  
> > > at java.lang.Thread.run(Thread.\*\*java:680)
> > > 
> > > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > > 
> > > > You only specified your analyzer on the \_all field, and not all the  
> > > > other  
> > > > fields (title, content). If you want it to apply to all (string)  
> > > > fields,  
> > > > you can simply name it "default".
> > > > 
> > > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > > 
> > > > > Hi,
> > > > 
> > > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > > In my index mapping file, I specified this analyzer using:
> > > > 
> > > > > {  
> > > > > "article" : {  
> > > > > "\_all" : {  
> > > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > > }  
> > > > > "properties" : {  
> > > > > "title" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > "content" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > ...  
> > > > > }
> > > > 
> > > > > It turns out that the analyzer is used properly when searching over  
> > > > > the entire article, e.g.  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?\*\*q=foo-bar](http://localhost:9200/ **development_articles/_search?** q=foo-bar)[http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > > 
> > > > > But the analyzer is not used when I search on a specific property, it  
> > > > > seems to use the default analyzer:  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?](http://localhost:9200/**development_articles/_search?)\*\*  
> > > > > q=someproperty:foo.[http://localhost:9200/development\_articles/\_search?q=someproperty:foo.](http://localhost:9200/development_articles/_search?q=someproperty:foo.)  
> > > > > ..
> > > > 
> > > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > > match on one part of the word only (foo or bar separately)
> > > > 
> > > > > Any idea?
> 
> Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:
> 
> > That NPE is strange..., is there a chance for a recreation?
> > 
> > On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> > 
> > > I tried specifying my analyzer on each field individually, but that  
> > > didn't work (same effect as with \_all). I have also tried setting it  
> > > as the default analyzer in elasticsearch.yml:
> > > 
> > > index.analysis.analyzer.\*\*default.type:  
> > > my.elasticsearch.\*\*FooAnalyzerProvider
> > > 
> > > But then I get this NPE when recreating the index for each store:
> > > 
> > > java.lang.NullPointerException  
> > > at  
> > > org.elasticsearch.index. **analysis.FieldNameAnalyzer.**  
> > > reusableTokenStream(\*\*FieldNameAnalyzer.java:  
> > > 60)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllTokenStream.**  
> > > allTokenStream(AllTokenStream.\*\*java:  
> > > 38)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllField.**  
> > > tokenStreamValue(AllField.\*\*java:  
> > > 64)  
> > > at  
> > > org.apache.lucene.index.\*\*DocInverterPerField.**processFields(**  
> > > DocInverterPerField.java:  
> > > 111)  
> > > at  
> > > org.apache.lucene.index.\*\*DocFieldProcessorPerThread.\*_processDocument(_  
> > > \*DocFieldProcessorPerThread.**java:  
> > > 276)  
> > > at  
> > > org.apache.lucene.index.DocumentsWriter.updateDocument(  
> > > DocumentsWriter.java:  
> > > 766)  
> > > at org.apache.lucene.index.IndexWriter.addDocument(  
> > > IndexWriter.java:  
> > > 2060)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > innerIndex(RobinEngine.java:  
> > > 567)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > index(RobinEngine.java:  
> > > 479)  
> > > at  
> > > org.elasticsearch.index.shard.service.InternalIndexShard.  
> > > index(InternalIndexShard.java:  
> > > 323)  
> > > at  
> > > org.elasticsearch.action.index.TransportIndexAction.  
> > > shardOperationOnPrimary(TransportIndexAction.java:  
> > > 206)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction.performOnPrimary(  
> > > TransportShardReplicationOperationAction.java:  
> > > 532)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOpera**tionAction  
> > > $AsyncShardOperationAction  
> > > $1.run( **TransportShardReplicationOpera** tionAction.java:430)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.runTask(\*\*ThreadPoolExecutor.java:886)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.run(\*\*ThreadPoolExecutor.java:908)  
> > > at java.lang.Thread.run(Thread.\*\*java:680)
> > > 
> > > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > > 
> > > > You only specified your analyzer on the \_all field, and not all the  
> > > > other  
> > > > fields (title, content). If you want it to apply to all (string)  
> > > > fields,  
> > > > you can simply name it "default".
> > > > 
> > > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > > 
> > > > > Hi,
> > > > 
> > > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > > In my index mapping file, I specified this analyzer using:
> > > > 
> > > > > {  
> > > > > "article" : {  
> > > > > "\_all" : {  
> > > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > > }  
> > > > > "properties" : {  
> > > > > "title" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > "content" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > ...  
> > > > > }
> > > > 
> > > > > It turns out that the analyzer is used properly when searching over  
> > > > > the entire article, e.g.  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?\*\*q=foo-bar](http://localhost:9200/ **development_articles/_search?** q=foo-bar)[http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > > 
> > > > > But the analyzer is not used when I search on a specific property, it  
> > > > > seems to use the default analyzer:  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?](http://localhost:9200/**development_articles/_search?)\*\*  
> > > > > q=someproperty:foo.[http://localhost:9200/development\_articles/\_search?q=someproperty:foo.](http://localhost:9200/development_articles/_search?q=someproperty:foo.)  
> > > > > ..
> > > > 
> > > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > > match on one part of the word only (foo or bar separately)
> > > > 
> > > > > Any idea?
> 
> Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:
> 
> > That NPE is strange..., is there a chance for a recreation?
> > 
> > On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> > 
> > > I tried specifying my analyzer on each field individually, but that  
> > > didn't work (same effect as with \_all). I have also tried setting it  
> > > as the default analyzer in elasticsearch.yml:
> > > 
> > > index.analysis.analyzer.\*\*default.type:  
> > > my.elasticsearch.\*\*FooAnalyzerProvider
> > > 
> > > But then I get this NPE when recreating the index for each store:
> > > 
> > > java.lang.NullPointerException  
> > > at  
> > > org.elasticsearch.index. **analysis.FieldNameAnalyzer.**  
> > > reusableTokenStream(\*\*FieldNameAnalyzer.java:  
> > > 60)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllTokenStream.**  
> > > allTokenStream(AllTokenStream.\*\*java:  
> > > 38)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllField.**  
> > > tokenStreamValue(AllField.\*\*java:  
> > > 64)  
> > > at  
> > > org.apache.lucene.index.\*\*DocInverterPerField.**processFields(**  
> > > DocInverterPerField.java:  
> > > 111)  
> > > at  
> > > org.apache.lucene.index.\*\*DocFieldProcessorPerThread.\*_processDocument(_  
> > > \*DocFieldProcessorPerThread.**java:  
> > > 276)  
> > > at  
> > > org.apache.lucene.index.DocumentsWriter.updateDocument(  
> > > DocumentsWriter.java:  
> > > 766)  
> > > at org.apache.lucene.index.IndexWriter.addDocument(  
> > > IndexWriter.java:  
> > > 2060)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > innerIndex(RobinEngine.java:  
> > > 567)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > index(RobinEngine.java:  
> > > 479)  
> > > at  
> > > org.elasticsearch.index.shard.service.InternalIndexShard.  
> > > index(InternalIndexShard.java:  
> > > 323)  
> > > at  
> > > org.elasticsearch.action.index.TransportIndexAction.  
> > > shardOperationOnPrimary(TransportIndexAction.java:  
> > > 206)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction.performOnPrimary(  
> > > TransportShardReplicationOperationAction.java:  
> > > 532)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOpera**tionAction  
> > > $AsyncShardOperationAction  
> > > $1.run( **TransportShardReplicationOpera** tionAction.java:430)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.runTask(\*\*ThreadPoolExecutor.java:886)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.run(\*\*ThreadPoolExecutor.java:908)  
> > > at java.lang.Thread.run(Thread.\*\*java:680)
> > > 
> > > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > > 
> > > > You only specified your analyzer on the \_all field, and not all the  
> > > > other  
> > > > fields (title, content). If you want it to apply to all (string)  
> > > > fields,  
> > > > you can simply name it "default".
> > > > 
> > > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > > 
> > > > > Hi,
> > > > 
> > > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > > In my index mapping file, I specified this analyzer using:
> > > > 
> > > > > {  
> > > > > "article" : {  
> > > > > "\_all" : {  
> > > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > > }  
> > > > > "properties" : {  
> > > > > "title" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > "content" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > ...  
> > > > > }
> > > > 
> > > > > It turns out that the analyzer is used properly when searching over  
> > > > > the entire article, e.g.  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?\*\*q=foo-bar](http://localhost:9200/ **development_articles/_search?** q=foo-bar)[http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > > 
> > > > > But the analyzer is not used when I search on a specific property, it  
> > > > > seems to use the default analyzer:  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?](http://localhost:9200/**development_articles/_search?)\*\*  
> > > > > q=someproperty:foo.[http://localhost:9200/development\_articles/\_search?q=someproperty:foo.](http://localhost:9200/development_articles/_search?q=someproperty:foo.)  
> > > > > ..
> > > > 
> > > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > > match on one part of the word only (foo or bar separately)
> > > > 
> > > > > Any idea?
> 
> Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:
> 
> > That NPE is strange..., is there a chance for a recreation?
> > 
> > On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> > 
> > > I tried specifying my analyzer on each field individually, but that  
> > > didn't work (same effect as with \_all). I have also tried setting it  
> > > as the default analyzer in elasticsearch.yml:
> > > 
> > > index.analysis.analyzer.\*\*default.type:  
> > > my.elasticsearch.\*\*FooAnalyzerProvider
> > > 
> > > But then I get this NPE when recreating the index for each store:
> > > 
> > > java.lang.NullPointerException  
> > > at  
> > > org.elasticsearch.index. **analysis.FieldNameAnalyzer.**  
> > > reusableTokenStream(\*\*FieldNameAnalyzer.java:  
> > > 60)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllTokenStream.**  
> > > allTokenStream(AllTokenStream.\*\*java:  
> > > 38)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllField.**  
> > > tokenStreamValue(AllField.\*\*java:  
> > > 64)  
> > > at  
> > > org.apache.lucene.index.\*\*DocInverterPerField.**processFields(**  
> > > DocInverterPerField.java:  
> > > 111)  
> > > at  
> > > org.apache.lucene.index.\*\*DocFieldProcessorPerThread.\*_processDocument(_  
> > > \*DocFieldProcessorPerThread.**java:  
> > > 276)  
> > > at  
> > > org.apache.lucene.index.DocumentsWriter.updateDocument(  
> > > DocumentsWriter.java:  
> > > 766)  
> > > at org.apache.lucene.index.IndexWriter.addDocument(  
> > > IndexWriter.java:  
> > > 2060)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > innerIndex(RobinEngine.java:  
> > > 567)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > index(RobinEngine.java:  
> > > 479)  
> > > at  
> > > org.elasticsearch.index.shard.service.InternalIndexShard.  
> > > index(InternalIndexShard.java:  
> > > 323)  
> > > at  
> > > org.elasticsearch.action.index.TransportIndexAction.  
> > > shardOperationOnPrimary(TransportIndexAction.java:  
> > > 206)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction.performOnPrimary(  
> > > TransportShardReplicationOperationAction.java:  
> > > 532)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOpera**tionAction  
> > > $AsyncShardOperationAction  
> > > $1.run( **TransportShardReplicationOpera** tionAction.java:430)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.runTask(\*\*ThreadPoolExecutor.java:886)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.run(\*\*ThreadPoolExecutor.java:908)  
> > > at java.lang.Thread.run(Thread.\*\*java:680)
> > > 
> > > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > > 
> > > > You only specified your analyzer on the \_all field, and not all the  
> > > > other  
> > > > fields (title, content). If you want it to apply to all (string)  
> > > > fields,  
> > > > you can simply name it "default".
> > > > 
> > > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > > 
> > > > > Hi,
> > > > 
> > > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > > In my index mapping file, I specified this analyzer using:
> > > > 
> > > > > {  
> > > > > "article" : {  
> > > > > "\_all" : {  
> > > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > > }  
> > > > > "properties" : {  
> > > > > "title" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > "content" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > ...  
> > > > > }
> > > > 
> > > > > It turns out that the analyzer is used properly when searching over  
> > > > > the entire article, e.g.  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?\*\*q=foo-bar](http://localhost:9200/ **development_articles/_search?** q=foo-bar)[http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > > 
> > > > > But the analyzer is not used when I search on a specific property, it  
> > > > > seems to use the default analyzer:  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?](http://localhost:9200/**development_articles/_search?)\*\*  
> > > > > q=someproperty:foo.[http://localhost:9200/development\_articles/\_search?q=someproperty:foo.](http://localhost:9200/development_articles/_search?q=someproperty:foo.)  
> > > > > ..
> > > > 
> > > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > > match on one part of the word only (foo or bar separately)
> > > > 
> > > > > Any idea?
> 
> Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:
> 
> > That NPE is strange..., is there a chance for a recreation?
> > 
> > On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> > 
> > > I tried specifying my analyzer on each field individually, but that  
> > > didn't work (same effect as with \_all). I have also tried setting it  
> > > as the default analyzer in elasticsearch.yml:
> > > 
> > > index.analysis.analyzer.\*\*default.type:  
> > > my.elasticsearch.\*\*FooAnalyzerProvider
> > > 
> > > But then I get this NPE when recreating the index for each store:
> > > 
> > > java.lang.NullPointerException  
> > > at  
> > > org.elasticsearch.index. **analysis.FieldNameAnalyzer.**  
> > > reusableTokenStream(\*\*FieldNameAnalyzer.java:  
> > > 60)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllTokenStream.**  
> > > allTokenStream(AllTokenStream.\*\*java:  
> > > 38)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllField.**  
> > > tokenStreamValue(AllField.\*\*java:  
> > > 64)  
> > > at  
> > > org.apache.lucene.index.\*\*DocInverterPerField.**processFields(**  
> > > DocInverterPerField.java:  
> > > 111)  
> > > at  
> > > org.apache.lucene.index.\*\*DocFieldProcessorPerThread.\*_processDocument(_  
> > > \*DocFieldProcessorPerThread.**java:  
> > > 276)  
> > > at  
> > > org.apache.lucene.index.DocumentsWriter.updateDocument(  
> > > DocumentsWriter.java:  
> > > 766)  
> > > at org.apache.lucene.index.IndexWriter.addDocument(  
> > > IndexWriter.java:  
> > > 2060)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > innerIndex(RobinEngine.java:  
> > > 567)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > index(RobinEngine.java:  
> > > 479)  
> > > at  
> > > org.elasticsearch.index.shard.service.InternalIndexShard.  
> > > index(InternalIndexShard.java:  
> > > 323)  
> > > at  
> > > org.elasticsearch.action.index.TransportIndexAction.  
> > > shardOperationOnPrimary(TransportIndexAction.java:  
> > > 206)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction.performOnPrimary(  
> > > TransportShardReplicationOperationAction.java:  
> > > 532)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOpera**tionAction  
> > > $AsyncShardOperationAction  
> > > $1.run( **TransportShardReplicationOpera** tionAction.java:430)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.runTask(\*\*ThreadPoolExecutor.java:886)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.run(\*\*ThreadPoolExecutor.java:908)  
> > > at java.lang.Thread.run(Thread.\*\*java:680)
> > > 
> > > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > > 
> > > > You only specified your analyzer on the \_all field, and not all the  
> > > > other  
> > > > fields (title, content). If you want it to apply to all (string)  
> > > > fields,  
> > > > you can simply name it "default".
> > > > 
> > > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > > 
> > > > > Hi,
> > > > 
> > > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > > In my index mapping file, I specified this analyzer using:
> > > > 
> > > > > {  
> > > > > "article" : {  
> > > > > "\_all" : {  
> > > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > > }  
> > > > > "properties" : {  
> > > > > "title" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > "content" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > ...  
> > > > > }
> > > > 
> > > > > It turns out that the analyzer is used properly when searching over  
> > > > > the entire article, e.g.  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?\*\*q=foo-bar](http://localhost:9200/ **development_articles/_search?** q=foo-bar)[http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > > 
> > > > > But the analyzer is not used when I search on a specific property, it  
> > > > > seems to use the default analyzer:  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?](http://localhost:9200/**development_articles/_search?)\*\*  
> > > > > q=someproperty:foo.[http://localhost:9200/development\_articles/\_search?q=someproperty:foo.](http://localhost:9200/development_articles/_search?q=someproperty:foo.)  
> > > > > ..
> > > > 
> > > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > > match on one part of the word only (foo or bar separately)
> > > > 
> > > > > Any idea?
> 
> Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:
> 
> > That NPE is strange..., is there a chance for a recreation?
> > 
> > On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> > 
> > > I tried specifying my analyzer on each field individually, but that  
> > > didn't work (same effect as with \_all). I have also tried setting it  
> > > as the default analyzer in elasticsearch.yml:
> > > 
> > > index.analysis.analyzer.\*\*default.type:  
> > > my.elasticsearch.\*\*FooAnalyzerProvider
> > > 
> > > But then I get this NPE when recreating the index for each store:
> > > 
> > > java.lang.NullPointerException  
> > > at  
> > > org.elasticsearch.index. **analysis.FieldNameAnalyzer.**  
> > > reusableTokenStream(\*\*FieldNameAnalyzer.java:  
> > > 60)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllTokenStream.**  
> > > allTokenStream(AllTokenStream.\*\*java:  
> > > 38)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllField.**  
> > > tokenStreamValue(AllField.\*\*java:  
> > > 64)  
> > > at  
> > > org.apache.lucene.index.\*\*DocInverterPerField.**processFields(**  
> > > DocInverterPerField.java:  
> > > 111)  
> > > at  
> > > org.apache.lucene.index.\*\*DocFieldProcessorPerThread.\*_processDocument(_  
> > > \*DocFieldProcessorPerThread.**java:  
> > > 276)  
> > > at  
> > > org.apache.lucene.index.DocumentsWriter.updateDocument(  
> > > DocumentsWriter.java:  
> > > 766)  
> > > at org.apache.lucene.index.IndexWriter.addDocument(  
> > > IndexWriter.java:  
> > > 2060)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > innerIndex(RobinEngine.java:  
> > > 567)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > index(RobinEngine.java:  
> > > 479)  
> > > at  
> > > org.elasticsearch.index.shard.service.InternalIndexShard.  
> > > index(InternalIndexShard.java:  
> > > 323)  
> > > at  
> > > org.elasticsearch.action.index.TransportIndexAction.  
> > > shardOperationOnPrimary(TransportIndexAction.java:  
> > > 206)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction.performOnPrimary(  
> > > TransportShardReplicationOperationAction.java:  
> > > 532)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOpera**tionAction  
> > > $AsyncShardOperationAction  
> > > $1.run( **TransportShardReplicationOpera** tionAction.java:430)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.runTask(\*\*ThreadPoolExecutor.java:886)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.run(\*\*ThreadPoolExecutor.java:908)  
> > > at java.lang.Thread.run(Thread.\*\*java:680)
> > > 
> > > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > > 
> > > > You only specified your analyzer on the \_all field, and not all the  
> > > > other  
> > > > fields (title, content). If you want it to apply to all (string)  
> > > > fields,  
> > > > you can simply name it "default".
> > > > 
> > > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > > 
> > > > > Hi,
> > > > 
> > > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > > In my index mapping file, I specified this analyzer using:
> > > > 
> > > > > {  
> > > > > "article" : {  
> > > > > "\_all" : {  
> > > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > > }  
> > > > > "properties" : {  
> > > > > "title" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > "content" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > ...  
> > > > > }
> > > > 
> > > > > It turns out that the analyzer is used properly when searching over  
> > > > > the entire article, e.g.  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?\*\*q=foo-bar](http://localhost:9200/ **development_articles/_search?** q=foo-bar)[http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > > 
> > > > > But the analyzer is not used when I search on a specific property, it  
> > > > > seems to use the default analyzer:  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?](http://localhost:9200/**development_articles/_search?)\*\*  
> > > > > q=someproperty:foo.[http://localhost:9200/development\_articles/\_search?q=someproperty:foo.](http://localhost:9200/development_articles/_search?q=someproperty:foo.)  
> > > > > ..
> > > > 
> > > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > > match on one part of the word only (foo or bar separately)
> > > > 
> > > > > Any idea?
> 
> Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:
> 
> > That NPE is strange..., is there a chance for a recreation?
> > 
> > On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> > 
> > > I tried specifying my analyzer on each field individually, but that  
> > > didn't work (same effect as with \_all). I have also tried setting it  
> > > as the default analyzer in elasticsearch.yml:
> > > 
> > > index.analysis.analyzer.\*\*default.type:  
> > > my.elasticsearch.\*\*FooAnalyzerProvider
> > > 
> > > But then I get this NPE when recreating the index for each store:
> > > 
> > > java.lang.NullPointerException  
> > > at  
> > > org.elasticsearch.index. **analysis.FieldNameAnalyzer.**  
> > > reusableTokenStream(\*\*FieldNameAnalyzer.java:  
> > > 60)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllTokenStream.**  
> > > allTokenStream(AllTokenStream.\*\*java:  
> > > 38)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllField.**  
> > > tokenStreamValue(AllField.\*\*java:  
> > > 64)  
> > > at  
> > > org.apache.lucene.index.\*\*DocInverterPerField.**processFields(**  
> > > DocInverterPerField.java:  
> > > 111)  
> > > at  
> > > org.apache.lucene.index.\*\*DocFieldProcessorPerThread.\*_processDocument(_  
> > > \*DocFieldProcessorPerThread.**java:  
> > > 276)  
> > > at  
> > > org.apache.lucene.index.DocumentsWriter.updateDocument(  
> > > DocumentsWriter.java:  
> > > 766)  
> > > at org.apache.lucene.index.IndexWriter.addDocument(  
> > > IndexWriter.java:  
> > > 2060)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > innerIndex(RobinEngine.java:  
> > > 567)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > index(RobinEngine.java:  
> > > 479)  
> > > at  
> > > org.elasticsearch.index.shard.service.InternalIndexShard.  
> > > index(InternalIndexShard.java:  
> > > 323)  
> > > at  
> > > org.elasticsearch.action.index.TransportIndexAction.  
> > > shardOperationOnPrimary(TransportIndexAction.java:  
> > > 206)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction.performOnPrimary(  
> > > TransportShardReplicationOperationAction.java:  
> > > 532)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOpera**tionAction  
> > > $AsyncShardOperationAction  
> > > $1.run( **TransportShardReplicationOpera** tionAction.java:430)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.runTask(\*\*ThreadPoolExecutor.java:886)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.run(\*\*ThreadPoolExecutor.java:908)  
> > > at java.lang.Thread.run(Thread.\*\*java:680)
> > > 
> > > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > > 
> > > > You only specified your analyzer on the \_all field, and not all the  
> > > > other  
> > > > fields (title, content). If you want it to apply to all (string)  
> > > > fields,  
> > > > you can simply name it "default".
> > > > 
> > > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > > 
> > > > > Hi,
> > > > 
> > > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > > In my index mapping file, I specified this analyzer using:
> > > > 
> > > > > {  
> > > > > "article" : {  
> > > > > "\_all" : {  
> > > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > > }  
> > > > > "properties" : {  
> > > > > "title" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > "content" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > ...  
> > > > > }
> > > > 
> > > > > It turns out that the analyzer is used properly when searching over  
> > > > > the entire article, e.g.  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?\*\*q=foo-bar](http://localhost:9200/ **development_articles/_search?** q=foo-bar)[http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > > 
> > > > > But the analyzer is not used when I search on a specific property, it  
> > > > > seems to use the default analyzer:  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?](http://localhost:9200/**development_articles/_search?)\*\*  
> > > > > q=someproperty:foo.[http://localhost:9200/development\_articles/\_search?q=someproperty:foo.](http://localhost:9200/development_articles/_search?q=someproperty:foo.)  
> > > > > ..
> > > > 
> > > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > > match on one part of the word only (foo or bar separately)
> > > > 
> > > > > Any idea?
> 
> Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:
> 
> > That NPE is strange..., is there a chance for a recreation?
> > 
> > On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> > 
> > > I tried specifying my analyzer on each field individually, but that  
> > > didn't work (same effect as with \_all). I have also tried setting it  
> > > as the default analyzer in elasticsearch.yml:
> > > 
> > > index.analysis.analyzer.\*\*default.type:  
> > > my.elasticsearch.\*\*FooAnalyzerProvider
> > > 
> > > But then I get this NPE when recreating the index for each store:
> > > 
> > > java.lang.NullPointerException  
> > > at  
> > > org.elasticsearch.index. **analysis.FieldNameAnalyzer.**  
> > > reusableTokenStream(\*\*FieldNameAnalyzer.java:  
> > > 60)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllTokenStream.**  
> > > allTokenStream(AllTokenStream.\*\*java:  
> > > 38)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllField.**  
> > > tokenStreamValue(AllField.\*\*java:  
> > > 64)  
> > > at  
> > > org.apache.lucene.index.\*\*DocInverterPerField.**processFields(**  
> > > DocInverterPerField.java:  
> > > 111)  
> > > at  
> > > org.apache.lucene.index.\*\*DocFieldProcessorPerThread.\*_processDocument(_  
> > > \*DocFieldProcessorPerThread.**java:  
> > > 276)  
> > > at  
> > > org.apache.lucene.index.DocumentsWriter.updateDocument(  
> > > DocumentsWriter.java:  
> > > 766)  
> > > at org.apache.lucene.index.IndexWriter.addDocument(  
> > > IndexWriter.java:  
> > > 2060)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > innerIndex(RobinEngine.java:  
> > > 567)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > index(RobinEngine.java:  
> > > 479)  
> > > at  
> > > org.elasticsearch.index.shard.service.InternalIndexShard.  
> > > index(InternalIndexShard.java:  
> > > 323)  
> > > at  
> > > org.elasticsearch.action.index.TransportIndexAction.  
> > > shardOperationOnPrimary(TransportIndexAction.java:  
> > > 206)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction.performOnPrimary(  
> > > TransportShardReplicationOperationAction.java:  
> > > 532)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOpera**tionAction  
> > > $AsyncShardOperationAction  
> > > $1.run( **TransportShardReplicationOpera** tionAction.java:430)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.runTask(\*\*ThreadPoolExecutor.java:886)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.run(\*\*ThreadPoolExecutor.java:908)  
> > > at java.lang.Thread.run(Thread.\*\*java:680)
> > > 
> > > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > > 
> > > > You only specified your analyzer on the \_all field, and not all the  
> > > > other  
> > > > fields (title, content). If you want it to apply to all (string)  
> > > > fields,  
> > > > you can simply name it "default".
> > > > 
> > > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > > 
> > > > > Hi,
> > > > 
> > > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > > In my index mapping file, I specified this analyzer using:
> > > > 
> > > > > {  
> > > > > "article" : {  
> > > > > "\_all" : {  
> > > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > > }  
> > > > > "properties" : {  
> > > > > "title" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > "content" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > ...  
> > > > > }
> > > > 
> > > > > It turns out that the analyzer is used properly when searching over  
> > > > > the entire article, e.g.  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?\*\*q=foo-bar](http://localhost:9200/ **development_articles/_search?** q=foo-bar)[http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > > 
> > > > > But the analyzer is not used when I search on a specific property, it  
> > > > > seems to use the default analyzer:  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?](http://localhost:9200/**development_articles/_search?)\*\*  
> > > > > q=someproperty:foo.[http://localhost:9200/development\_articles/\_search?q=someproperty:foo.](http://localhost:9200/development_articles/_search?q=someproperty:foo.)  
> > > > > ..
> > > > 
> > > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > > match on one part of the word only (foo or bar separately)
> > > > 
> > > > > Any idea?
> 
> Op dinsdag 15 mei 2012 22:41:05 UTC+2 schreef kimchy het volgende:
> 
> > That NPE is strange..., is there a chance for a recreation?
> > 
> > On Mon, May 14, 2012 at 3:52 PM, Filip Neven [filip.neven@gmail.com](mailto:filip.neven@gmail.com)wrote:
> > 
> > > I tried specifying my analyzer on each field individually, but that  
> > > didn't work (same effect as with \_all). I have also tried setting it  
> > > as the default analyzer in elasticsearch.yml:
> > > 
> > > index.analysis.analyzer.\*\*default.type:  
> > > my.elasticsearch.\*\*FooAnalyzerProvider
> > > 
> > > But then I get this NPE when recreating the index for each store:
> > > 
> > > java.lang.NullPointerException  
> > > at  
> > > org.elasticsearch.index. **analysis.FieldNameAnalyzer.**  
> > > reusableTokenStream(\*\*FieldNameAnalyzer.java:  
> > > 60)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllTokenStream.**  
> > > allTokenStream(AllTokenStream.\*\*java:  
> > > 38)  
> > > at  
> > > org.elasticsearch.common. **lucene.all.AllField.**  
> > > tokenStreamValue(AllField.\*\*java:  
> > > 64)  
> > > at  
> > > org.apache.lucene.index.\*\*DocInverterPerField.**processFields(**  
> > > DocInverterPerField.java:  
> > > 111)  
> > > at  
> > > org.apache.lucene.index.\*\*DocFieldProcessorPerThread.\*_processDocument(_  
> > > \*DocFieldProcessorPerThread.**java:  
> > > 276)  
> > > at  
> > > org.apache.lucene.index.DocumentsWriter.updateDocument(  
> > > DocumentsWriter.java:  
> > > 766)  
> > > at org.apache.lucene.index.IndexWriter.addDocument(  
> > > IndexWriter.java:  
> > > 2060)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > innerIndex(RobinEngine.java:  
> > > 567)  
> > > at  
> > > org.elasticsearch.index.engine.robin.RobinEngine.  
> > > index(RobinEngine.java:  
> > > 479)  
> > > at  
> > > org.elasticsearch.index.shard.service.InternalIndexShard.  
> > > index(InternalIndexShard.java:  
> > > 323)  
> > > at  
> > > org.elasticsearch.action.index.TransportIndexAction.  
> > > shardOperationOnPrimary(TransportIndexAction.java:  
> > > 206)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction.performOnPrimary(  
> > > TransportShardReplicationOperationAction.java:  
> > > 532)  
> > > at  
> > > org.elasticsearch.action.support.replication.  
> > > TransportShardReplicationOpera**tionAction  
> > > $AsyncShardOperationAction  
> > > $1.run( **TransportShardReplicationOpera** tionAction.java:430)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.runTask(\*\*ThreadPoolExecutor.java:886)  
> > > at java.util.concurrent.\*\*ThreadPoolExecutor  
> > > $Worker.run(\*\*ThreadPoolExecutor.java:908)  
> > > at java.lang.Thread.run(Thread.\*\*java:680)
> > > 
> > > On May 13, 11:44 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > > 
> > > > You only specified your analyzer on the \_all field, and not all the  
> > > > other  
> > > > fields (title, content). If you want it to apply to all (string)  
> > > > fields,  
> > > > you can simply name it "default".
> > > > 
> > > > On Thu, May 10, 2012 at 1:03 PM, Filip [filip.ne...@gmail.com](mailto:filip.ne...@gmail.com) wrote:
> > > > 
> > > > > Hi,
> > > > 
> > > > > I'm using a custom Lucene analyzer, made available through a plugin.  
> > > > > In my index mapping file, I specified this analyzer using:
> > > > 
> > > > > {  
> > > > > "article" : {  
> > > > > "\_all" : {  
> > > > > "indexAnalyzer" : "foo\_analyzer",  
> > > > > "searchAnalyzer" : "foo\_analyzer"  
> > > > > }  
> > > > > "properties" : {  
> > > > > "title" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > "content" : {  
> > > > > "type" : "string",  
> > > > > "index" : "analyzed"  
> > > > > }  
> > > > > ...  
> > > > > }
> > > > 
> > > > > It turns out that the analyzer is used properly when searching over  
> > > > > the entire article, e.g.  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?\*\*q=foo-bar](http://localhost:9200/ **development_articles/_search?** q=foo-bar)[http://localhost:9200/development\_articles/\_search?q=foo-bar](http://localhost:9200/development_articles/_search?q=foo-bar)
> > > > 
> > > > > But the analyzer is not used when I search on a specific property, it  
> > > > > seems to use the default analyzer:  
> > > > > [http://localhost:9200/\*\*development\_articles/\_search?](http://localhost:9200/**development_articles/_search?)\*\*  
> > > > > q=someproperty:foo.[http://localhost:9200/development\_articles/\_search?q=someproperty:foo.](http://localhost:9200/development_articles/_search?q=someproperty:foo.)  
> > > > > ..
> > > > 
> > > > > The goal of this analyzer is to make sure words concatenated with a  
> > > > > hyphen (foo-bar) are considered one word, and that the query doesn't  
> > > > > match on one part of the word only (foo or bar separately)
> > > > 
> > > > > Any idea?

---

<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, 3:28am UTC](https://discuss.elastic.co/t/custom-analyzer-not-applied-on-property-in-query/7630/7 "2017-07-06T03:28:29Z")

</div>


