From afe033878a1a6870acd7da3a3d429ba8121ecf30 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Sat, 5 Jul 2014 12:19:51 +0000 Subject: [PATCH] LUCENE-5803: Add more Javadocs to AnalyzerWrapper to encourage people to use DelegatingAnalyzerWrapper (if possible). Add changes entry for Solr. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1608005 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/analysis/AnalyzerWrapper.java | 19 +++++++++++++++---- solr/CHANGES.txt | 8 ++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/lucene/core/src/java/org/apache/lucene/analysis/AnalyzerWrapper.java b/lucene/core/src/java/org/apache/lucene/analysis/AnalyzerWrapper.java index 45ccadfed83..3c97438b891 100644 --- a/lucene/core/src/java/org/apache/lucene/analysis/AnalyzerWrapper.java +++ b/lucene/core/src/java/org/apache/lucene/analysis/AnalyzerWrapper.java @@ -22,13 +22,24 @@ import java.io.Reader; /** * Extension to {@link Analyzer} suitable for Analyzers which wrap * other Analyzers. - *

- * {@link #getWrappedAnalyzer(String)} allows the Analyzer + * + *

{@link #getWrappedAnalyzer(String)} allows the Analyzer * to wrap multiple Analyzers which are selected on a per field basis. - *

- * {@link #wrapComponents(String, Analyzer.TokenStreamComponents)} allows the + * + *

{@link #wrapComponents(String, Analyzer.TokenStreamComponents)} allows the * TokenStreamComponents of the wrapped Analyzer to then be wrapped * (such as adding a new {@link TokenFilter} to form new TokenStreamComponents. + * + *

{@link #wrapReader(String, Reader)} allows the Reader of the wrapped + * Analyzer to then be wrapped (such as adding a new {@link CharFilter}. + * + *

Important: If you do not want to wrap the TokenStream + * using {@link #wrapComponents(String, Analyzer.TokenStreamComponents)} + * or the Reader using {@link #wrapReader(String, Reader)} and just delegate + * to other analyzers (like by field name), use {@link DelegatingAnalyzerWrapper} + * as superclass! + * + * @see DelegatingAnalyzerWrapper */ public abstract class AnalyzerWrapper extends Analyzer { diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index e654c02a84e..02fb5baa3fb 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -158,6 +158,14 @@ Bug Fixes * SOLR-6223: SearchComponents may throw NPE when using shards.tolerant and there is a failure in the 'GET_FIELDS/GET_HIGHLIGHTS/GET_DEBUG' phase. (Tomás Fernández Löbbe via shalin) +Optimizations +--------------------- + +* LUCENE-5803: Solr's schema now uses DelegatingAnalyzerWrapper. This uses less heap + for cached TokenStreamComponents because it caches per FieldType not per Field, so + indexes with many fields of same type just use one TokenStream per thread. + (Shay Banon, Uwe Schindler, Robert Muir) + Other Changes ---------------------