Java Code Examples for org.apache.lucene.util.Version#onOrAfter()
The following examples show how to use
org.apache.lucene.util.Version#onOrAfter() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConcatenateGraphFilterFactory.java From lucene-solr with Apache License 2.0 | 6 votes |
public ConcatenateGraphFilterFactory(Map<String, String> args) { super(args); Version luceneMatchVersion = getLuceneMatchVersion(); @SuppressWarnings("deprecation") Version LUCENE_8_4_0 = Version.LUCENE_8_4_0; if (luceneMatchVersion.onOrAfter(LUCENE_8_4_0)) { tokenSeparator = getCharacter(args, "tokenSeparator", ConcatenateGraphFilter.DEFAULT_TOKEN_SEPARATOR); } else { boolean preserveSep = getBoolean(args, "preserveSep", ConcatenateGraphFilter.DEFAULT_PRESERVE_SEP); tokenSeparator = (preserveSep) ? ConcatenateGraphFilter.DEFAULT_TOKEN_SEPARATOR : null; } preservePositionIncrements = getBoolean(args, "preservePositionIncrements", ConcatenateGraphFilter.DEFAULT_PRESERVE_POSITION_INCREMENTS); maxGraphExpansions = getInt(args, "maxGraphExpansions", ConcatenateGraphFilter.DEFAULT_MAX_GRAPH_EXPANSIONS); if (!args.isEmpty()) { throw new IllegalArgumentException("Unknown parameters: " + args); } }
Example 2
Source File: SlowCompositeReaderWrapper.java From lucene-solr with Apache License 2.0 | 6 votes |
SlowCompositeReaderWrapper(CompositeReader reader) throws IOException { in = reader; in.registerParentReader(this); if (reader.leaves().isEmpty()) { metaData = new LeafMetaData(Version.LATEST.major, Version.LATEST, null); } else { Version minVersion = Version.LATEST; for (LeafReaderContext leafReaderContext : reader.leaves()) { Version leafVersion = leafReaderContext.reader().getMetaData().getMinVersion(); if (leafVersion == null) { minVersion = null; break; } else if (minVersion.onOrAfter(leafVersion)) { minVersion = leafVersion; } } metaData = new LeafMetaData(reader.leaves().get(0).reader().getMetaData().getCreatedVersionMajor(), minVersion, null); } fieldInfos = FieldInfos.getMergedFieldInfos(in); }
Example 3
Source File: NGramTokenFilterFactory.java From Elasticsearch with Apache License 2.0 | 5 votes |
@SuppressWarnings("deprecation") @Override public TokenStream create(TokenStream tokenStream) { final Version version = this.version == Version.LUCENE_4_3 ? Version.LUCENE_4_4 : this.version; // we supported it since 4.3 if (version.onOrAfter(Version.LUCENE_4_3)) { return new NGramTokenFilter(tokenStream, minGram, maxGram); } else { return new Lucene43NGramTokenFilter(tokenStream, minGram, maxGram); } }
Example 4
Source File: FieldTypePluginLoader.java From lucene-solr with Apache License 2.0 | 5 votes |
private Version parseConfiguredVersion(String configuredVersion, String pluginClassName) { Version version = (configuredVersion != null) ? SolrConfig.parseLuceneVersionString(configuredVersion) : schema.getDefaultLuceneMatchVersion(); if (!version.onOrAfter(Version.LUCENE_8_0_0)) { log.warn("{} is using deprecated {}" + " emulation. You should at some point declare and reindex to at least 8.0, because " + "7.x emulation is deprecated and will be removed in 9.0" , pluginClassName , version); } return version; }
Example 5
Source File: ClassicTokenizer.java From projectforge-webapp with GNU General Public License v3.0 | 5 votes |
private final void init(final Reader input, final Version matchVersion) { this.scanner = new ClassicTokenizerImpl(input); if (matchVersion.onOrAfter(Version.LUCENE_24)) { replaceInvalidAcronym = true; } else { replaceInvalidAcronym = false; } this.input = input; }
Example 6
Source File: StandardTokenizer.java From projectforge-webapp with GNU General Public License v3.0 | 5 votes |
private final void init(final Reader input, final Version matchVersion) { //this.scanner = matchVersion.onOrAfter(Version.LUCENE_31) ? new StandardTokenizerImpl(input) : new ClassicTokenizerImpl(input); this.scanner = new StandardTokenizerImpl(input); if (matchVersion.onOrAfter(Version.LUCENE_24)) { replaceInvalidAcronym = true; } else { replaceInvalidAcronym = false; } this.input = input; }
Example 7
Source File: ClassicAnalyzer.java From projectforge-webapp with GNU General Public License v3.0 | 4 votes |
/** Builds an analyzer with the given stop words. * @param matchVersion Lucene version to match See {@link * <a href="#version">above</a>} * @param stopWords stop words */ public ClassicAnalyzer(final Version matchVersion, final Set<?> stopWords) { super(matchVersion, stopWords); replaceInvalidAcronym = matchVersion.onOrAfter(Version.LUCENE_24); }
Example 8
Source File: StandardAnalyzer.java From projectforge-webapp with GNU General Public License v3.0 | 4 votes |
/** Builds an analyzer with the given stop words. * @param matchVersion Lucene version to match See {@link * <a href="#version">above</a>} * @param stopWords stop words */ public StandardAnalyzer(final Version matchVersion, final Set<?> stopWords) { super(matchVersion, stopWords); replaceInvalidAcronym = matchVersion.onOrAfter(Version.LUCENE_24); }