# Error Creating Percolator

**URL:** <https://discuss.elastic.co/t/error-creating-percolator/4118>\
**Category:** Elasticsearch\
**Created:** [March 16, 2011, 9:28pm UTC](https://discuss.elastic.co/t/error-creating-percolator/4118 "2011-03-16T21:28:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![timscott](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timscott/32/3220_2.png) [@timscott](https://discuss.elastic.co/u/timscott)\
**Post date:** [March 16, 2011, 9:28pm UTC](https://discuss.elastic.co/t/error-creating-percolator/4118/1 "2011-03-16T21:28:41Z")

</div>

I get an error creating a percolator. First I test the query:

curl -XGET localhost:9200/test/\_search -d'  
{"query":{"bool":{"should":[],"must":[{"field":{"Content":  
{"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
{"query":true}}}]}}}'

It works fine and returns some documents. Then I try to create a  
percolator from the same query:

curl -XPUT localhost:9200/\_percolator/test/5d345404-d09b-4647-  
a584-9ea8010bc0ab -d'  
{"query":{"bool":{"should":[],"must":[{"field":{"Content":  
{"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
{"query":true}}}]}}}'

It throws. Any ideas? I'm running 0.15.2.

The exception:

Failed to execute [index {[\_percolator][test][5d345404-d09b-4647-  
a584-9ea8010bc0ab], source[  
{"query":{"bool":{"should":[],"must":[{"field":{"Content":  
{"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
{"query":true}}}]}}}]}]  
org.apache.lucene.store.AlreadyClosedException: this Analyzer is  
closed  
at  
org.apache.lucene.analysis.Analyzer.getPreviousTokenStream(Analyzer.java:  
65)  
at  
org.apache.lucene.analysis.standard.StandardAnalyzer.reusableTokenStream(StandardAnalyzer.java:  
143)  
at  
org.elasticsearch.index.analysis.NamedAnalyzer.reusableTokenStream(NamedAnalyzer.java:  
81)  
at org.elasticsearch.index.mapper.MapperService  
$SmartIndexNameSearchAnalyzer.reusableTokenStream(MapperService.java:  
551)  
at  
org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:  
519)  
at  
org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:  
118)  
at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:  
1362)  
at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:  
1250)  
at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:  
1178)  
at  
org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:  
1167)  
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:  
182)  
at  
org.elasticsearch.index.query.xcontent.FieldQueryParser.parse(FieldQueryParser.java:  
137)  
at  
org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
167)  
at  
org.elasticsearch.index.query.xcontent.BoolQueryParser.parse(BoolQueryParser.java:  
80)  
at  
org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
167)  
at  
org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
234)  
at  
org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
214)  
at  
org.elasticsearch.index.percolator.PercolatorExecutor.parseQuery(PercolatorExecutor.java:  
225)  
at  
org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
209)  
at  
org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
205)  
at org.elasticsearch.index.percolator.PercolatorService  
$RealTimePercolatorOperationListener.beforeIndex(PercolatorService.java:  
219)  
at  
org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
278)  
at  
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
184)  
at  
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
418)  
at  
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
$AsyncShardOperationAction.access  
$100(TransportShardReplicationOperationAction.java:233)  
at  
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
$AsyncShardOperationAction  
$1.run(TransportShardReplicationOperationAction.java:331)  
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)

---

<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:** [March 16, 2011, 9:31pm UTC](https://discuss.elastic.co/t/error-creating-percolator/4118/2 "2011-03-16T21:31:01Z")

</div>

Can you gist a full curl recreation? Fastest way to check/solve this.  
On Wednesday, March 16, 2011 at 11:28 PM, Tim Scott wrote:

> I get an error creating a percolator. First I test the query:
> 
> curl -XGET localhost:9200/test/\_search -d'  
> {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> {"query":true}}}]}}}'
> 
> It works fine and returns some documents. Then I try to create a  
> percolator from the same query:
> 
> curl -XPUT localhost:9200/\_percolator/test/5d345404-d09b-4647-  
> a584-9ea8010bc0ab -d'  
> {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> {"query":true}}}]}}}'
> 
> It throws. Any ideas? I'm running 0.15.2.
> 
> The exception:
> 
> Failed to execute [index {[\_percolator][test][5d345404-d09b-4647-  
> a584-9ea8010bc0ab], source[  
> {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> {"query":true}}}]}}}]}]  
> org.apache.lucene.store.AlreadyClosedException: this Analyzer is  
> closed  
> at  
> org.apache.lucene.analysis.Analyzer.getPreviousTokenStream(Analyzer.java:  
> 65)  
> at  
> org.apache.lucene.analysis.standard.StandardAnalyzer.reusableTokenStream(StandardAnalyzer.java:  
> 143)  
> at  
> org.elasticsearch.index.analysis.NamedAnalyzer.reusableTokenStream(NamedAnalyzer.java:  
> 81)  
> at org.elasticsearch.index.mapper.MapperService  
> $SmartIndexNameSearchAnalyzer.reusableTokenStream(MapperService.java:  
> 551)  
> at  
> org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:  
> 519)  
> at  
> org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:  
> 118)  
> at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:  
> 1362)  
> at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:  
> 1250)  
> at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:  
> 1178)  
> at  
> org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:  
> 1167)  
> at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:  
> 182)  
> at  
> org.elasticsearch.index.query.xcontent.FieldQueryParser.parse(FieldQueryParser.java:  
> 137)  
> at  
> org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> 167)  
> at  
> org.elasticsearch.index.query.xcontent.BoolQueryParser.parse(BoolQueryParser.java:  
> 80)  
> at  
> org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> 167)  
> at  
> org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> 234)  
> at  
> org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> 214)  
> at  
> org.elasticsearch.index.percolator.PercolatorExecutor.parseQuery(PercolatorExecutor.java:  
> 225)  
> at  
> org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> 209)  
> at  
> org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> 205)  
> at org.elasticsearch.index.percolator.PercolatorService  
> $RealTimePercolatorOperationListener.beforeIndex(PercolatorService.java:  
> 219)  
> at  
> org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> 278)  
> at  
> org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> 184)  
> at  
> org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> 418)  
> at  
> org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> $AsyncShardOperationAction.access  
> $100(TransportShardReplicationOperationAction.java:233)  
> at  
> org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> $AsyncShardOperationAction  
> $1.run(TransportShardReplicationOperationAction.java:331)  
> 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)

