org.apache.lucene.facet.search
Class DrillDown

java.lang.Object
  extended by org.apache.lucene.facet.search.DrillDown

public final class DrillDown
extends Object

Utility class for creating drill-down queries or terms over CategoryPath. This can be used to e.g. narrow down a user's search to selected categories.

NOTE: if you choose to create your own Query by calling term(org.apache.lucene.facet.search.params.FacetSearchParams, 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
DrillDown()
           
 
Method Summary
static Query query(FacetIndexingParams iParams, Query baseQuery, CategoryPath... paths)
          Wraps a given Query as a drill-down query over the given categories, assuming all are required (e.g.
static Query query(FacetSearchParams sParams, Query baseQuery, CategoryPath... paths)
           
static Term term(FacetIndexingParams iParams, CategoryPath path)
          Return a drill-down Term for a category.
static Term term(FacetSearchParams sParams, CategoryPath path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrillDown

public DrillDown()
Method Detail

term

public static final Term term(FacetSearchParams sParams,
                              CategoryPath path)
See Also:
term(FacetIndexingParams, CategoryPath)

term

public static final Term term(FacetIndexingParams iParams,
                              CategoryPath path)
Return a drill-down Term for a category.


query

public static final Query query(FacetIndexingParams iParams,
                                Query baseQuery,
                                CategoryPath... paths)
Wraps a given Query as a drill-down query over the given categories, assuming all are required (e.g. AND). You can construct a query with different modes (such as OR or AND of ORs) by creating a BooleanQuery and call this method several times. Make sure to wrap the query in that case by ConstantScoreQuery and set the boost to 0.0f, so that it doesn't affect scoring.

NOTE: baseQuery can be null, in which case only the Query over the categories will is returned.


query

public static final Query query(FacetSearchParams sParams,
                                Query baseQuery,
                                CategoryPath... paths)
See Also:
query(FacetIndexingParams, Query, CategoryPath...)


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