Package org.codelibs.fess.entity
Class FacetInfo
java.lang.Object
org.codelibs.fess.entity.FacetInfo
Entity class representing facet configuration information for search results.
This class holds configuration settings for faceted search including field facets,
query facets, and various parameters that control facet behavior.
-
Field Summary
FieldsModifier and TypeFieldDescriptionString[]Array of field names to create facets forMinimum document count required for a facet value to be includedValue to use for documents that don't have the facet fieldString[]Array of query strings to create query facets forMaximum number of facet values to returnSort order for facet values (e.g., "count.desc", "term.asc") -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a query facet to the existing query array.org.opensearch.search.aggregations.BucketOrderConverts the sort string into a BucketOrder object for OpenSearch aggregations.voidinit()Initializes the facet configuration from Fess configuration properties.toString()Returns a string representation of this FacetInfo object.
-
Field Details
-
field
Array of field names to create facets for -
query
Array of query strings to create query facets for -
size
Maximum number of facet values to return -
minDocCount
Minimum document count required for a facet value to be included -
sort
Sort order for facet values (e.g., "count.desc", "term.asc") -
missing
Value to use for documents that don't have the facet field
-
-
Constructor Details
-
FacetInfo
public FacetInfo()Default constructor for FacetInfo.
-
-
Method Details
-
init
@PostConstruct public void init()Initializes the facet configuration from Fess configuration properties. This method is called after dependency injection to load default facet settings. -
getBucketOrder
public org.opensearch.search.aggregations.BucketOrder getBucketOrder()Converts the sort string into a BucketOrder object for OpenSearch aggregations. Parses sort configuration like "count.desc" or "term.asc" into appropriate bucket ordering.- Returns:
- the BucketOrder instance representing the sort configuration
-
addQuery
Adds a query facet to the existing query array. If no queries exist, creates a new array with the provided query.- Parameters:
s- the query string to add as a facet
-
toString
Returns a string representation of this FacetInfo object. Includes all field values in the format useful for debugging.
-