## org.apache.lucene.facet.search
Class DrillDownQuery

    java.lang.Object
      org.apache.lucene.search.Query
          org.apache.lucene.facet.search.DrillDownQuery

All Implemented Interfaces:
  Cloneable

    public final class DrillDownQuery

extends Query

A `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.

WARNING: This API is experimental and might change in incompatible ways in the next release.

Constructor Summary
`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.

Method Summary
`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)`

Methods inherited from class org.apache.lucene.search.Query
`createWeight, extractTerms, getBoost, setBoost, toString`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### DrillDownQuery

    public DrillDownQuery(FacetIndexingParams fip)

  Creates a new `DrillDownQuery` without a base query, to perform a pure browsing query (equivalent to using `MatchAllDocsQuery` as base).

### DrillDownQuery

    public DrillDownQuery(FacetIndexingParams fip,
                          Query baseQuery)

  Creates a new `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.

Method Detail

### term

    public static Term term(FacetIndexingParams iParams,
                            CategoryPath path)

  Return a drill-down `Term` for a category.

### add

    public 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.

### clone

    public DrillDownQuery clone()

  Overrides:
    `clone` in class `Query`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Query`

### equals

    public boolean equals(Object obj)

  Overrides:
    `equals` in class `Query`

### rewrite

    public Query rewrite(IndexReader r)
                  throws IOException

  Overrides:
    `rewrite` in class `Query`
  Throws:
    `IOException`

### toString

    public String toString(String field)

  Specified by:
    `toString` in class `Query`

Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.