---

<div class="post-metadata">

**Author:** ![timscott](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timscott/32/3220_2.png) [@timscott](https://discuss.elastic.co/u/timscott)\
**Post date:** [March 16, 2011, 10:56pm UTC](https://discuss.elastic.co/t/error-creating-percolator/4118/3 "2011-03-16T22:56:19Z")

</div>

Here's the gist: [Shows how to recreate AlreadyClosedException when creating a percolator in 0.15.2 · GitHub](http://gist.github.com/873473)

Not 100% sure, but I think I do not get this error if the query only  
touches non analyzed fields.

On Mar 16, 4:31 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Can you gist a full curl recreation? Fastest way to check/solve this.
> 
> On Wednesday, March 16, 2011 at 11:28 PM, Tim Scott wrote:
> 
> > I get an error creating a percolator. First I test the query:
> 
> > curl -XGET localhost:9200/test/\_search -d'  
> > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > {"query":true}}}]}}}'
> 
> > It works fine and returns some documents. Then I try to create a  
> > percolator from the same query:
> 
> > curl -XPUT localhost:9200/\_percolator/test/5d345404-d09b-4647-  
> > a584-9ea8010bc0ab -d'  
> > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > {"query":true}}}]}}}'
> 
> > It throws. Any ideas? I'm running 0.15.2.
> 
> > The exception:
> 
> > Failed to execute [index {[\_percolator][test][5d345404-d09b-4647-  
> > a584-9ea8010bc0ab], source[  
> > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > {"query":true}}}]}}}]}]  
> > org.apache.lucene.store.AlreadyClosedException: this Analyzer is  
> > closed  
> > at  
> > org.apache.lucene.analysis.Analyzer.getPreviousTokenStream(Analyzer.java:  
> > 65)  
> > at  
> > org.apache.lucene.analysis.standard.StandardAnalyzer.reusableTokenStream(StandardAnalyzer.java:  
> > 143)  
> > at  
> > org.elasticsearch.index.analysis.NamedAnalyzer.reusableTokenStream(NamedAnalyzer.java:  
> > 81)  
> > at org.elasticsearch.index.mapper.MapperService  
> > $SmartIndexNameSearchAnalyzer.reusableTokenStream(MapperService.java:  
> > 551)  
> > at  
> > org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:  
> > 519)  
> > at  
> > org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:  
> > 118)  
> > at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:  
> > 1362)  
> > at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:  
> > 1250)  
> > at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:  
> > 1178)  
> > at  
> > org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:  
> > 1167)  
> > at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:  
> > 182)  
> > at  
> > org.elasticsearch.index.query.xcontent.FieldQueryParser.parse(FieldQueryParser.java:  
> > 137)  
> > at  
> > org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> > 167)  
> > at  
> > org.elasticsearch.index.query.xcontent.BoolQueryParser.parse(BoolQueryParser.java:  
> > 80)  
> > at  
> > org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> > 167)  
> > at  
> > org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> > 234)  
> > at  
> > org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> > 214)  
> > at  
> > org.elasticsearch.index.percolator.PercolatorExecutor.parseQuery(PercolatorExecutor.java:  
> > 225)  
> > at  
> > org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> > 209)  
> > at  
> > org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> > 205)  
> > at org.elasticsearch.index.percolator.PercolatorService  
> > $RealTimePercolatorOperationListener.beforeIndex(PercolatorService.java:  
> > 219)  
> > at  
> > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > 278)  
> > at  
> > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > 184)  
> > at  
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > 418)  
> > at  
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction.access  
> > $100(TransportShardReplicationOperationAction.java:233)  
> > at  
> > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > $AsyncShardOperationAction  
> > $1.run(TransportShardReplicationOperationAction.java:331)  
> > 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)

---

