From 57ee35399117e5c44cc662997ec5d92ea34475c5 Mon Sep 17 00:00:00 2001 From: Christopher John Male Date: Wed, 9 May 2012 01:03:35 +0000 Subject: [PATCH] LUCENE-2510: Moved MultiTermComponent into analysis module git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1335876 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/analysis/util/AbstractAnalysisFactory.java | 2 +- .../lucene/analysis/util}/MultiTermAwareComponent.java | 6 +++--- .../solr/analysis/ICUCollationKeyFilterFactory.java | 6 ++---- .../org/apache/solr/analysis/ICUFoldingFilterFactory.java | 4 +++- .../apache/solr/analysis/ICUNormalizer2FilterFactory.java | 4 +++- .../apache/solr/analysis/ICUTransformFilterFactory.java | 4 +++- .../apache/solr/analysis/ASCIIFoldingFilterFactory.java | 4 +++- .../solr/analysis/ArabicNormalizationFilterFactory.java | 4 +++- .../org/apache/solr/analysis/CJKWidthFilterFactory.java | 4 +++- .../apache/solr/analysis/CollationKeyFilterFactory.java | 7 ++----- .../solr/analysis/GermanNormalizationFilterFactory.java | 4 +++- .../apache/solr/analysis/GreekLowerCaseFilterFactory.java | 4 +++- .../solr/analysis/HindiNormalizationFilterFactory.java | 4 +++- .../solr/analysis/IndicNormalizationFilterFactory.java | 4 +++- .../apache/solr/analysis/IrishLowerCaseFilterFactory.java | 4 +++- .../org/apache/solr/analysis/LowerCaseFilterFactory.java | 4 +++- .../apache/solr/analysis/LowerCaseTokenizerFactory.java | 5 +++-- .../apache/solr/analysis/MappingCharFilterFactory.java | 7 ++----- .../apache/solr/analysis/PersianCharFilterFactory.java | 4 +++- .../solr/analysis/PersianNormalizationFilterFactory.java | 4 +++- .../solr/analysis/TurkishLowerCaseFilterFactory.java | 4 +++- .../org/apache/solr/schema/FieldTypePluginLoader.java | 8 ++------ 22 files changed, 60 insertions(+), 41 deletions(-) rename {solr/core/src/java/org/apache/solr/analysis => lucene/analysis/common/src/java/org/apache/lucene/analysis/util}/MultiTermAwareComponent.java (92%) diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/AbstractAnalysisFactory.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/AbstractAnalysisFactory.java index 4dfde88d7f1..c1bee17c0d5 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/AbstractAnalysisFactory.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/AbstractAnalysisFactory.java @@ -36,7 +36,7 @@ import java.util.Map; * Abstract parent class for analysis factories {@link TokenizerFactory}, * {@link TokenFilterFactory} and {@link CharFilterFactory}. */ -abstract class AbstractAnalysisFactory { +public abstract class AbstractAnalysisFactory { /** The init args */ protected Map args; diff --git a/solr/core/src/java/org/apache/solr/analysis/MultiTermAwareComponent.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/MultiTermAwareComponent.java similarity index 92% rename from solr/core/src/java/org/apache/solr/analysis/MultiTermAwareComponent.java rename to lucene/analysis/common/src/java/org/apache/lucene/analysis/util/MultiTermAwareComponent.java index 68aaf7e213f..59e3ff7b691 100644 --- a/solr/core/src/java/org/apache/solr/analysis/MultiTermAwareComponent.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/util/MultiTermAwareComponent.java @@ -1,6 +1,6 @@ -package org.apache.solr.analysis; +package org.apache.lucene.analysis.util; -/** +/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -27,5 +27,5 @@ public interface MultiTermAwareComponent { /** Returns an analysis component to handle analysis if multi-term queries. * The returned component must be a TokenizerFactory, TokenFilterFactory or CharFilterFactory. */ - public Object getMultiTermComponent(); + public AbstractAnalysisFactory getMultiTermComponent(); } diff --git a/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUCollationKeyFilterFactory.java b/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUCollationKeyFilterFactory.java index 3305f3cfda1..dfa9c7a5cb2 100644 --- a/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUCollationKeyFilterFactory.java +++ b/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUCollationKeyFilterFactory.java @@ -21,12 +21,10 @@ import java.io.InputStream; import org.apache.commons.io.IOUtils; import org.apache.lucene.analysis.TokenStream; -import org.apache.lucene.analysis.util.TokenFilterFactory; +import org.apache.lucene.analysis.util.*; import org.apache.lucene.collation.ICUCollationKeyFilter; -import org.apache.lucene.analysis.util.ResourceLoader; import org.apache.solr.common.SolrException; import org.apache.solr.common.SolrException.ErrorCode; -import org.apache.lucene.analysis.util.ResourceLoaderAware; import com.ibm.icu.text.Collator; import com.ibm.icu.text.RuleBasedCollator; @@ -190,7 +188,7 @@ public class ICUCollationKeyFilterFactory extends TokenFilterFactory implements } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUFoldingFilterFactory.java b/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUFoldingFilterFactory.java index 959836692ab..ad89b94472b 100644 --- a/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUFoldingFilterFactory.java +++ b/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUFoldingFilterFactory.java @@ -2,6 +2,8 @@ package org.apache.solr.analysis; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.icu.ICUFoldingFilter; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.lucene.analysis.util.TokenFilterFactory; /** @@ -29,7 +31,7 @@ public class ICUFoldingFilterFactory extends TokenFilterFactory implements Multi return new ICUFoldingFilter(input); } - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUNormalizer2FilterFactory.java b/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUNormalizer2FilterFactory.java index db06da6189c..93d1ae9c5f4 100644 --- a/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUNormalizer2FilterFactory.java +++ b/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUNormalizer2FilterFactory.java @@ -21,6 +21,8 @@ import java.util.Map; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.icu.ICUNormalizer2Filter; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.solr.common.SolrException; import org.apache.solr.common.SolrException.ErrorCode; import org.apache.lucene.analysis.util.TokenFilterFactory; @@ -80,7 +82,7 @@ public class ICUNormalizer2FilterFactory extends TokenFilterFactory implements M return new ICUNormalizer2Filter(input, normalizer); } - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUTransformFilterFactory.java b/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUTransformFilterFactory.java index 9ae0dec25d0..001750b1050 100644 --- a/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUTransformFilterFactory.java +++ b/solr/contrib/analysis-extras/src/java/org/apache/solr/analysis/ICUTransformFilterFactory.java @@ -21,6 +21,8 @@ import java.util.Map; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.icu.ICUTransformFilter; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.solr.common.SolrException; import org.apache.solr.common.SolrException.ErrorCode; import org.apache.lucene.analysis.util.TokenFilterFactory; @@ -66,7 +68,7 @@ public class ICUTransformFilterFactory extends TokenFilterFactory implements Mul } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/analysis/ASCIIFoldingFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/ASCIIFoldingFilterFactory.java index fff4602b418..0061b25a5a5 100644 --- a/solr/core/src/java/org/apache/solr/analysis/ASCIIFoldingFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/ASCIIFoldingFilterFactory.java @@ -19,6 +19,8 @@ package org.apache.solr.analysis; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.lucene.analysis.util.TokenFilterFactory; import org.apache.lucene.analysis.miscellaneous.ASCIIFoldingFilter; import org.apache.lucene.analysis.TokenStream; @@ -40,7 +42,7 @@ public class ASCIIFoldingFilterFactory extends TokenFilterFactory implements Mul } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/analysis/ArabicNormalizationFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/ArabicNormalizationFilterFactory.java index 0e45602f57b..379289933d6 100644 --- a/solr/core/src/java/org/apache/solr/analysis/ArabicNormalizationFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/ArabicNormalizationFilterFactory.java @@ -18,6 +18,8 @@ package org.apache.solr.analysis; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.ar.ArabicNormalizationFilter; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.lucene.analysis.util.TokenFilterFactory; @@ -39,7 +41,7 @@ public class ArabicNormalizationFilterFactory extends TokenFilterFactory impleme } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/analysis/CJKWidthFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/CJKWidthFilterFactory.java index aaac0f3c562..84f1137db61 100644 --- a/solr/core/src/java/org/apache/solr/analysis/CJKWidthFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/CJKWidthFilterFactory.java @@ -19,6 +19,8 @@ package org.apache.solr.analysis; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.cjk.CJKWidthFilter; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.lucene.analysis.util.TokenFilterFactory; /** @@ -42,7 +44,7 @@ public class CJKWidthFilterFactory extends TokenFilterFactory implements MultiTe } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/analysis/CollationKeyFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/CollationKeyFilterFactory.java index 8d0f4bd8597..8d412a75dd6 100644 --- a/solr/core/src/java/org/apache/solr/analysis/CollationKeyFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/CollationKeyFilterFactory.java @@ -26,11 +26,8 @@ import java.util.Locale; import org.apache.commons.io.IOUtils; import org.apache.lucene.analysis.TokenStream; -import org.apache.lucene.analysis.util.InitializationException; -import org.apache.lucene.analysis.util.TokenFilterFactory; +import org.apache.lucene.analysis.util.*; import org.apache.lucene.collation.CollationKeyFilter; -import org.apache.lucene.analysis.util.ResourceLoader; -import org.apache.lucene.analysis.util.ResourceLoaderAware; /** * Factory for {@link CollationKeyFilter}. @@ -172,7 +169,7 @@ public class CollationKeyFilterFactory extends TokenFilterFactory implements Mul } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/analysis/GermanNormalizationFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/GermanNormalizationFilterFactory.java index 5ff75049522..e344b3b4bbf 100644 --- a/solr/core/src/java/org/apache/solr/analysis/GermanNormalizationFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/GermanNormalizationFilterFactory.java @@ -19,6 +19,8 @@ package org.apache.solr.analysis; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.de.GermanNormalizationFilter; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.lucene.analysis.util.TokenFilterFactory; /** @@ -39,7 +41,7 @@ public class GermanNormalizationFilterFactory extends TokenFilterFactory impleme } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/analysis/GreekLowerCaseFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/GreekLowerCaseFilterFactory.java index acbe87a2e28..f524eae980f 100644 --- a/solr/core/src/java/org/apache/solr/analysis/GreekLowerCaseFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/GreekLowerCaseFilterFactory.java @@ -22,7 +22,9 @@ import java.util.Map; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.el.GreekLowerCaseFilter; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; import org.apache.lucene.analysis.util.InitializationException; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.lucene.analysis.util.TokenFilterFactory; /** @@ -52,7 +54,7 @@ public class GreekLowerCaseFilterFactory extends TokenFilterFactory implements M return new GreekLowerCaseFilter(luceneMatchVersion, in); } - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/analysis/HindiNormalizationFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/HindiNormalizationFilterFactory.java index f2f1f9de194..8d1e1c5bc1f 100644 --- a/solr/core/src/java/org/apache/solr/analysis/HindiNormalizationFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/HindiNormalizationFilterFactory.java @@ -19,6 +19,8 @@ package org.apache.solr.analysis; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.hi.HindiNormalizationFilter; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.lucene.analysis.util.TokenFilterFactory; /** @@ -38,7 +40,7 @@ public class HindiNormalizationFilterFactory extends TokenFilterFactory implemen } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/analysis/IndicNormalizationFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/IndicNormalizationFilterFactory.java index b2eba80d03e..e9cfb150b79 100644 --- a/solr/core/src/java/org/apache/solr/analysis/IndicNormalizationFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/IndicNormalizationFilterFactory.java @@ -19,6 +19,8 @@ package org.apache.solr.analysis; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.in.IndicNormalizationFilter; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.lucene.analysis.util.TokenFilterFactory; /** @@ -38,7 +40,7 @@ public class IndicNormalizationFilterFactory extends TokenFilterFactory implemen } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/analysis/IrishLowerCaseFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/IrishLowerCaseFilterFactory.java index 46f1bd3de39..1028869a1f4 100644 --- a/solr/core/src/java/org/apache/solr/analysis/IrishLowerCaseFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/IrishLowerCaseFilterFactory.java @@ -19,6 +19,8 @@ package org.apache.solr.analysis; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.ga.IrishLowerCaseFilter; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.lucene.analysis.util.TokenFilterFactory; /** @@ -41,7 +43,7 @@ public class IrishLowerCaseFilterFactory extends TokenFilterFactory implements M // this will 'mostly work', except for special cases, just like most other filters @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/analysis/LowerCaseFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/LowerCaseFilterFactory.java index 27d8afe1a19..016149baacc 100644 --- a/solr/core/src/java/org/apache/solr/analysis/LowerCaseFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/LowerCaseFilterFactory.java @@ -21,6 +21,8 @@ import java.util.Map; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.core.LowerCaseFilter; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.lucene.analysis.util.TokenFilterFactory; /** @@ -46,7 +48,7 @@ public class LowerCaseFilterFactory extends TokenFilterFactory implements MultiT } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/analysis/LowerCaseTokenizerFactory.java b/solr/core/src/java/org/apache/solr/analysis/LowerCaseTokenizerFactory.java index 6b620f00e3d..6997a1cc8b6 100644 --- a/solr/core/src/java/org/apache/solr/analysis/LowerCaseTokenizerFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/LowerCaseTokenizerFactory.java @@ -17,8 +17,9 @@ package org.apache.solr.analysis; -import org.apache.lucene.analysis.core.LowerCaseFilter; import org.apache.lucene.analysis.core.LowerCaseTokenizer; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.lucene.analysis.util.TokenizerFactory; import java.io.Reader; @@ -46,7 +47,7 @@ public class LowerCaseTokenizerFactory extends TokenizerFactory implements Multi } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { LowerCaseFilterFactory filt = new LowerCaseFilterFactory(); filt.setLuceneMatchVersion(luceneMatchVersion); filt.init(args); diff --git a/solr/core/src/java/org/apache/solr/analysis/MappingCharFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/MappingCharFilterFactory.java index 35d2f3a7021..346132e0bfe 100644 --- a/solr/core/src/java/org/apache/solr/analysis/MappingCharFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/MappingCharFilterFactory.java @@ -27,11 +27,8 @@ import java.util.regex.Pattern; import org.apache.lucene.analysis.CharStream; import org.apache.lucene.analysis.charfilter.MappingCharFilter; import org.apache.lucene.analysis.charfilter.NormalizeCharMap; -import org.apache.lucene.analysis.util.CharFilterFactory; -import org.apache.lucene.analysis.util.InitializationException; -import org.apache.lucene.analysis.util.ResourceLoader; +import org.apache.lucene.analysis.util.*; import org.apache.solr.common.util.StrUtils; -import org.apache.lucene.analysis.util.ResourceLoaderAware; /** * Factory for {@link MappingCharFilter}. @@ -131,7 +128,7 @@ public class MappingCharFilterFactory extends CharFilterFactory implements } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/analysis/PersianCharFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/PersianCharFilterFactory.java index 9fcd0896ca4..e136992a8a2 100644 --- a/solr/core/src/java/org/apache/solr/analysis/PersianCharFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/PersianCharFilterFactory.java @@ -19,7 +19,9 @@ package org.apache.solr.analysis; import org.apache.lucene.analysis.CharStream; import org.apache.lucene.analysis.fa.PersianCharFilter; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; import org.apache.lucene.analysis.util.CharFilterFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; /** * Factory for {@link PersianCharFilter}. @@ -40,7 +42,7 @@ public class PersianCharFilterFactory extends CharFilterFactory implements Multi } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/analysis/PersianNormalizationFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/PersianNormalizationFilterFactory.java index 81f1860113e..aedc4ccdcbd 100644 --- a/solr/core/src/java/org/apache/solr/analysis/PersianNormalizationFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/PersianNormalizationFilterFactory.java @@ -21,6 +21,8 @@ package org.apache.solr.analysis; import org.apache.lucene.analysis.fa.PersianNormalizationFilter; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.lucene.analysis.util.TokenFilterFactory; /** @@ -41,7 +43,7 @@ public class PersianNormalizationFilterFactory extends TokenFilterFactory implem } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/analysis/TurkishLowerCaseFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/TurkishLowerCaseFilterFactory.java index d540199cb99..6d5e7b46b77 100644 --- a/solr/core/src/java/org/apache/solr/analysis/TurkishLowerCaseFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/analysis/TurkishLowerCaseFilterFactory.java @@ -19,6 +19,8 @@ package org.apache.solr.analysis; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tr.TurkishLowerCaseFilter; +import org.apache.lucene.analysis.util.AbstractAnalysisFactory; +import org.apache.lucene.analysis.util.MultiTermAwareComponent; import org.apache.lucene.analysis.util.TokenFilterFactory; /** @@ -38,7 +40,7 @@ public class TurkishLowerCaseFilterFactory extends TokenFilterFactory implement } @Override - public Object getMultiTermComponent() { + public AbstractAnalysisFactory getMultiTermComponent() { return this; } } diff --git a/solr/core/src/java/org/apache/solr/schema/FieldTypePluginLoader.java b/solr/core/src/java/org/apache/solr/schema/FieldTypePluginLoader.java index f63f6d4cf1a..75bbd83139d 100644 --- a/solr/core/src/java/org/apache/solr/schema/FieldTypePluginLoader.java +++ b/solr/core/src/java/org/apache/solr/schema/FieldTypePluginLoader.java @@ -19,13 +19,9 @@ package org.apache.solr.schema; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.core.KeywordAnalyzer; -import org.apache.lucene.analysis.util.CharFilterFactory; -import org.apache.lucene.analysis.util.TokenFilterFactory; -import org.apache.lucene.analysis.util.TokenizerFactory; +import org.apache.lucene.analysis.util.*; import org.apache.lucene.util.Version; -import org.apache.lucene.analysis.util.ResourceLoader; import org.apache.solr.analysis.KeywordTokenizerFactory; -import org.apache.solr.analysis.MultiTermAwareComponent; import org.apache.solr.analysis.TokenizerChain; import org.apache.solr.common.SolrException; import org.apache.solr.util.DOMUtil; @@ -185,7 +181,7 @@ public final class FieldTypePluginLoader public void add(Object current) { if (!(current instanceof MultiTermAwareComponent)) return; - Object newComponent = ((MultiTermAwareComponent)current).getMultiTermComponent(); + AbstractAnalysisFactory newComponent = ((MultiTermAwareComponent)current).getMultiTermComponent(); if (newComponent instanceof TokenFilterFactory) { if (filters == null) { filters = new ArrayList(2);