Package org.apache.lucene.search
Class TokenStreamToTermAutomatonQuery
- java.lang.Object
-
- org.apache.lucene.search.TokenStreamToTermAutomatonQuery
-
public class TokenStreamToTermAutomatonQuery extends java.lang.Object
Consumes a TokenStream and creates anTermAutomatonQuery
where the transition labels are tokens from theTermToBytesRefAttribute
.This code is very new and likely has exciting bugs!
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
preservePositionIncrements
-
Constructor Summary
Constructors Constructor Description TokenStreamToTermAutomatonQuery()
Sole constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setPreservePositionIncrements(boolean enablePositionIncrements)
Whether to generate holes in the automaton for missing positions,true
by default.TermAutomatonQuery
toQuery(java.lang.String field, TokenStream in)
Pulls the graph (includingPositionLengthAttribute
) from the providedTokenStream
, and creates the corresponding automaton where arcs are bytes (or Unicode code points if unicodeArcs = true) from each term.
-
-
-
Method Detail
-
setPreservePositionIncrements
public void setPreservePositionIncrements(boolean enablePositionIncrements)
Whether to generate holes in the automaton for missing positions,true
by default.
-
toQuery
public TermAutomatonQuery toQuery(java.lang.String field, TokenStream in) throws java.io.IOException
Pulls the graph (includingPositionLengthAttribute
) from the providedTokenStream
, and creates the corresponding automaton where arcs are bytes (or Unicode code points if unicodeArcs = true) from each term.- Throws:
java.io.IOException
-
-