<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:** [March 17, 2011, 10:12am UTC](https://discuss.elastic.co/t/error-creating-percolator/4118/4 "2011-03-17T10:12:36Z")

</div>

Are you sure you are running on 0.15.2? I just ran this test on 0.15.2 (single node) and it passes. One reason that might explain this is an issue fixed in 0.15.1: [Percolate: Failure to percolate with specific query (when creating the \_percolate index before the actual index) · Issue #725 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/725).  
On Thursday, March 17, 2011 at 12:56 AM, Tim Scott wrote:

> Here's the gist: [Shows how to recreate AlreadyClosedException when creating a percolator in 0.15.2 · GitHub](http://gist.github.com/873473)
> 
> Not 100% sure, but I think I do not get this error if the query only  
> touches non analyzed fields.
> 
> On Mar 16, 4:31 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > Can you gist a full curl recreation? Fastest way to check/solve this.
> > 
> > On Wednesday, March 16, 2011 at 11:28 PM, Tim Scott wrote:
> > 
> > > I get an error creating a percolator. First I test the query:
> > 
> > > curl -XGET localhost:9200/test/\_search -d'  
> > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > {"query":true}}}]}}}'
> > 
> > > It works fine and returns some documents. Then I try to create a  
> > > percolator from the same query:
> > 
> > > curl -XPUT localhost:9200/\_percolator/test/5d345404-d09b-4647-  
> > > a584-9ea8010bc0ab -d'  
> > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > {"query":true}}}]}}}'
> > 
> > > It throws. Any ideas? I'm running 0.15.2.
> > 
> > > The exception:
> > 
> > > Failed to execute [index {[\_percolator][test][5d345404-d09b-4647-  
> > > a584-9ea8010bc0ab], source[  
> > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > {"query":true}}}]}}}]}]  
> > > org.apache.lucene.store.AlreadyClosedException: this Analyzer is  
> > > closed  
> > > at  
> > > org.apache.lucene.analysis.Analyzer.getPreviousTokenStream(Analyzer.java:  
> > > 65)  
> > > at  
> > > org.apache.lucene.analysis.standard.StandardAnalyzer.reusableTokenStream(StandardAnalyzer.java:  
> > > 143)  
> > > at  
> > > org.elasticsearch.index.analysis.NamedAnalyzer.reusableTokenStream(NamedAnalyzer.java:  
> > > 81)  
> > > at org.elasticsearch.index.mapper.MapperService  
> > > $SmartIndexNameSearchAnalyzer.reusableTokenStream(MapperService.java:  
> > > 551)  
> > > at  
> > > org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:  
> > > 519)  
> > > at  
> > > org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:  
> > > 118)  
> > > at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:  
> > > 1362)  
> > > at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:  
> > > 1250)  
> > > at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:  
> > > 1178)  
> > > at  
> > > org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:  
> > > 1167)  
> > > at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:  
> > > 182)  
> > > at  
> > > org.elasticsearch.index.query.xcontent.FieldQueryParser.parse(FieldQueryParser.java:  
> > > 137)  
> > > at  
> > > org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> > > 167)  
> > > at  
> > > org.elasticsearch.index.query.xcontent.BoolQueryParser.parse(BoolQueryParser.java:  
> > > 80)  
> > > at  
> > > org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> > > 167)  
> > > at  
> > > org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> > > 234)  
> > > at  
> > > org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> > > 214)  
> > > at  
> > > org.elasticsearch.index.percolator.PercolatorExecutor.parseQuery(PercolatorExecutor.java:  
> > > 225)  
> > > at  
> > > org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> > > 209)  
> > > at  
> > > org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> > > 205)  
> > > at org.elasticsearch.index.percolator.PercolatorService  
> > > $RealTimePercolatorOperationListener.beforeIndex(PercolatorService.java:  
> > > 219)  
> > > at  
> > > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > > 278)  
> > > at  
> > > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > > 184)  
> > > at  
> > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > > 418)  
> > > at  
> > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction.access  
> > > $100(TransportShardReplicationOperationAction.java:233)  
> > > at  
> > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > $AsyncShardOperationAction  
> > > $1.run(TransportShardReplicationOperationAction.java:331)  
> > > 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)

---

<div class="post-metadata">

