lux.index.analysis
Class WhitespaceGapAnalyzer

java.lang.Object
  extended by org.apache.lucene.analysis.Analyzer
      extended by lux.index.analysis.WhitespaceGapAnalyzer
All Implemented Interfaces:
Closeable

public final class WhitespaceGapAnalyzer
extends org.apache.lucene.analysis.Analyzer

An Analyzer that uses WhitespaceTokenizer, and inserts position gaps of 100 between multiple values to inhibit phrase and span matches across values.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.Analyzer.GlobalReuseStrategy, org.apache.lucene.analysis.Analyzer.PerFieldReuseStrategy, org.apache.lucene.analysis.Analyzer.ReuseStrategy, org.apache.lucene.analysis.Analyzer.TokenStreamComponents
 
Constructor Summary
WhitespaceGapAnalyzer()
           
 
Method Summary
protected  org.apache.lucene.analysis.Analyzer.TokenStreamComponents createComponents(String fieldName, Reader reader)
           
 int getPositionIncrementGap(String field)
           
 
Methods inherited from class org.apache.lucene.analysis.Analyzer
close, getOffsetGap, initReader, tokenStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WhitespaceGapAnalyzer

public WhitespaceGapAnalyzer()
Method Detail

createComponents

protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents createComponents(String fieldName,
                                                                                     Reader reader)
Specified by:
createComponents in class org.apache.lucene.analysis.Analyzer

getPositionIncrementGap

public int getPositionIncrementGap(String field)
Overrides:
getPositionIncrementGap in class org.apache.lucene.analysis.Analyzer
Returns:
100 - note this is tied to Surround QueryParser's maximum distance of 99.


Copyright © 2013. All Rights Reserved.