Package it.unimi.di.big.mg4j.query.nodes
Class AbstractTermExpander
- java.lang.Object
-
- it.unimi.di.big.mg4j.query.nodes.AbstractTermExpander
-
- All Implemented Interfaces:
QueryTransformer
- Direct Known Subclasses:
MultiIndexTermExpander
public abstract class AbstractTermExpander extends Object implements QueryTransformer
A query transformer that just requires implementing a method that expands terms (e.g., into disjunctive queries).To implement more sophisticated behaviours, you can subclass the internal class
AbstractTermExpander.ExpanderVisitor
, and override the methodexpanderVisitor()
so that it returns a (possibly cached) instance of your own visitor class (see, for an example,MultiIndexTermExpander
).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractTermExpander.ExpanderVisitor
-
Constructor Summary
Constructors Constructor Description AbstractTermExpander()
-
-
-
Method Detail
-
expanderVisitor
protected AbstractTermExpander.ExpanderVisitor expanderVisitor()
Returns a new expander visitor.- Returns:
- a visitor performing the expansion.
-
transform
public Query transform(Query query)
- Specified by:
transform
in interfaceQueryTransformer
-
expand
public abstract Query expand(Term term)
Expands a single term.- Parameters:
term
- a term to be expanded.- Returns:
- the resulting query.
-
-