**Author:** ![timscott](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timscott/32/3220_2.png) [@timscott](https://discuss.elastic.co/u/timscott)\
**Post date:** [March 17, 2011, 3:08pm UTC](https://discuss.elastic.co/t/error-creating-percolator/4118/5 "2011-03-17T15:08:09Z")

</div>

Yes, I am on 0.15.2. I reproduced again with the following steps:

1. Shut down elasticsearch. I checked Activity Monitor to be sure  
that java was not running.
2. Started elasticsearch. The output contained this: {elasticsearch/  
0.15.2}[77619]: initializing ...
3. Deleted the "test" index.
4. Repeated the gist-ed curl.

Same result. Could it be that my install is corrupted, or worse,  
something bad with my data?

On Mar 17, 5:12 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Are you sure you are running on 0.15.2? I just ran this test on 0.15.2 (single node) and it passes. One reason that might explain this is an issue fixed in 0.15.1:[Percolate: Failure to percolate with specific query (when creating the \_percolate index before the actual index) · Issue #725 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/725).
> 
> On Thursday, March 17, 2011 at 12:56 AM, Tim Scott wrote:
> 
> > Here's the gist:[Shows how to recreate AlreadyClosedException when creating a percolator in 0.15.2 · GitHub](http://gist.github.com/873473)
> 
> > Not 100% sure, but I think I do not get this error if the query only  
> > touches non analyzed fields.
> 
> > On Mar 16, 4:31 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > 
> > > Can you gist a full curl recreation? Fastest way to check/solve this.
> 
> > > On Wednesday, March 16, 2011 at 11:28 PM, Tim Scott wrote:
> > > 
> > > > I get an error creating a percolator. First I test the query:
> 
> > > > curl -XGET localhost:9200/test/\_search -d'  
> > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > {"query":true}}}]}}}'
> 
> > > > It works fine and returns some documents. Then I try to create a  
> > > > percolator from the same query:
> 
> > > > curl -XPUT localhost:9200/\_percolator/test/5d345404-d09b-4647-  
> > > > a584-9ea8010bc0ab -d'  
> > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > {"query":true}}}]}}}'
> 
> > > > It throws. Any ideas? I'm running 0.15.2.
> 
> > > > The exception:
> 
> > > > Failed to execute [index {[\_percolator][test][5d345404-d09b-4647-  
> > > > a584-9ea8010bc0ab], source[  
> > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > {"query":true}}}]}}}]}]  
> > > > org.apache.lucene.store.AlreadyClosedException: this Analyzer is  
> > > > closed  
> > > > at  
> > > > org.apache.lucene.analysis.Analyzer.getPreviousTokenStream(Analyzer.java:  
> > > > 65)  
> > > > at  
> > > > org.apache.lucene.analysis.standard.StandardAnalyzer.reusableTokenStream(StandardAnalyzer.java:  
> > > > 143)  
> > > > at  
> > > > org.elasticsearch.index.analysis.NamedAnalyzer.reusableTokenStream(NamedAnalyzer.java:  
> > > > 81)  
> > > > at org.elasticsearch.index.mapper.MapperService  
> > > > $SmartIndexNameSearchAnalyzer.reusableTokenStream(MapperService.java:  
> > > > 551)  
> > > > at  
> > > > org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:  
> > > > 519)  
> > > > at  
> > > > org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:  
> > > > 118)  
> > > > at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:  
> > > > 1362)  
> > > > at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:  
> > > > 1250)  
> > > > at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:  
> > > > 1178)  
> > > > at  
> > > > org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:  
> > > > 1167)  
> > > > at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:  
> > > > 182)  
> > > > at  
> > > > org.elasticsearch.index.query.xcontent.FieldQueryParser.parse(FieldQueryParser.java:  
> > > > 137)  
> > > > at  
> > > > org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> > > > 167)  
> > > > at  
> > > > org.elasticsearch.index.query.xcontent.BoolQueryParser.parse(BoolQueryParser.java:  
> > > > 80)  
> > > > at  
> > > > org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> > > > 167)  
> > > > at  
> > > > org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> > > > 234)  
> > > > at  
> > > > org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> > > > 214)  
> > > > at  
> > > > org.elasticsearch.index.percolator.PercolatorExecutor.parseQuery(PercolatorExecutor.java:  
> > > > 225)  
> > > > at  
> > > > org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> > > > 209)  
> > > > at  
> > > > org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> > > > 205)  
> > > > at org.elasticsearch.index.percolator.PercolatorService  
> > > > $RealTimePercolatorOperationListener.beforeIndex(PercolatorService.java:  
> > > > 219)  
> > > > at  
> > > > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > > > 278)  
> > > > at  
> > > > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > > > 184)  
> > > > at  
> > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > > > 418)  
> > > > at  
> > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > $AsyncShardOperationAction.access  
> > > > $100(TransportShardReplicationOperationAction.java:233)  
> > > > at  
> > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > $AsyncShardOperationAction  
> > > > $1.run(TransportShardReplicationOperationAction.java:331)  
> > > > 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)

---

<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:** [March 18, 2011, 12:05am UTC](https://discuss.elastic.co/t/error-creating-percolator/4118/6 "2011-03-18T00:05:20Z")

</div>

Ok, managed to recreate it (it revolves around the fact that the index gets deleted for some reason). Will track it down. Opened an issue: [Percolator failure when deleting and creating an index, also causes problem with percolated queries isolation between different indices · Issue #790 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/790).  
On Thursday, March 17, 2011 at 5:08 PM, Tim Scott wrote:

> Yes, I am on 0.15.2. I reproduced again with the following steps:
> 
> 1. Shut down elasticsearch. I checked Activity Monitor to be sure  
> that java was not running.
> 2. Started elasticsearch. The output contained this: {elasticsearch/  
> 0.15.2}[77619]: initializing ...
> 3. Deleted the "test" index.
> 4. Repeated the gist-ed curl.
> 
> Same result. Could it be that my install is corrupted, or worse,  
> something bad with my data?
> 
> On Mar 17, 5:12 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > Are you sure you are running on 0.15.2? I just ran this test on 0.15.2 (single node) and it passes. One reason that might explain this is an issue fixed in 0.15.1:[Percolate: Failure to percolate with specific query (when creating the \_percolate index before the actual index) · Issue #725 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/725).
> > 
> > On Thursday, March 17, 2011 at 12:56 AM, Tim Scott wrote:
> > 
> > > Here's the gist:[Shows how to recreate AlreadyClosedException when creating a percolator in 0.15.2 · GitHub](http://gist.github.com/873473)
> > 
> > > Not 100% sure, but I think I do not get this error if the query only  
> > > touches non analyzed fields.
> > 
> > > On Mar 16, 4:31 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > > 
> > > > Can you gist a full curl recreation? Fastest way to check/solve this.
> > 
> > > > On Wednesday, March 16, 2011 at 11:28 PM, Tim Scott wrote:
> > > > 
> > > > > I get an error creating a percolator. First I test the query:
> > 
> > > > > curl -XGET localhost:9200/test/\_search -d'  
> > > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > > {"query":true}}}]}}}'
> > 
> > > > > It works fine and returns some documents. Then I try to create a  
> > > > > percolator from the same query:
> > 
> > > > > curl -XPUT localhost:9200/\_percolator/test/5d345404-d09b-4647-  
> > > > > a584-9ea8010bc0ab -d'  
> > > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > > {"query":true}}}]}}}'
> > 
> > > > > It throws. Any ideas? I'm running 0.15.2.
> > 
> > > > > The exception:
> > 
> > > > > Failed to execute [index {[\_percolator][test][5d345404-d09b-4647-  
> > > > > a584-9ea8010bc0ab], source[  
> > > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > > {"query":true}}}]}}}]}]  
> > > > > org.apache.lucene.store.AlreadyClosedException: this Analyzer is  
> > > > > closed  
> > > > > at  
> > > > > org.apache.lucene.analysis.Analyzer.getPreviousTokenStream(Analyzer.java:  
> > > > > 65)  
> > > > > at  
> > > > > org.apache.lucene.analysis.standard.StandardAnalyzer.reusableTokenStream(StandardAnalyzer.java:  
> > > > > 143)  
> > > > > at  
> > > > > org.elasticsearch.index.analysis.NamedAnalyzer.reusableTokenStream(NamedAnalyzer.java:  
> > > > > 81)  
> > > > > at org.elasticsearch.index.mapper.MapperService  
> > > > > $SmartIndexNameSearchAnalyzer.reusableTokenStream(MapperService.java:  
> > > > > 551)  
> > > > > at  
> > > > > org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:  
> > > > > 519)  
> > > > > at  
> > > > > org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:  
> > > > > 118)  
> > > > > at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:  
> > > > > 1362)  
> > > > > at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:  
> > > > > 1250)  
> > > > > at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:  
> > > > > 1178)  
> > > > > at  
> > > > > org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:  
> > > > > 1167)  
> > > > > at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:  
> > > > > 182)  
> > > > > at  
> > > > > org.elasticsearch.index.query.xcontent.FieldQueryParser.parse(FieldQueryParser.java:  
> > > > > 137)  
> > > > > at  
> > > > > org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> > > > > 167)  
> > > > > at  
> > > > > org.elasticsearch.index.query.xcontent.BoolQueryParser.parse(BoolQueryParser.java:  
> > > > > 80)  
> > > > > at  
> > > > > org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> > > > > 167)  
> > > > > at  
> > > > > org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> > > > > 234)  
> > > > > at  
> > > > > org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> > > > > 214)  
> > > > > at  
> > > > > org.elasticsearch.index.percolator.PercolatorExecutor.parseQuery(PercolatorExecutor.java:  
> > > > > 225)  
> > > > > at  
> > > > > org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> > > > > 209)  
> > > > > at  
> > > > > org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> > > > > 205)  
> > > > > at org.elasticsearch.index.percolator.PercolatorService  
> > > > > $RealTimePercolatorOperationListener.beforeIndex(PercolatorService.java:  
> > > > > 219)  
> > > > > at  
> > > > > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > > > > 278)  
> > > > > at  
> > > > > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > > > > 184)  
> > > > > at  
> > > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > > > > 418)  
> > > > > at  
> > > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > > $AsyncShardOperationAction.access  
> > > > > $100(TransportShardReplicationOperationAction.java:233)  
> > > > > at  
> > > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > > $AsyncShardOperationAction  
> > > > > $1.run(TransportShardReplicationOperationAction.java:331)  
> > > > > 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)

