LUCENE-8778: Define analyzer SPI names as static final fields and document the names in all analysis components. This also changes SPI loader to detect service names via the static NAME fields instead of class names.

This commit is contained in:
Tomoko Uchida 2019-06-22 10:46:37 +09:00
parent 54cc70127b
commit 98c85a0e1a
159 changed files with 750 additions and 36 deletions

1
.gitignore vendored
View File

@ -28,3 +28,4 @@ pom.xml
.pydevproject
__pycache__
/dev-tools/scripts/scripts.iml

View File

@ -30,6 +30,8 @@ Bug fixes
Other
* LUCENE-8768: Fix Javadocs build in Java 11. (Namgyu Kim)
* LUCENE-8778: Define analyzer SPI names as static final fields and document the names in Javadocs.
(Tomoko Uchida, Uwe Schindler)
======================= Lucene 8.2.0 =======================

View File

@ -33,9 +33,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class ArabicNormalizationFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "arabicNormalization";
/** Creates a new ArabicNormalizationFilterFactory */
public ArabicNormalizationFilterFactory(Map<String,String> args) {
super(args);

View File

@ -34,9 +34,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class ArabicStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "arabicStem";
/** Creates a new ArabicStemFilterFactory */
public ArabicStemFilterFactory(Map<String,String> args) {
super(args);

View File

@ -33,9 +33,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class BulgarianStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "bulgarianStem";
/** Creates a new BulgarianStemFilterFactory */
public BulgarianStemFilterFactory(Map<String,String> args) {
super(args);

View File

@ -32,9 +32,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 7.1.0
* @lucene.spi {@value #NAME}
*/
public class BengaliNormalizationFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "bengaliNormalization";
public BengaliNormalizationFilterFactory(Map<String,String> args) {
super(args);
if (!args.isEmpty()) {

View File

@ -32,9 +32,13 @@ import java.util.Map;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 7.1.0
* @lucene.spi {@value #NAME}
*/
public class BengaliStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "bengaliStem";
public BengaliStemFilterFactory(Map<String,String> args) {
super(args);
if (!args.isEmpty()) {

View File

@ -34,8 +34,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class BrazilianStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "brazilianStem";
/** Creates a new BrazilianStemFilterFactory */
public BrazilianStemFilterFactory(Map<String,String> args) {

View File

@ -35,8 +35,13 @@ import java.util.regex.Pattern;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class HTMLStripCharFilterFactory extends CharFilterFactory {
/** SPI name */
public static final String NAME = "htmlStrip";
final Set<String> escapedTags;
static final Pattern TAG_NAME_PATTERN = Pattern.compile("[^\\s,]+");

View File

@ -40,10 +40,14 @@ import org.apache.lucene.analysis.util.ResourceLoaderAware;
* &lt;/fieldType&gt;</pre>
*
* @since Solr 1.4
* @lucene.spi {@value #NAME}
*/
public class MappingCharFilterFactory extends CharFilterFactory implements
ResourceLoaderAware {
/** SPI name */
public static final String NAME = "mapping";
protected NormalizeCharMap normMap;
private final String mapping;

View File

@ -36,8 +36,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.6.0
* @lucene.spi {@value #NAME}
*/
public class CJKBigramFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "cjkBigram";
final int flags;
final boolean outputUnigrams;

View File

@ -34,8 +34,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.6.0
* @lucene.spi {@value #NAME}
*/
public class CJKWidthFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "cjkWidth";
/** Creates a new CJKWidthFilterFactory */
public CJKWidthFilterFactory(Map<String,String> args) {

View File

@ -32,9 +32,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 4.7.0
* @lucene.spi {@value #NAME}
*/
public class SoraniNormalizationFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "soraniNormalization";
/** Creates a new SoraniNormalizationFilterFactory */
public SoraniNormalizationFilterFactory(Map<String,String> args) {
super(args);

View File

@ -33,9 +33,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 4.7.0
* @lucene.spi {@value #NAME}
*/
public class SoraniStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "soraniStem";
/** Creates a new SoraniStemFilterFactory */
public SoraniStemFilterFactory(Map<String,String> args) {
super(args);

View File

@ -39,9 +39,14 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class CommonGramsFilterFactory extends TokenFilterFactory implements ResourceLoaderAware {
// TODO: shared base class for Stop/Keep/CommonGrams?
/** SPI name */
public static final String NAME = "commonGrams";
// TODO: shared base class for Stop/Keep/CommonGrams?
private CharArraySet commonWords;
private final String commonWordFiles;
private final String format;

View File

@ -34,9 +34,12 @@ import org.apache.lucene.analysis.TokenStream;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class CommonGramsQueryFilterFactory extends CommonGramsFilterFactory {
public static final String NAME = "commonGramsQuery";
/** Creates a new CommonGramsQueryFilterFactory */
public CommonGramsQueryFilterFactory(Map<String,String> args) {
super(args);

View File

@ -38,8 +38,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class DictionaryCompoundWordTokenFilterFactory extends TokenFilterFactory implements ResourceLoaderAware {
/** SPI name */
public static final String NAME = "dictionaryCompoundWord";
private CharArraySet dictionary;
private final String dictFile;
private final int minWordSize;

View File

@ -58,8 +58,13 @@ import org.xml.sax.InputSource;
*
* @see HyphenationCompoundWordTokenFilter
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class HyphenationCompoundWordTokenFilterFactory extends TokenFilterFactory implements ResourceLoaderAware {
/** SPI name */
public static final String NAME = "hyphenationCompoundWord";
private CharArraySet dictionary;
private HyphenationTree hyphenator;
private final String dictFile;

View File

@ -32,8 +32,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 5.4.0
* @lucene.spi {@value #NAME}
*/
public class DecimalDigitFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "decimalDigit";
/** Creates a new DecimalDigitFilterFactory */
public DecimalDigitFilterFactory(Map<String,String> args) {

View File

@ -27,9 +27,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
*
* @lucene.experimental
* @since 6.4.0
* @lucene.spi {@value #NAME}
*/
public class FlattenGraphFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "flattenGraph";
/** Creates a new FlattenGraphFilterFactory */
public FlattenGraphFilterFactory(Map<String,String> args) {
super(args);

View File

@ -40,8 +40,13 @@ import static org.apache.lucene.analysis.standard.StandardTokenizer.MAX_TOKEN_LE
* </ul>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class KeywordTokenizerFactory extends TokenizerFactory {
/** SPI name */
public static final String NAME = "keyword";
private final int maxTokenLen;
/** Creates a new KeywordTokenizerFactory */

View File

@ -42,8 +42,13 @@ import static org.apache.lucene.analysis.standard.StandardTokenizer.MAX_TOKEN_LE
* </ul>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class LetterTokenizerFactory extends TokenizerFactory {
/** SPI name */
public static final String NAME = "letter";
private final int maxTokenLen;
/** Creates a new LetterTokenizerFactory */

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class LowerCaseFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "lowercase";
/** Creates a new LowerCaseFilterFactory */
public LowerCaseFilterFactory(Map<String,String> args) {

View File

@ -71,8 +71,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* </ul>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class StopFilterFactory extends TokenFilterFactory implements ResourceLoaderAware {
/** SPI name */
public static final String NAME = "stop";
public static final String FORMAT_WORDSET = "wordset";
public static final String FORMAT_SNOWBALL = "snowball";

View File

@ -39,8 +39,13 @@ import java.util.Set;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.6.0
* @lucene.spi {@value #NAME}
*/
public class TypeTokenFilterFactory extends TokenFilterFactory implements ResourceLoaderAware {
/** SPI name */
public static final String NAME = "type";
private final boolean useWhitelist;
private final String stopTypesFiles;
private Set<String> stopTypes;

View File

@ -37,8 +37,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* when you require uppercase tokens. Use the {@link LowerCaseFilterFactory} for
* general search matching
* @since 4.7.0
* @lucene.spi {@value #NAME}
*/
public class UpperCaseFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "uppercase";
/** Creates a new UpperCaseFilterFactory */
public UpperCaseFilterFactory(Map<String,String> args) {

View File

@ -47,8 +47,13 @@ import static org.apache.lucene.analysis.standard.StandardTokenizer.MAX_TOKEN_LE
* </ul>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class WhitespaceTokenizerFactory extends TokenizerFactory {
/** SPI name */
public static final String NAME = "whitespace";
public static final String RULE_JAVA = "java";
public static final String RULE_UNICODE = "unicode";
private static final Collection<String> RULE_NAMES = Arrays.asList(RULE_JAVA, RULE_UNICODE);

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class CzechStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "czechStem";
/** Creates a new CzechStemFilterFactory */
public CzechStemFilterFactory(Map<String,String> args) {

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class GermanLightStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "germanLightStem";
/** Creates a new GermanLightStemFilterFactory */
public GermanLightStemFilterFactory(Map<String,String> args) {

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class GermanMinimalStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "germanMinimalStem";
/** Creates a new GermanMinimalStemFilterFactory */
public GermanMinimalStemFilterFactory(Map<String,String> args) {

View File

@ -33,9 +33,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.6.0
* @lucene.spi {@value #NAME}
*/
public class GermanNormalizationFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "germanNormalization";
/** Creates a new GermanNormalizationFilterFactory */
public GermanNormalizationFilterFactory(Map<String,String> args) {
super(args);

View File

@ -34,8 +34,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class GermanStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "germanStem";
/** Creates a new GermanStemFilterFactory */
public GermanStemFilterFactory(Map<String,String> args) {

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class GreekLowerCaseFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "greekLowerCase";
/** Creates a new GreekLowerCaseFilterFactory */
public GreekLowerCaseFilterFactory(Map<String,String> args) {

View File

@ -33,9 +33,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class GreekStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "greekStem";
/** Creates a new GreekStemFilterFactory */
public GreekStemFilterFactory(Map<String,String> args) {
super(args);

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class EnglishMinimalStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "englishMinimalStem";
/** Creates a new EnglishMinimalStemFilterFactory */
public EnglishMinimalStemFilterFactory(Map<String,String> args) {

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class EnglishPossessiveFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "englishPossessive";
/** Creates a new EnglishPossessiveFilterFactory */
public EnglishPossessiveFilterFactory(Map<String,String> args) {

View File

@ -34,9 +34,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.3.0
* @lucene.spi {@value #NAME}
*/
public class KStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "kStem";
/** Creates a new KStemFilterFactory */
public KStemFilterFactory(Map<String,String> args) {
super(args);

View File

@ -34,8 +34,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class PorterStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "porterStem";
/** Creates a new PorterStemFilterFactory */
public PorterStemFilterFactory(Map<String,String> args) {

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class SpanishLightStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "spanishLightStem";
/** Creates a new SpanishLightStemFilterFactory */
public SpanishLightStemFilterFactory(Map<String,String> args) {

View File

@ -33,9 +33,13 @@ import org.apache.lucene.analysis.util.CharFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class PersianCharFilterFactory extends CharFilterFactory {
/** SPI name */
public static final String NAME = "persian";
/** Creates a new PersianCharFilterFactory */
public PersianCharFilterFactory(Map<String,String> args) {
super(args);

View File

@ -34,8 +34,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class PersianNormalizationFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "persianNormalization";
/** Creates a new PersianNormalizationFilterFactory */
public PersianNormalizationFilterFactory(Map<String,String> args) {

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class FinnishLightStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "finnishLightStem";
/** Creates a new FinnishLightStemFilterFactory */
public FinnishLightStemFilterFactory(Map<String,String> args) {

View File

@ -34,8 +34,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class FrenchLightStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "frenchLightStem";
/** Creates a new FrenchLightStemFilterFactory */
public FrenchLightStemFilterFactory(Map<String,String> args) {

View File

@ -34,8 +34,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class FrenchMinimalStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "frenchMinimalStem";
/** Creates a new FrenchMinimalStemFilterFactory */
public FrenchMinimalStemFilterFactory(Map<String,String> args) {

View File

@ -32,9 +32,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.6.0
* @lucene.spi {@value #NAME}
*/
public class IrishLowerCaseFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "irishLowerCase";
/** Creates a new IrishLowerCaseFilterFactory */
public IrishLowerCaseFilterFactory(Map<String,String> args) {
super(args);

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.6.0
* @lucene.spi {@value #NAME}
*/
public class GalicianMinimalStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "galicianMinimalStem";
/** Creates a new GalicianMinimalStemFilterFactory */
public GalicianMinimalStemFilterFactory(Map<String,String> args) {

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class GalicianStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "galicianStem";
/** Creates a new GalicianStemFilterFactory */
public GalicianStemFilterFactory(Map<String,String> args) {

View File

@ -32,8 +32,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class HindiNormalizationFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "hindiNormalization";
/** Creates a new HindiNormalizationFilterFactory */
public HindiNormalizationFilterFactory(Map<String,String> args) {

View File

@ -32,8 +32,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class HindiStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "hindiStem";
/** Creates a new HindiStemFilterFactory */
public HindiStemFilterFactory(Map<String,String> args) {

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class HungarianLightStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "hungarianLightStem";
/** Creates a new HungarianLightStemFilterFactory */
public HungarianLightStemFilterFactory(Map<String,String> args) {

View File

@ -49,8 +49,13 @@ import org.apache.lucene.util.IOUtils;
* See <a href="http://wiki.apache.org/solr/Hunspell">http://wiki.apache.org/solr/Hunspell</a>
* @lucene.experimental
* @since 3.5.0
* @lucene.spi {@value #NAME}
*/
public class HunspellStemFilterFactory extends TokenFilterFactory implements ResourceLoaderAware {
/** SPI name */
public static final String NAME = "hunspellStem";
private static final String PARAM_DICTIONARY = "dictionary";
private static final String PARAM_AFFIX = "affix";
// NOTE: this one is currently unused?:

View File

@ -33,8 +33,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class IndonesianStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "indonesianStem";
private final boolean stemDerivational;
/** Creates a new IndonesianStemFilterFactory */

View File

@ -32,8 +32,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class IndicNormalizationFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "indicNormalization";
/** Creates a new IndicNormalizationFilterFactory */
public IndicNormalizationFilterFactory(Map<String,String> args) {

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class ItalianLightStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "italianLightStem";
/** Creates a new ItalianLightStemFilterFactory */
public ItalianLightStemFilterFactory(Map<String,String> args) {

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.2.0
* @lucene.spi {@value #NAME}
*/
public class LatvianStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "latvianStem";
/** Creates a new LatvianStemFilterFactory */
public LatvianStemFilterFactory(Map<String,String> args) {

View File

@ -25,8 +25,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
/**
* {@link TokenFilterFactory} for {@link MinHashFilter}.
* @since 6.2.0
* @lucene.spi {@value #NAME}
*/
public class MinHashFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "minHash";
private int hashCount = MinHashFilter.DEFAULT_HASH_COUNT;
private int bucketCount = MinHashFilter.DEFAULT_BUCKET_COUNT;

View File

@ -33,8 +33,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class ASCIIFoldingFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "asciiFolding";
private static final String PRESERVE_ORIGINAL = "preserveOriginal";
private final boolean preserveOriginal;

View File

@ -56,8 +56,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since solr 1.3
* @lucene.spi {@value #NAME}
*/
public class CapitalizationFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "capitalization";
public static final String KEEP = "keep";
public static final String KEEP_IGNORE_CASE = "keepIgnoreCase";
public static final String OK_PREFIX = "okPrefix";

View File

@ -32,8 +32,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 4.5.1
* @lucene.spi {@value #NAME}
*/
public class CodepointCountFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "codepointCount";
final int min;
final int max;
public static final String MIN_KEY = "min";

View File

@ -44,9 +44,13 @@ import org.apache.lucene.util.automaton.TooComplexToDeterminizeException;
* </ul>
* @see ConcatenateGraphFilter
* @since 7.4.0
* @lucene.spi {@value #NAME}
*/
public class ConcatenateGraphFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "concatenateGraph";
private boolean preserveSep;
private boolean preservePositionIncrements;
private int maxGraphExpansions;

View File

@ -32,9 +32,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* Abstract parent class for analysis factories that create {@link ConditionalTokenFilter} instances
*
* @since 7.4.0
* @lucene.spi {@value #NAME}
*/
public abstract class ConditionalTokenFilterFactory extends TokenFilterFactory implements ResourceLoaderAware {
/** SPI name */
public static final String NAME = "conditional";
private List<TokenFilterFactory> innerFilters;
protected ConditionalTokenFilterFactory(Map<String, String> args) {

View File

@ -42,9 +42,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* format of the system. The {@code locale} is optional and if omitted the filter will be created with
* {@link Locale#ENGLISH}.
* @since 5.5.0
* @lucene.spi {@value #NAME}
*/
public class DateRecognizerFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "dateRecognizer";
public static final String DATE_PATTERN = "datePattern";
public static final String LOCALE = "locale";

View File

@ -32,8 +32,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 7.0.0
* @lucene.spi {@value #NAME}
*/
public class DelimitedTermFrequencyTokenFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "delimitedTermFrequency";
public static final String DELIMITER_ATTR = "delimiter";
private final char delimiter;

View File

@ -32,9 +32,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* {@link FingerprintFilter} for an explanation of its use.
* </pre>
* @since 5.4.0
* @lucene.spi {@value #NAME}
*/
public class FingerprintFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "fingerprint";
public static final String MAX_OUTPUT_TOKEN_SIZE_KEY = "maxOutputTokenSize";
public static final String SEPARATOR_KEY = "separator";
final int maxOutputTokenSize;

View File

@ -25,9 +25,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
/**
* Factory for {@link FixBrokenOffsetsFilter}.
* @since 7.0.0
* @lucene.spi {@value #NAME}
*/
public class FixBrokenOffsetsFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "fixBrokenOffsets";
/** Sole constructor */
public FixBrokenOffsetsFilterFactory(Map<String,String> args) {
super(args);

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class HyphenatedWordsFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "hyphenatedWords";
/** Creates a new HyphenatedWordsFilterFactory */
public HyphenatedWordsFilterFactory(Map<String,String> args) {

View File

@ -37,8 +37,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class KeepWordFilterFactory extends TokenFilterFactory implements ResourceLoaderAware {
/** SPI name */
public static final String NAME = "keepWord";
private final boolean ignoreCase;
private final String wordFiles;
private CharArraySet words;

View File

@ -37,8 +37,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class KeywordMarkerFilterFactory extends TokenFilterFactory implements ResourceLoaderAware {
/** SPI name */
public static final String NAME = "keywordMarker";
public static final String PROTECTED_TOKENS = "protected";
public static final String PATTERN = "pattern";
private final String wordFiles;

View File

@ -29,8 +29,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* later in the analysis chain will be in the document twice. Therefore, consider adding
* {@link RemoveDuplicatesTokenFilterFactory} later in the analysis chain.
* @since 4.3.0
* @lucene.spi {@value #NAME}
*/
public final class KeywordRepeatFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "keywordRepeat";
/** Creates a new KeywordRepeatFilterFactory */
public KeywordRepeatFilterFactory(Map<String,String> args) {

View File

@ -33,8 +33,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class LengthFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "length";
final int min;
final int max;
public static final String MIN_KEY = "min";

View File

@ -35,9 +35,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* The {@code consumeAllTokens} property is optional and defaults to {@code false}.
* See {@link LimitTokenCountFilter} for an explanation of its use.
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class LimitTokenCountFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "limitTokenCount";
public static final String MAX_TOKEN_COUNT_KEY = "maxTokenCount";
public static final String CONSUME_ALL_TOKENS_KEY = "consumeAllTokens";
final int maxTokenCount;

View File

@ -34,9 +34,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* <p>
* The {@code consumeAllTokens} property is optional and defaults to {@code false}.
* @since 5.2.0
* @lucene.spi {@value #NAME}
*/
public class LimitTokenOffsetFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "limitTokenOffset";
public static final String MAX_START_OFFSET = "maxStartOffset";
public static final String CONSUME_ALL_TOKENS_KEY = "consumeAllTokens";

View File

@ -34,9 +34,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* The {@code consumeAllTokens} property is optional and defaults to {@code false}.
* See {@link LimitTokenPositionFilter} for an explanation of its use.
* @since 4.3.0
* @lucene.spi {@value #NAME}
*/
public class LimitTokenPositionFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "limitTokenPosition";
public static final String MAX_TOKEN_POSITION_KEY = "maxTokenPosition";
public static final String CONSUME_ALL_TOKENS_KEY = "consumeAllTokens";
final int maxTokenPosition;

View File

@ -77,9 +77,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* <p>See related {@link org.apache.lucene.analysis.custom.CustomAnalyzer.Builder#whenTerm(Predicate)}
*
* @since 7.4.0
* @lucene.spi {@value #NAME}
*/
public class ProtectedTermFilterFactory extends ConditionalTokenFilterFactory implements ResourceLoaderAware {
public static final String NAME = "protectedTerm";
public static final String PROTECTED_TERMS = "protected";
public static final char FILTER_ARG_SEPARATOR = '.';
public static final char FILTER_NAME_ID_SEPARATOR = '-';

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class RemoveDuplicatesTokenFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "removeDuplicates";
/** Creates a new RemoveDuplicatesTokenFilterFactory */
public RemoveDuplicatesTokenFilterFactory(Map<String,String> args) {

View File

@ -32,9 +32,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 4.4.0
* @lucene.spi {@value #NAME}
*/
public class ScandinavianFoldingFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "scandinavianFolding";
public ScandinavianFoldingFilterFactory(Map<String,String> args) {
super(args);
if (!args.isEmpty()) {

View File

@ -32,9 +32,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 4.4.0
* @lucene.spi {@value #NAME}
*/
public class ScandinavianNormalizationFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "scandinavianNormalization";
public ScandinavianNormalizationFilterFactory(Map<String, String> args) {
super(args);
if (!args.isEmpty()) {

View File

@ -37,8 +37,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.1.0
* @lucene.spi {@value #NAME}
*/
public class StemmerOverrideFilterFactory extends TokenFilterFactory implements ResourceLoaderAware {
/** SPI name */
public static final String NAME = "stemmerOverride";
private StemmerOverrideMap dictionary;
private final String dictionaryFiles;
private final boolean ignoreCase;

View File

@ -35,8 +35,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* @see TrimFilter
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class TrimFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "trim";
/** Creates a new TrimFilterFactory */
public TrimFilterFactory(Map<String,String> args) {

View File

@ -37,9 +37,13 @@ import java.util.Map;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 4.8.0
* @lucene.spi {@value #NAME}
*/
public class TruncateTokenFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "truncate";
public static final String PREFIX_LENGTH_KEY = "prefixLength";
private final byte prefixLength;

View File

@ -38,8 +38,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* the emitted synonym will have text "_type_&lt;URL&gt;".
*
* @since 7.3.0
* @lucene.spi {@value #NAME}
*/
public class TypeAsSynonymFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "typeAsSynonym";
private final String prefix;
public TypeAsSynonymFilterFactory(Map<String,String> args) {

View File

@ -54,9 +54,14 @@ import static org.apache.lucene.analysis.miscellaneous.WordDelimiterFilter.*;
* the search time analyzer.
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
@Deprecated
public class WordDelimiterFilterFactory extends TokenFilterFactory implements ResourceLoaderAware {
/** SPI name */
public static final String NAME = "wordDelimiter";
public static final String PROTECTED_TOKENS = "protected";
public static final String TYPES = "types";

View File

@ -49,8 +49,13 @@ import static org.apache.lucene.analysis.miscellaneous.WordDelimiterIterator.*;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 6.5.0
* @lucene.spi {@value #NAME}
*/
public class WordDelimiterGraphFilterFactory extends TokenFilterFactory implements ResourceLoaderAware {
/** SPI name */
public static final String NAME = "wordDelimiterGraph";
public static final String PROTECTED_TOKENS = "protected";
public static final String TYPES = "types";
public static final String OFFSETS = "adjustOffsets";

View File

@ -34,8 +34,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class EdgeNGramFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "edgeNGram";
private final int maxGramSize;
private final int minGramSize;
private final boolean preserveOriginal;

View File

@ -33,8 +33,13 @@ import java.util.Map;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class EdgeNGramTokenizerFactory extends TokenizerFactory {
/** SPI name */
public static final String NAME = "edgeNGram";
private final int maxGramSize;
private final int minGramSize;

View File

@ -34,8 +34,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class NGramFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "nGram";
private final int maxGramSize;
private final int minGramSize;
private final boolean preserveOriginal;

View File

@ -35,8 +35,13 @@ import java.util.Map;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class NGramTokenizerFactory extends TokenizerFactory {
/** SPI name */
public static final String NAME = "nGram";
private final int maxGramSize;
private final int minGramSize;

View File

@ -36,8 +36,12 @@ import static org.apache.lucene.analysis.no.NorwegianLightStemmer.NYNORSK;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.6.0
* @lucene.spi {@value #NAME}
*/
public class NorwegianLightStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "norwegianLightStem";
private final int flags;

View File

@ -36,8 +36,12 @@ import static org.apache.lucene.analysis.no.NorwegianLightStemmer.NYNORSK;
* &lt;/analyzer&gt;
* &lt;/fieldType&gt;</pre>
* @since 3.6.0
* @lucene.spi {@value #NAME}
*/
public class NorwegianMinimalStemFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "norwegianMinimalStem";
private final int flags;

View File

@ -68,8 +68,13 @@ import org.apache.lucene.util.AttributeFactory;
* </pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class PathHierarchyTokenizerFactory extends TokenizerFactory {
/** SPI name */
public static final String NAME = "pathHierarchy";
private final char delimiter;
private final char replacement;
private final boolean reverse;

View File

@ -35,8 +35,13 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
*
* @see PatternCaptureGroupTokenFilter
* @since 4.4.0
* @lucene.spi {@value #NAME}
*/
public class PatternCaptureGroupFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "patternCaptureGroup";
private Pattern pattern;
private boolean preserveOriginal = true;

View File

@ -35,8 +35,13 @@ import org.apache.lucene.analysis.util.CharFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since Solr 3.1
* @lucene.spi {@value #NAME}
*/
public class PatternReplaceCharFilterFactory extends CharFilterFactory {
/** SPI name */
public static final String NAME = "patternReplace";
private final Pattern pattern;
private final String replacement;

View File

@ -38,8 +38,13 @@ import java.util.regex.Pattern;
* @see PatternReplaceFilter
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class PatternReplaceFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "patternReplace";
final Pattern pattern;
final String replacement;
final boolean replaceAll;

View File

@ -57,8 +57,13 @@ import org.apache.lucene.util.AttributeFactory;
*
* @see PatternTokenizer
* @since solr1.2
* @lucene.spi {@value #NAME}
*/
public class PatternTokenizerFactory extends TokenizerFactory {
/** SPI name */
public static final String NAME = "pattern";
public static final String PATTERN = "pattern";
public static final String GROUP = "group";

View File

@ -55,8 +55,13 @@ import org.apache.lucene.util.automaton.RegExp;
* @see SimplePatternSplitTokenizer
*
* @since 6.5.0
* @lucene.spi {@value #NAME}
*/
public class SimplePatternSplitTokenizerFactory extends TokenizerFactory {
/** SPI name */
public static final String NAME = "simplePatternSplit";
public static final String PATTERN = "pattern";
private final Automaton dfa;
private final int maxDeterminizedStates;

View File

@ -55,8 +55,13 @@ import org.apache.lucene.util.automaton.RegExp;
* @see SimplePatternTokenizer
*
* @since 6.5.0
* @lucene.spi {@value #NAME}
*/
public class SimplePatternTokenizerFactory extends TokenizerFactory {
/** SPI name */
public static final String NAME = "simplePattern";
public static final String PATTERN = "pattern";
private final Automaton dfa;
private final int maxDeterminizedStates;

View File

@ -35,8 +35,13 @@ import java.util.Map;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class DelimitedPayloadTokenFilterFactory extends TokenFilterFactory implements ResourceLoaderAware {
/** SPI name */
public static final String NAME = "delimitedPayload";
public static final String ENCODER_ATTR = "encoder";
public static final String DELIMITER_ATTR = "delimiter";

View File

@ -32,8 +32,13 @@ import java.util.Map;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class NumericPayloadTokenFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "numericPayload";
private final float payload;
private final String typeMatch;

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class TokenOffsetPayloadTokenFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "tokenOffsetPayload";
/** Creates a new TokenOffsetPayloadTokenFilterFactory */
public TokenOffsetPayloadTokenFilterFactory(Map<String,String> args) {

View File

@ -33,8 +33,12 @@ import org.apache.lucene.analysis.util.TokenFilterFactory;
* &lt;/fieldType&gt;</pre>
*
* @since 3.1
* @lucene.spi {@value #NAME}
*/
public class TypeAsPayloadTokenFilterFactory extends TokenFilterFactory {
/** SPI name */
public static final String NAME = "typeAsPayload";
/** Creates a new TypeAsPayloadTokenFilterFactory */
public TypeAsPayloadTokenFilterFactory(Map<String,String> args) {

Some files were not shown because too many files have changed in this diff Show More