public final class DrillDownQuery extends Query
Query
for drill-down over categories
. You
should call add(CategoryPath...)
for every group of categories you
want to drill-down over. Each category in the group is OR'ed
with
the others, and groups are AND'ed
.
NOTE: if you choose to create your own Query
by calling
term(org.apache.lucene.facet.params.FacetIndexingParams, org.apache.lucene.facet.taxonomy.CategoryPath)
, it is recommended to wrap it with ConstantScoreQuery
and set the boost
to 0.0f
,
so that it does not affect the scores of the documents.
Constructor and Description |
---|
DrillDownQuery(FacetIndexingParams fip)
Creates a new
DrillDownQuery without a base query,
to perform a pure browsing query (equivalent to using
MatchAllDocsQuery as base). |
DrillDownQuery(FacetIndexingParams fip,
Query baseQuery)
Creates a new
DrillDownQuery over the given base query. |
Modifier and Type | Method and Description |
---|---|
void |
add(CategoryPath... paths)
Adds one dimension of drill downs; if you pass multiple values they are
OR'd, and then the entire dimension is AND'd against the base query.
|
DrillDownQuery |
clone() |
boolean |
equals(Object obj) |
int |
hashCode() |
Query |
rewrite(IndexReader r) |
static Term |
term(FacetIndexingParams iParams,
CategoryPath path)
Return a drill-down
Term for a category. |
String |
toString(String field) |
createWeight, extractTerms, getBoost, setBoost, toString
public DrillDownQuery(FacetIndexingParams fip)
DrillDownQuery
without a base query,
to perform a pure browsing query (equivalent to using
MatchAllDocsQuery
as base).public DrillDownQuery(FacetIndexingParams fip, Query baseQuery)
DrillDownQuery
over the given base query. Can be
null
, in which case the result Query
from
rewrite(IndexReader)
will be a pure browsing query, filtering on
the added categories only.public static Term term(FacetIndexingParams iParams, CategoryPath path)
Term
for a category.public void add(CategoryPath... paths)
public DrillDownQuery clone()
public Query rewrite(IndexReader r) throws IOException
rewrite
in class Query
IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.