se.l4.silo.search.query.OrQuery Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of silo-search-api Show documentation
Show all versions of silo-search-api Show documentation
API for Lucene-based querying for Silo.
package se.l4.silo.search.query;
import java.util.List;
import com.google.common.collect.Lists;
import se.l4.silo.search.QueryItem;
import se.l4.silo.search.QueryPart;
import se.l4.silo.search.QueryWithSubqueries;
public class OrQuery
extends AbstractQueryPart
implements QueryWithSubqueries, ReturnPath>
{
private final List items;
public OrQuery()
{
items = Lists.newArrayList();
}
@Override
public void addQuery(QueryItem item)
{
items.add(item);
}
@Override
public >> P query(P q)
{
q.parent(this, this);
return q;
}
@Override
public ReturnPath done()
{
receiver.addQuery(new QueryItem("or", items));
return parent;
}
}