diff options
author | Simon Willnauer <simon.willnauer@elasticsearch.com> | 2016-09-23 08:53:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-23 08:53:50 +0200 |
commit | fe1803c957b28f6a9099921fc23fa91eb92dfe6d (patch) | |
tree | c11e44e35482c08d306fe6a79cdefa93d16c7fda /core/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java | |
parent | e3b7b4f032b5865e4389ae52a8e2ff54721fb2dc (diff) |
Remove AnalysisService and reduce it to a simple name to analyzer mapping (#20627)
Today we hold on to all possible tokenizers, tokenfilters etc. when we create
an index service on a node. This was mainly done to allow the `_analyze` API to
directly access all these primitive. We fixed this in #19827 and can now get rid of
the AnalysisService entirely and replace it with a simple map like class. This
ensures we don't create a gazillion long living objects that are entirely useless since
they are never used in most of the indices. Also those objects might consume a considerable
amount of memory since they might load stopwords or synonyms etc.
Closes #19828
Diffstat (limited to 'core/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java')
-rw-r--r-- | core/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java index bff28d0f5b..d5e4d1d2a8 100644 --- a/core/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java @@ -164,7 +164,7 @@ public class MatchPhrasePrefixQueryBuilder extends AbstractQueryBuilder<MatchPhr @Override protected Query doToQuery(QueryShardContext context) throws IOException { // validate context specific fields - if (analyzer != null && context.getAnalysisService().analyzer(analyzer) == null) { + if (analyzer != null && context.getIndexAnalyzers().get(analyzer) == null) { throw new QueryShardException(context, "[" + NAME + "] analyzer [" + analyzer + "] not found"); } |