---

<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:** [March 18, 2011, 8:33am UTC](https://discuss.elastic.co/t/error-creating-percolator/4118/7 "2011-03-18T08:33:56Z")

</div>

ok, found the problem, running final tests and will push a fix soon. This also found a problem in isolation of percolated queries between different indices, so good job! 🙂  
On Friday, March 18, 2011 at 2:05 AM, Shay Banon wrote:

> Ok, managed to recreate it (it revolves around the fact that the index gets deleted for some reason). Will track it down. Opened an issue: [Percolator failure when deleting and creating an index, also causes problem with percolated queries isolation between different indices · Issue #790 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/790).  
> On Thursday, March 17, 2011 at 5:08 PM, Tim Scott wrote:
> 
> > Yes, I am on 0.15.2. I reproduced again with the following steps:
> > 
> > 1. Shut down elasticsearch. I checked Activity Monitor to be sure  
> > that java was not running.
> > 2. Started elasticsearch. The output contained this: {elasticsearch/  
> > 0.15.2}[77619]: initializing ...
> > 3. Deleted the "test" index.
> > 4. Repeated the gist-ed curl.
> > 
> > Same result. Could it be that my install is corrupted, or worse,  
> > something bad with my data?
> > 
> > On Mar 17, 5:12 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > 
> > > Are you sure you are running on 0.15.2? I just ran this test on 0.15.2 (single node) and it passes. One reason that might explain this is an issue fixed in 0.15.1:[Percolate: Failure to percolate with specific query (when creating the \_percolate index before the actual index) · Issue #725 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/725).
> > > 
> > > On Thursday, March 17, 2011 at 12:56 AM, Tim Scott wrote:
> > > 
> > > > Here's the gist:[Shows how to recreate AlreadyClosedException when creating a percolator in 0.15.2 · GitHub](http://gist.github.com/873473)
> > > 
> > > > Not 100% sure, but I think I do not get this error if the query only  
> > > > touches non analyzed fields.
> > > 
> > > > On Mar 16, 4:31 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > > > 
> > > > > Can you gist a full curl recreation? Fastest way to check/solve this.
> > > 
> > > > > On Wednesday, March 16, 2011 at 11:28 PM, Tim Scott wrote:
> > > > > 
> > > > > > I get an error creating a percolator. First I test the query:
> > > 
> > > > > > curl -XGET localhost:9200/test/\_search -d'  
> > > > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > > > {"query":true}}}]}}}'
> > > 
> > > > > > It works fine and returns some documents. Then I try to create a  
> > > > > > percolator from the same query:
> > > 
> > > > > > curl -XPUT localhost:9200/\_percolator/test/5d345404-d09b-4647-  
> > > > > > a584-9ea8010bc0ab -d'  
> > > > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > > > {"query":true}}}]}}}'
> > > 
> > > > > > It throws. Any ideas? I'm running 0.15.2.
> > > 
> > > > > > The exception:
> > > 
> > > > > > Failed to execute [index {[\_percolator][test][5d345404-d09b-4647-  
> > > > > > a584-9ea8010bc0ab], source[  
> > > > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > > > {"query":true}}}]}}}]}]  
> > > > > > org.apache.lucene.store.AlreadyClosedException: this Analyzer is  
> > > > > > closed  
> > > > > > at  
> > > > > > org.apache.lucene.analysis.Analyzer.getPreviousTokenStream(Analyzer.java:  
> > > > > > 65)  
> > > > > > at  
> > > > > > org.apache.lucene.analysis.standard.StandardAnalyzer.reusableTokenStream(StandardAnalyzer.java:  
> > > > > > 143)  
> > > > > > at  
> > > > > > org.elasticsearch.index.analysis.NamedAnalyzer.reusableTokenStream(NamedAnalyzer.java:  
> > > > > > 81)  
> > > > > > at org.elasticsearch.index.mapper.MapperService  
> > > > > > $SmartIndexNameSearchAnalyzer.reusableTokenStream(MapperService.java:  
> > > > > > 551)  
> > > > > > at  
> > > > > > org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:  
> > > > > > 519)  
> > > > > > at  
> > > > > > org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:  
> > > > > > 118)  
> > > > > > at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:  
> > > > > > 1362)  
> > > > > > at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:  
> > > > > > 1250)  
> > > > > > at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:  
> > > > > > 1178)  
> > > > > > at  
> > > > > > org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:  
> > > > > > 1167)  
> > > > > > at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:  
> > > > > > 182)  
> > > > > > at  
> > > > > > org.elasticsearch.index.query.xcontent.FieldQueryParser.parse(FieldQueryParser.java:  
> > > > > > 137)  
> > > > > > at  
> > > > > > org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> > > > > > 167)  
> > > > > > at  
> > > > > > org.elasticsearch.index.query.xcontent.BoolQueryParser.parse(BoolQueryParser.java:  
> > > > > > 80)  
> > > > > > at  
> > > > > > org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> > > > > > 167)  
> > > > > > at  
> > > > > > org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> > > > > > 234)  
> > > > > > at  
> > > > > > org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> > > > > > 214)  
> > > > > > at  
> > > > > > org.elasticsearch.index.percolator.PercolatorExecutor.parseQuery(PercolatorExecutor.java:  
> > > > > > 225)  
> > > > > > at  
> > > > > > org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> > > > > > 209)  
> > > > > > at  
> > > > > > org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> > > > > > 205)  
> > > > > > at org.elasticsearch.index.percolator.PercolatorService  
> > > > > > $RealTimePercolatorOperationListener.beforeIndex(PercolatorService.java:  
> > > > > > 219)  
> > > > > > at  
> > > > > > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > > > > > 278)  
> > > > > > at  
> > > > > > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > > > > > 184)  
> > > > > > at  
> > > > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > > > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > > > > > 418)  
> > > > > > at  
> > > > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > > > $AsyncShardOperationAction.access  
> > > > > > $100(TransportShardReplicationOperationAction.java:233)  
> > > > > > at  
> > > > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > > > $AsyncShardOperationAction  
> > > > > > $1.run(TransportShardReplicationOperationAction.java:331)  
> > > > > > 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)

