it.unimi.di.mg4j.query.nodes
Class MultiTerm
java.lang.Object
it.unimi.di.mg4j.query.nodes.Composite
it.unimi.di.mg4j.query.nodes.MultiTerm
- All Implemented Interfaces:
- Query, Serializable
public class MultiTerm
- extends Composite
A node representing a virtual term obtained by merging the occurrences of the given (possibly weighted) terms.
This node is mainly useful when performing query expansion. The QueryBuilderVisitor
used to generate document iterators can decide which
policy to use for setting the frequency and the name of the virtual term.
- Author:
- Sebastiano Vigna
- See Also:
MultiTermIndexIterator
,
Serialized Form
Fields inherited from class it.unimi.di.mg4j.query.nodes.Composite |
query |
Constructor Summary |
MultiTerm(Query... query)
Creates a new multi-term node. |
MultiTerm
public MultiTerm(Query... query)
- Creates a new multi-term node.
- Parameters:
query
- a vector of nodes representing distinct terms; they must be either instances
of Term
, or instances of Weight
containing instances of Term
.
- Throws:
IllegalArgumentException
- if some term appears twice in query
, or if
the specification is not followed.
toString
public String toString()
- Overrides:
toString
in class Object
accept
public <T> T accept(QueryBuilderVisitor<T> visitor)
throws QueryBuilderVisitorException
- Description copied from interface:
Query
- Accepts a visitor.
- Parameters:
visitor
- the visitor.
- Returns:
- the result of the visit, or
null
if the visit should stop.
- Throws:
QueryBuilderVisitorException
- See Also:
Query
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object