FacetQuery (Lucene 10.5.1 facet API)
Description: declaration: package: org.apache.lucene.facet, class: FacetQuery

Package org.apache.lucene.facet

# Class FacetQuery

java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.search.TermQuery
org.apache.lucene.facet.FacetQuery

public class FacetQuery extends TermQuery
A term `Query` over a `FacetField`.

NOTE:This helper class is an alternative to `DrillDownQuery` especially in cases where you don't intend to use `DrillSideways`

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FacetQuery(String dimension, String... path)`
  Creates a new `FacetQuery` filtering the query on the given dimension.
  `FacetQuery(FacetsConfig facetsConfig, String dimension, String... path)`
  Creates a new `FacetQuery` filtering the query on the given dimension.

- ## Method Summary

  ### Methods inherited from class org.apache.lucene.search.TermQuery

  `createWeight, equals, getTerm, getTermStates, hashCode, toString, visit`

  ### Methods inherited from class org.apache.lucene.search.Query

  `classHash, rewrite, sameClassAs, toString`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### FacetQuery

    public FacetQuery(FacetsConfig facetsConfig, String dimension, String... path)
    Creates a new `FacetQuery` filtering the query on the given dimension.

  - ### FacetQuery

    public FacetQuery(String dimension, String... path)
    Creates a new `FacetQuery` filtering the query on the given dimension.

    NOTE:Uses FacetsConfig.DEFAULT_DIM_CONFIG.