org.hibernate.search.query.dsl.impl
Class AbstractFacet

java.lang.Object
  extended by org.hibernate.search.query.dsl.impl.AbstractFacet
All Implemented Interfaces:
Facet
Direct Known Subclasses:
RangeFacetImpl

public abstract class AbstractFacet
extends Object
implements Facet

A single facet (field value and count).

Author:
Hardy Ferentschik

Constructor Summary
AbstractFacet(String facetingName, String fieldName, String value, int count)
           
 
Method Summary
 boolean equals(Object o)
           
 int getCount()
           
 String getFacetingName()
           
abstract  org.apache.lucene.search.Query getFacetQuery()
           
 String getFieldName()
           
 String getValue()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractFacet

public AbstractFacet(String facetingName,
                     String fieldName,
                     String value,
                     int count)
Method Detail

getCount

public int getCount()
Specified by:
getCount in interface Facet
Returns:
the faceting count

getValue

public String getValue()
Specified by:
getValue in interface Facet
Returns:
the value of this facet. In case of a discrete facet it is the actual Document field value. In case of a range query the value is a string representation of the range

getFieldName

public String getFieldName()
Specified by:
getFieldName in interface Facet
Returns:
the Document field name this facet was created for

getFacetingName

public String getFacetingName()
Specified by:
getFacetingName in interface Facet
Returns:
the faceting name this Facet belongs to. See FacetingRequest.getFacetingName().

getFacetQuery

public abstract org.apache.lucene.search.Query getFacetQuery()
Specified by:
getFacetQuery in interface Facet
Returns:
a Lucene Query which can be applied just targeted all documents matching the value of this facet

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved