List of usage examples for org.apache.lucene.analysis.shingle ShingleFilter DEFAULT_MIN_SHINGLE_SIZE
int DEFAULT_MIN_SHINGLE_SIZE
To view the source code for org.apache.lucene.analysis.shingle ShingleFilter DEFAULT_MIN_SHINGLE_SIZE.
Click Source Link
From source file:org.apache.solr.analysis.ShingleFilterFactory.java
License:Apache License
@Override public void init(Map<String, String> args) { super.init(args); maxShingleSize = getInt("maxShingleSize", ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE); if (maxShingleSize < 2) { throw new SolrException(ErrorCode.SERVER_ERROR, "Invalid maxShingleSize (" + maxShingleSize + ") - must be at least 2"); }// w ww . j av a 2 s . co m minShingleSize = getInt("minShingleSize", ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE); if (minShingleSize < 2) { throw new SolrException(ErrorCode.SERVER_ERROR, "Invalid minShingleSize (" + minShingleSize + ") - must be at least 2"); } if (minShingleSize > maxShingleSize) { throw new SolrException(ErrorCode.SERVER_ERROR, "Invalid minShingleSize (" + minShingleSize + ") - must be no greater than maxShingleSize (" + maxShingleSize + ")"); } outputUnigrams = getBoolean("outputUnigrams", true); outputUnigramsIfNoShingles = getBoolean("outputUnigramsIfNoShingles", false); tokenSeparator = args.containsKey("tokenSeparator") ? args.get("tokenSeparator") : ShingleFilter.TOKEN_SEPARATOR; }
From source file:org.elasticsearch.index.analysis.ShingleTokenFilterFactory.java
License:Apache License
@Inject public ShingleTokenFilterFactory(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {/*from w ww. j a v a 2 s .c o m*/ super(index, indexSettings, name, settings); Integer maxShingleSize = settings.getAsInt("max_shingle_size", ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE); Integer minShingleSize = settings.getAsInt("min_shingle_size", ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE); Boolean outputUnigrams = settings.getAsBoolean("output_unigrams", true); Boolean outputUnigramsIfNoShingles = settings.getAsBoolean("output_unigrams_if_no_shingles", false); String tokenSeparator = settings.get("token_separator", ShingleFilter.DEFAULT_TOKEN_SEPARATOR); String fillerToken = settings.get("filler_token", ShingleFilter.DEFAULT_FILLER_TOKEN); factory = new Factory("shingle", minShingleSize, maxShingleSize, outputUnigrams, outputUnigramsIfNoShingles, tokenSeparator, fillerToken); }