---

<div class="post-metadata">

**Author:** ![timscott](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timscott/32/3220_2.png) [@timscott](https://discuss.elastic.co/u/timscott)\
**Post date:** [April 12, 2011, 2:33pm UTC](https://discuss.elastic.co/t/error-creating-percolator/4118/8 "2011-04-12T14:33:20Z")

</div>

I guess this is fixed in the trunk. Any guess when it will be  
released?

On Mar 18, 3:33 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> ok, found the problem, running final tests and will push a fix soon. This also found a problem in isolation of percolated queries between different indices, so good job! 🙂
> 
> On Friday, March 18, 2011 at 2:05 AM, Shay Banon wrote:
> 
> > Ok, managed to recreate it (it revolves around the fact that the index gets deleted for some reason). Will track it down. Opened an issue:[Percolator failure when deleting and creating an index, also causes problem with percolated queries isolation between different indices · Issue #790 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/790).  
> > On Thursday, March 17, 2011 at 5:08 PM, Tim Scott wrote:
> > 
> > > Yes, I am on 0.15.2. I reproduced again with the following steps:
> 
> > > 1. Shut down elasticsearch. I checked Activity Monitor to be sure  
> > > that java was not running.
> > > 2. Started elasticsearch. The output contained this: {elasticsearch/  
> > > 0.15.2}[77619]: initializing ...
> > > 3. Deleted the "test" index.
> > > 4. Repeated the gist-ed curl.
> 
> > > Same result. Could it be that my install is corrupted, or worse,  
> > > something bad with my data?
> 
> > > On Mar 17, 5:12 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > > 
> > > > Are you sure you are running on 0.15.2? I just ran this test on 0.15.2 (single node) and it passes. One reason that might explain this is an issue fixed in 0.15.1:[Percolate: Failure to percolate with specific query (when creating the \_percolate index before the actual index) · Issue #725 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/725).
> 
> > > > On Thursday, March 17, 2011 at 12:56 AM, Tim Scott wrote:
> > > > 
> > > > > Here's the gist:[Shows how to recreate AlreadyClosedException when creating a percolator in 0.15.2 · GitHub](http://gist.github.com/873473)
> 
> > > > > Not 100% sure, but I think I do not get this error if the query only  
> > > > > touches non analyzed fields.
> 
> > > > > On Mar 16, 4:31 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > > > > 
> > > > > > Can you gist a full curl recreation? Fastest way to check/solve this.
> 
> > > > > > On Wednesday, March 16, 2011 at 11:28 PM, Tim Scott wrote:
> > > > > > 
> > > > > > > I get an error creating a percolator. First I test the query:
> 
> > > > > > > curl -XGET localhost:9200/test/\_search -d'  
> > > > > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > > > > {"query":true}}}]}}}'
> 
> > > > > > > It works fine and returns some documents. Then I try to create a  
> > > > > > > percolator from the same query:
> 
> > > > > > > curl -XPUT localhost:9200/\_percolator/test/5d345404-d09b-4647-  
> > > > > > > a584-9ea8010bc0ab -d'  
> > > > > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > > > > {"query":true}}}]}}}'
> 
> > > > > > > It throws. Any ideas? I'm running 0.15.2.
> 
> > > > > > > The exception:
> 
> > > > > > > Failed to execute [index {[\_percolator][test][5d345404-d09b-4647-  
> > > > > > > a584-9ea8010bc0ab], source[  
> > > > > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > > > > {"query":true}}}]}}}]}]  
> > > > > > > org.apache.lucene.store.AlreadyClosedException: this Analyzer is  
> > > > > > > closed  
> > > > > > > at  
> > > > > > > org.apache.lucene.analysis.Analyzer.getPreviousTokenStream(Analyzer.java:  
> > > > > > > 65)  
> > > > > > > at  
> > > > > > > org.apache.lucene.analysis.standard.StandardAnalyzer.reusableTokenStream(StandardAnalyzer.java:  
> > > > > > > 143)  
> > > > > > > at  
> > > > > > > org.elasticsearch.index.analysis.NamedAnalyzer.reusableTokenStream(NamedAnalyzer.java:  
> > > > > > > 81)  
> > > > > > > at org.elasticsearch.index.mapper.MapperService  
> > > > > > > $SmartIndexNameSearchAnalyzer.reusableTokenStream(MapperService.java:  
> > > > > > > 551)  
> > > > > > > at  
> > > > > > > org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:  
> > > > > > > 519)  
> > > > > > > at  
> > > > > > > org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:  
> > > > > > > 118)  
> > > > > > > at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:  
> > > > > > > 1362)  
> > > > > > > at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:  
> > > > > > > 1250)  
> > > > > > > at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:  
> > > > > > > 1178)  
> > > > > > > at  
> > > > > > > org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:  
> > > > > > > 1167)  
> > > > > > > at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:  
> > > > > > > 182)  
> > > > > > > at  
> > > > > > > org.elasticsearch.index.query.xcontent.FieldQueryParser.parse(FieldQueryParser.java:  
> > > > > > > 137)  
> > > > > > > at  
> > > > > > > org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> > > > > > > 167)  
> > > > > > > at  
> > > > > > > org.elasticsearch.index.query.xcontent.BoolQueryParser.parse(BoolQueryParser.java:  
> > > > > > > 80)  
> > > > > > > at  
> > > > > > > org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> > > > > > > 167)  
> > > > > > > at  
> > > > > > > org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> > > > > > > 234)  
> > > > > > > at  
> > > > > > > org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> > > > > > > 214)  
> > > > > > > at  
> > > > > > > org.elasticsearch.index.percolator.PercolatorExecutor.parseQuery(PercolatorExecutor.java:  
> > > > > > > 225)  
> > > > > > > at  
> > > > > > > org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> > > > > > > 209)  
> > > > > > > at  
> > > > > > > org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> > > > > > > 205)  
> > > > > > > at org.elasticsearch.index.percolator.PercolatorService  
> > > > > > > $RealTimePercolatorOperationListener.beforeIndex(PercolatorService.java:  
> > > > > > > 219)  
> > > > > > > at  
> > > > > > > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > > > > > > 278)  
> > > > > > > at  
> > > > > > > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > > > > > > 184)  
> > > > > > > at  
> > > > > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > > > > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > > > > > > 418)  
> > > > > > > at  
> > > > > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > > > > $AsyncShardOperationAction.access  
> > > > > > > $100(TransportShardReplicationOperationAction.java:233)  
> > > > > > > at  
> > > > > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > > > > $AsyncShardOperationAction  
> > > > > > > $1.run(TransportShardReplicationOperationAction.java:331)  
> > > > > > > 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)

