Package org.codelibs.fess.query
Class QueryFieldConfig
java.lang.Object
org.codelibs.fess.query.QueryFieldConfig
Configuration class for query field mappings in the Fess search engine.
This class manages field configurations for various query operations including
response fields, search fields, facet fields, sort fields, and highlighting.
It initializes field mappings from the FessConfig and provides methods to
query field properties and capabilities.
-
Field Summary
FieldsModifier and TypeFieldDescriptionList of additional default fields with their boost valuesSet of fields that are allowed in API responsesprotected String[]Array of fields to be included in cache search responsestatic final StringField name for OpenSearch document scoreprotected String[]Array of fields that can be used for faceted searchSet of fields that can be used for faceted search for O(1) lookupprotected String[]Array of fields that can be highlighted in search resultsstatic final StringField name for URL-based search queriesSet of fields that are not analyzed during indexingprotected String[]Array of fields to be included in standard search responsestatic final StringField name for document score in search resultsprotected static final StringSort value for score-based sortingprotected String[]Array of fields to be included in scroll search responseprotected String[]Array of fields that can be searched againstSet of fields that can be searched against for O(1) lookupstatic final StringField name for site information in search resultsprotected String[]Array of fields that can be used for sorting search resultsSet of fields that can be used for sorting for O(1) lookup -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]Gets the fields that are included in cache search responses.String[]Gets the fields that can be used for faceted search.String[]Gets the fields that can be highlighted in search results.String[]Gets the fields that are included in standard search responses.String[]Gets the fields that are included in scroll search responses.String[]Gets the fields that can be searched against.String[]Gets the fields that can be used for sorting search results.voidhighlightedFields(Consumer<Stream<String>> stream) Processes the highlighted fields using the provided stream consumer.voidinit()Initializes the query field configuration by loading field mappings from FessConfig.booleanisApiResponseField(String field) Checks if the specified field is allowed in API responses.booleanisFacetField(String field) Checks if the specified field can be used for faceted search.booleanisFacetSortValue(String sort) Checks if the specified sort value is valid for facet sorting.protected booleanisSortField(String field) Checks if the specified field can be used for sorting.voidsetApiResponseFields(String[] fields) Sets the fields that are allowed in API responses.voidsetCacheResponseFields(String[] cacheResponseFields) Sets the fields that are included in cache search responses.voidsetFacetFields(String[] facetFields) Sets the fields that can be used for faceted search.voidsetHighlightedFields(String[] highlightedFields) Sets the fields that can be highlighted in search results.voidsetNotAnalyzedFields(String[] fields) Sets the fields that should not be analyzed during indexing.voidsetResponseFields(String[] responseFields) Sets the fields that are included in standard search responses.voidsetScrollResponseFields(String[] scrollResponseFields) Sets the fields that are included in scroll search responses.voidsetSearchFields(String[] supportedFields) Sets the fields that can be searched against.voidsetSortFields(String[] sortFields) Sets the fields that can be used for sorting search results.
-
Field Details
-
SCORE_FIELD
Field name for document score in search results- See Also:
-
DOC_SCORE_FIELD
Field name for OpenSearch document score- See Also:
-
SITE_FIELD
Field name for site information in search results- See Also:
-
INURL_FIELD
Field name for URL-based search queries- See Also:
-
SCORE_SORT_VALUE
Sort value for score-based sorting- See Also:
-
responseFields
Array of fields to be included in standard search response -
scrollResponseFields
Array of fields to be included in scroll search response -
cacheResponseFields
Array of fields to be included in cache search response -
highlightedFields
Array of fields that can be highlighted in search results -
searchFields
Array of fields that can be searched against -
searchFieldSet
Set of fields that can be searched against for O(1) lookup -
facetFields
Array of fields that can be used for faceted search -
facetFieldSet
Set of fields that can be used for faceted search for O(1) lookup -
sortFields
Array of fields that can be used for sorting search results -
sortFieldSet
Set of fields that can be used for sorting for O(1) lookup -
apiResponseFieldSet
Set of fields that are allowed in API responses -
notAnalyzedFieldSet
Set of fields that are not analyzed during indexing -
additionalDefaultList
List of additional default fields with their boost values
-
-
Constructor Details
-
QueryFieldConfig
public QueryFieldConfig()Default constructor.
-
-
Method Details
-
init
@PostConstruct public void init()Initializes the query field configuration by loading field mappings from FessConfig. This method is called after dependency injection is complete. It sets up response fields, search fields, facet fields, sort fields, and other field configurations based on the application configuration. -
setNotAnalyzedFields
Sets the fields that should not be analyzed during indexing.- Parameters:
fields- array of field names that should not be analyzed
-
isSortField
Checks if the specified field can be used for sorting. Uses O(1) Set lookup for improved performance.- Parameters:
field- the field name to check- Returns:
- true if the field can be used for sorting, false otherwise
-
isFacetField
Checks if the specified field can be used for faceted search. Uses O(1) Set lookup for improved performance.- Parameters:
field- the field name to check- Returns:
- true if the field can be used for faceted search, false otherwise
-
isFacetSortValue
Checks if the specified sort value is valid for facet sorting.- Parameters:
sort- the sort value to check- Returns:
- true if the sort value is valid for facets ("count" or "index"), false otherwise
-
setApiResponseFields
Sets the fields that are allowed in API responses.- Parameters:
fields- array of field names that are allowed in API responses
-
isApiResponseField
Checks if the specified field is allowed in API responses.- Parameters:
field- the field name to check- Returns:
- true if the field is allowed in API responses, false otherwise
-
getResponseFields
Gets the fields that are included in standard search responses.- Returns:
- array of field names for standard search responses
-
setResponseFields
Sets the fields that are included in standard search responses.- Parameters:
responseFields- array of field names for standard search responses
-
getScrollResponseFields
Gets the fields that are included in scroll search responses.- Returns:
- array of field names for scroll search responses
-
setScrollResponseFields
Sets the fields that are included in scroll search responses.- Parameters:
scrollResponseFields- array of field names for scroll search responses
-
getCacheResponseFields
Gets the fields that are included in cache search responses.- Returns:
- array of field names for cache search responses
-
setCacheResponseFields
Sets the fields that are included in cache search responses.- Parameters:
cacheResponseFields- array of field names for cache search responses
-
getHighlightedFields
Gets the fields that can be highlighted in search results.- Returns:
- array of field names that can be highlighted
-
setHighlightedFields
Sets the fields that can be highlighted in search results.- Parameters:
highlightedFields- array of field names that can be highlighted
-
highlightedFields
Processes the highlighted fields using the provided stream consumer.- Parameters:
stream- consumer that processes the stream of highlighted field names
-
getSearchFields
Gets the fields that can be searched against.- Returns:
- array of field names that can be searched
-
setSearchFields
Sets the fields that can be searched against. Also updates the searchFieldSet for O(1) lookup performance.- Parameters:
supportedFields- array of field names that can be searched
-
getFacetFields
Gets the fields that can be used for faceted search.- Returns:
- array of field names that can be used for faceted search
-
setFacetFields
Sets the fields that can be used for faceted search. Also updates the facetFieldSet for O(1) lookup performance.- Parameters:
facetFields- array of field names that can be used for faceted search
-
getSortFields
Gets the fields that can be used for sorting search results.- Returns:
- array of field names that can be used for sorting
-
setSortFields
Sets the fields that can be used for sorting search results. Also updates the sortFieldSet for O(1) lookup performance.- Parameters:
sortFields- array of field names that can be used for sorting
-