Your analyzer implementation is probably faulty. Lucene 4.6 started being
more strict about analyzers lifecycle - I suggest you try it locally with
plain Lucene code to first verify its implementation follows the life cycle
rules.

Reference:
http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/analysis/TokenStream.html

--

Itamar Syn-Hershko
http://code972.com | @synhershko <https://twitter.com/synhershko>
Freelance Developer & Consultant
Author of RavenDB in Action <http://manning.com/synhershko/>


On Tue, Mar 18, 2014 at 1:30 PM, Tomasz Romanczuk <tomwid1...@gmail.com>wrote:

> After starting node I try to refresh index setting (i.e. change analyzer),
> but something goes wrong, I have an error:
> 2014-03-18 12:02:40,810 WARN  [org.elasticsearch.index.indexing]
> [alerts_node] [_percolator][0] post listener
> [org.elasticsearch.index.percolator.PercolatorService$RealTimePercolat
> orOperationListener@702f2591] failed
> org.elasticsearch.ElasticSearchException: failed to parse query [316]
>         at
> org.elasticsearch.index.percolator.PercolatorExecutor.parseQuery(PercolatorExecutor.java:361)
>         at
> org.elasticsearch.index.percolator.PercolatorExecutor.addQuery(PercolatorExecutor.java:332)
>         at
> org.elasticsearch.index.percolator.PercolatorService$RealTimePercolatorOperationListener.postIndexUnderLock(PercolatorService.java:295)
>         at
> org.elasticsearch.index.indexing.ShardIndexingService.postIndexUnderLock(ShardIndexingService.java:140)
>         at
> org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:594)
>         at
> org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:492)
>         at
> org.elasticsearch.index.shard.service.InternalIndexShard.performRecoveryOperation(InternalIndexShard.java:703)
>         at
> org.elasticsearch.index.gateway.local.LocalIndexShardGateway.recover(LocalIndexShardGateway.java:224)
>         at
> org.elasticsearch.index.gateway.IndexShardGatewayService$1.run(IndexShardGatewayService.java:174)
>         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:619)
> Caused by: org.apache.lucene.store.AlreadyClosedException: this Analyzer
> is closed
>         at
> org.apache.lucene.analysis.Analyzer$ReuseStrategy.getStoredValue(Analyzer.java:368)
>         at
> org.apache.lucene.analysis.Analyzer$GlobalReuseStrategy.getReusableComponents(Analyzer.java:410)
>         at
> org.apache.lucene.analysis.Analyzer.tokenStream(Analyzer.java:173)
>         at
> org.elasticsearch.index.search.MatchQuery.parse(MatchQuery.java:203)
>         at
> org.elasticsearch.index.query.MatchQueryParser.parse(MatchQueryParser.java:163)
>         at
> org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:207)
>         at
> org.elasticsearch.index.query.BoolQueryParser.parse(BoolQueryParser.java:107)
>         at
> org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:207)
>         at
> org.elasticsearch.index.query.BoolQueryParser.parse(BoolQueryParser.java:107)
>         at
> org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:207)
>         at
> org.elasticsearch.index.query.BoolQueryParser.parse(BoolQueryParser.java:107)
>         at
> org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:207)
>         at
> org.elasticsearch.index.query.BoolQueryParser.parse(BoolQueryParser.java:93)
>         at
> org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:207)
>         at
> org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:284)
>         at
> org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:255)
>         at
> org.elasticsearch.index.percolator.PercolatorExecutor.parseQuery(PercolatorExecutor.java:350)
>
> My code:
> node = NodeBuilder.nodeBuilder().settings(builder).build();
> node.start();
> client = node.getClient();
> client.admin().indices().prepareClose(INDEX_NAME).execute().actionGet();
> UpdateSettingsRequestBuilder builder =
> client.admin().indices().prepareUpdateSettings();
> builder.setIndices(INDEX_NAME);
> builder.setSettings(createSettings());
> builder.execute().actionGet();
> client.admin().indices().prepareOpen(INDEX_NAME).execute().actionGet();
>
> private Builder createSettings() throws IOException {
>         XContentBuilder builder =
> XContentFactory.jsonBuilder().startObject();
>         builder.startObject("analysis");
>         analyzer.appendSettings(builder);
>         builder.endObject();
>         builder.endObject();
>         return
> ImmutableSettings.settingsBuilder().loadFromSource(builder.string());
> }
>
> where *analyzer* is a simple class which only adds hunspell dictionary
> and my custom tokenizer.
>
> The problem is that there is a thead making index recovery and during this
> process I'm closing index. How can I avoid this situation? Is there any way
> to check if recovery is in progress?
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elasticsearch+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/53cef11a-e5c7-4a23-9d2e-8431691f4f73%40googlegroups.com<https://groups.google.com/d/msgid/elasticsearch/53cef11a-e5c7-4a23-9d2e-8431691f4f73%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvqOs4z2tRPqDHezz51EpDjzdeT_%2B31EawC0bLa_pE7bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to