---

<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:** [April 12, 2011, 4:00pm UTC](https://discuss.elastic.co/t/error-creating-percolator/4118/9 "2011-04-12T16:00:34Z")

</div>

Trying to push to release 0.16 by the end of the week, or early next week.  
On Tuesday, April 12, 2011 at 5:33 PM, Tim Scott wrote:

> I guess this is fixed in the trunk. Any guess when it will be  
> released?
> 
> On Mar 18, 3:33 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > ok, found the problem, running final tests and will push a fix soon. This also found a problem in isolation of percolated queries between different indices, so good job! 🙂
> > 
> > On Friday, March 18, 2011 at 2:05 AM, Shay Banon wrote:
> > 
> > > Ok, managed to recreate it (it revolves around the fact that the index gets deleted for some reason). Will track it down. Opened an issue:[Percolator failure when deleting and creating an index, also causes problem with percolated queries isolation between different indices · Issue #790 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/790).  
> > > On Thursday, March 17, 2011 at 5:08 PM, Tim Scott wrote:
> > > 
> > > > Yes, I am on 0.15.2. I reproduced again with the following steps:
> > 
> > > > 1. Shut down elasticsearch. I checked Activity Monitor to be sure  
> > > > that java was not running.
> > > > 2. Started elasticsearch. The output contained this: {elasticsearch/  
> > > > 0.15.2}[77619]: initializing ...
> > > > 3. Deleted the "test" index.
> > > > 4. Repeated the gist-ed curl.
> > 
> > > > Same result. Could it be that my install is corrupted, or worse,  
> > > > something bad with my data?
> > 
> > > > On Mar 17, 5:12 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > > > 
> > > > > Are you sure you are running on 0.15.2? I just ran this test on 0.15.2 (single node) and it passes. One reason that might explain this is an issue fixed in 0.15.1:[Percolate: Failure to percolate with specific query (when creating the \_percolate index before the actual index) · Issue #725 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/725).
> > 
> > > > > On Thursday, March 17, 2011 at 12:56 AM, Tim Scott wrote:
> > > > > 
> > > > > > Here's the gist:[Shows how to recreate AlreadyClosedException when creating a percolator in 0.15.2 · GitHub](http://gist.github.com/873473)
> > 
> > > > > > Not 100% sure, but I think I do not get this error if the query only  
> > > > > > touches non analyzed fields.
> > 
> > > > > > On Mar 16, 4:31 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > > > > > 
> > > > > > > Can you gist a full curl recreation? Fastest way to check/solve this.
> > 
> > > > > > > On Wednesday, March 16, 2011 at 11:28 PM, Tim Scott wrote:
> > > > > > > 
> > > > > > > > I get an error creating a percolator. First I test the query:
> > 
> > > > > > > > curl -XGET localhost:9200/test/\_search -d'  
> > > > > > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > > > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > > > > > {"query":true}}}]}}}'
> > 
> > > > > > > > It works fine and returns some documents. Then I try to create a  
> > > > > > > > percolator from the same query:
> > 
> > > > > > > > curl -XPUT localhost:9200/\_percolator/test/5d345404-d09b-4647-  
> > > > > > > > a584-9ea8010bc0ab -d'  
> > > > > > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > > > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > > > > > {"query":true}}}]}}}'
> > 
> > > > > > > > It throws. Any ideas? I'm running 0.15.2.
> > 
> > > > > > > > The exception:
> > 
> > > > > > > > Failed to execute [index {[\_percolator][test][5d345404-d09b-4647-  
> > > > > > > > a584-9ea8010bc0ab], source[  
> > > > > > > > {"query":{"bool":{"should":,"must":[{"field":{"Content":  
> > > > > > > > {"query":"test","phrase\_slop":0}}}],"must\_not":[{"field":{"Trashed":  
> > > > > > > > {"query":true}}}]}}}]}]  
> > > > > > > > org.apache.lucene.store.AlreadyClosedException: this Analyzer is  
> > > > > > > > closed  
> > > > > > > > at  
> > > > > > > > org.apache.lucene.analysis.Analyzer.getPreviousTokenStream(Analyzer.java:  
> > > > > > > > 65)  
> > > > > > > > at  
> > > > > > > > org.apache.lucene.analysis.standard.StandardAnalyzer.reusableTokenStream(StandardAnalyzer.java:  
> > > > > > > > 143)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.index.analysis.NamedAnalyzer.reusableTokenStream(NamedAnalyzer.java:  
> > > > > > > > 81)  
> > > > > > > > at org.elasticsearch.index.mapper.MapperService  
> > > > > > > > $SmartIndexNameSearchAnalyzer.reusableTokenStream(MapperService.java:  
> > > > > > > > 551)  
> > > > > > > > at  
> > > > > > > > org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:  
> > > > > > > > 519)  
> > > > > > > > at  
> > > > > > > > org.apache.lucene.queryParser.MapperQueryParser.getFieldQuery(MapperQueryParser.java:  
> > > > > > > > 118)  
> > > > > > > > at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:  
> > > > > > > > 1362)  
> > > > > > > > at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:  
> > > > > > > > 1250)  
> > > > > > > > at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:  
> > > > > > > > 1178)  
> > > > > > > > at  
> > > > > > > > org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:  
> > > > > > > > 1167)  
> > > > > > > > at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:  
> > > > > > > > 182)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.index.query.xcontent.FieldQueryParser.parse(FieldQueryParser.java:  
> > > > > > > > 137)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> > > > > > > > 167)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.index.query.xcontent.BoolQueryParser.parse(BoolQueryParser.java:  
> > > > > > > > 80)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.index.query.xcontent.QueryParseContext.parseInnerQuery(QueryParseContext.java:  
> > > > > > > > 167)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> > > > > > > > 234)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.index.query.xcontent.XContentIndexQueryParser.parse(XContentIndexQueryParser.java:  
> > > > > > > > 214)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.index.percolator.PercolatorExecutor.parseQuery(PercolatorExecutor.java:  
> > > > > > > > 225)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> > > > > > > > 209)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:  
> > > > > > > > 205)  
> > > > > > > > at org.elasticsearch.index.percolator.PercolatorService  
> > > > > > > > $RealTimePercolatorOperationListener.beforeIndex(PercolatorService.java:  
> > > > > > > > 219)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:  
> > > > > > > > 278)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> > > > > > > > 184)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > > > > > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> > > > > > > > 418)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > > > > > $AsyncShardOperationAction.access  
> > > > > > > > $100(TransportShardReplicationOperationAction.java:233)  
> > > > > > > > at  
> > > > > > > > org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> > > > > > > > $AsyncShardOperationAction  
> > > > > > > > $1.run(TransportShardReplicationOperationAction.java:331)  
> > > > > > > > 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)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:08am UTC](https://discuss.elastic.co/t/error-creating-percolator/4118/10 "2017-07-06T04:08:27Z")

</div>


