Package org.apache.lucene.sandbox.search
Class TokenStreamToTermAutomatonQuery
java.lang.Object
org.apache.lucene.sandbox.search.TokenStreamToTermAutomatonQuery
Consumes a TokenStream and creates an
TermAutomatonQuery where the transition labels are
tokens from the TermToBytesRefAttribute.
This code is very new and likely has exciting bugs!
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetPreservePositionIncrements(boolean enablePositionIncrements) Whether to generate holes in the automaton for missing positions,trueby default.toQuery(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.
-
Constructor Details
-
TokenStreamToTermAutomatonQuery
public TokenStreamToTermAutomatonQuery()Sole constructor.
-
-
Method Details
-
setPreservePositionIncrements
public void setPreservePositionIncrements(boolean enablePositionIncrements) Whether to generate holes in the automaton for missing positions,trueby default. -
toQuery
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:
IOException
-