Class CmsSimpleSearchConfigurationParser
java.lang.Object
org.opencms.jsp.search.config.parser.CmsJSONSearchConfigurationParser
org.opencms.jsp.search.config.parser.CmsSimpleSearchConfigurationParser
- All Implemented Interfaces:
I_CmsSearchConfigurationParser
Search configuration parser using a list configuration file as the base configuration with additional JSON.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Sort options that are available by default. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
SOLR field name.static final String
SOLR field name.static final String
SOLR field name.static final String
SOLR field name.static final String
SOLR field name.Fields inherited from class org.opencms.jsp.search.config.parser.CmsJSONSearchConfigurationParser
DEFAULT_LAST_QUERY_PARAM, DEFAULT_QUERY_PARAM, DEFAULT_RELOADED_PARAM, JSON_KEY_ADDITIONAL_PARAMETERS, JSON_KEY_ADDITIONAL_PARAMETERS_PARAM, JSON_KEY_ADDITIONAL_PARAMETERS_SOLRQUERY, JSON_KEY_CORE, JSON_KEY_DEFAULT_SORT_OPTION, JSON_KEY_DIDYOUMEAN, JSON_KEY_DIDYOUMEAN_COLLATE, JSON_KEY_DIDYOUMEAN_COUNT, JSON_KEY_DIDYOUMEAN_QUERYPARAM, JSON_KEY_ESCAPE_QUERY_CHARACTERS, JSON_KEY_EXTRASOLRPARAMS, JSON_KEY_FACET_EXCLUDETAGS, JSON_KEY_FACET_FIELD, JSON_KEY_FACET_FILTERQUERYMODIFIER, JSON_KEY_FACET_IGNOREALLFACETFILTERS, JSON_KEY_FACET_ISANDFACET, JSON_KEY_FACET_LABEL, JSON_KEY_FACET_LIMIT, JSON_KEY_FACET_MINCOUNT, JSON_KEY_FACET_NAME, JSON_KEY_FACET_ORDER, JSON_KEY_FACET_PREFIX, JSON_KEY_FACET_PRESELECTION, JSON_KEY_FIELD_FACETS, JSON_KEY_GEO_FILTER, JSON_KEY_GEO_FILTER_COORDINATES, JSON_KEY_GEO_FILTER_COORDINATES_PARAM, JSON_KEY_GEO_FILTER_FIELD_NAME, JSON_KEY_GEO_FILTER_RADIUS, JSON_KEY_GEO_FILTER_RADIUS_PARAM, JSON_KEY_GEO_FILTER_UNITS, JSON_KEY_GEO_FILTER_UNITS_PARAM, JSON_KEY_HIGHLIGHTER, JSON_KEY_HIGHLIGHTER_ALTERNATE_FIELD, JSON_KEY_HIGHLIGHTER_FASTVECTORHIGHLIGHTING, JSON_KEY_HIGHLIGHTER_FIELD, JSON_KEY_HIGHLIGHTER_FORMATTER, JSON_KEY_HIGHLIGHTER_FRAGMENTER, JSON_KEY_HIGHLIGHTER_FRAGSIZE, JSON_KEY_HIGHLIGHTER_MAX_LENGTH_ALTERNATE_FIELD, JSON_KEY_HIGHLIGHTER_SIMPLE_POST, JSON_KEY_HIGHLIGHTER_SIMPLE_PRE, JSON_KEY_HIGHLIGHTER_SNIPPETS, JSON_KEY_IGNORE_EXPIRATION_DATE, JSON_KEY_IGNORE_QUERY, JSON_KEY_IGNORE_RELEASE_DATE, JSON_KEY_INDEX, JSON_KEY_LAST_QUERYPARAM, JSON_KEY_MAX_RETURNED_RESULTS, JSON_KEY_PAGENAVLENGTH, JSON_KEY_PAGEPARAM, JSON_KEY_PAGESIZE, JSON_KEY_QUERY_FACET, JSON_KEY_QUERY_FACET_QUERY, JSON_KEY_QUERY_FACET_QUERY_LABEL, JSON_KEY_QUERY_FACET_QUERY_QUERY, JSON_KEY_QUERY_MODIFIER, JSON_KEY_QUERYPARAM, JSON_KEY_RANGE_FACET_END, JSON_KEY_RANGE_FACET_GAP, JSON_KEY_RANGE_FACET_HARDEND, JSON_KEY_RANGE_FACET_OTHER, JSON_KEY_RANGE_FACET_RANGE, JSON_KEY_RANGE_FACET_START, JSON_KEY_RANGE_FACETS, JSON_KEY_RELOADED_PARAM, JSON_KEY_SEARCH_FOR_EMPTY_QUERY, JSON_KEY_SORTOPTION_LABEL, JSON_KEY_SORTOPTION_PARAMVALUE, JSON_KEY_SORTOPTION_SOLRVALUE, JSON_KEY_SORTOPTIONS, JSON_KEY_SORTPARAM, LOG, m_configObject
-
Constructor Summary
ConstructorDescriptionCmsSimpleSearchConfigurationParser
(CmsObject cms, CmsConfigurationBean config, String additionalParamJSON) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateInstanceWithNoJsonConfig
(CmsObject cms, CmsConfigurationBean config) Creates an instance for an empty JSON configuration.getDefaultFieldFacets
(boolean categoryConjunction) The default field facets.protected Boolean
Returns the flag, indicating if the characters in the query string that are commands to Solr should be escaped.protected String
Returns the configured extra parameters that should be given to Solr, or the empty string if no parameters are configured.protected Boolean
Returns a flag indicating if also expired resources should be found.protected Boolean
Returns a flag indicating if also unreleased resources should be found.Returns the initial SOLR query.protected int
getMaxReturnedResults
(String indexName) Returns the number of maximally returned results, ornull
if the indexes default should be used.protected String
Returns the optional query modifier.protected Boolean
Returns a flag, indicating if search should be performed using a wildcard if the empty query is given.Gets the search locale.protected List<I_CmsSearchConfigurationSortOption>
Returns the list of the configured sort options, or the empty list if no sort options are configured.Returns the configuration for the field facets.Returns the configuration for the pagination.Returns the configuration for the range facets.void
setIgnoreBlacklist
(boolean ignoreBlacklist) Sets the 'ignore blacklist' flag.void
setPagination
(I_CmsSearchConfigurationPagination pagination) Sets the pagination.void
setSearchLocale
(Locale locale) Sets the search locale.void
setSortOption
(String sortOption) Sets the sort option.Methods inherited from class org.opencms.jsp.search.config.parser.CmsJSONSearchConfigurationParser
getAdditionalParameters, getCore, getFirstCallParam, getIgnoreQuery, getIndex, getLastQueryParam, getPageNavLength, getPageParam, getPageSizes, getQueryParam, getSortParam, init, parseCommon, parseDidYouMean, parseFacetQueryItem, parseFacetQueryItems, parseFieldFacet, parseGeoFilter, parseHighlighter, parseMandatoryStringValues, parseOptionalBooleanValue, parseOptionalIntValue, parseOptionalStringValue, parseOptionalStringValues, parseQueryFacet, parseRangeFacet, parseSorting, parseSortOption
-
Field Details
-
FIELD_CATEGORIES
SOLR field name.- See Also:
-
FIELD_DATE
SOLR field name.- See Also:
-
FIELD_DATE_RANGE
SOLR field name.- See Also:
-
FIELD_DATE_FACET_NAME
SOLR field name.- See Also:
-
FIELD_PARENT_FOLDERS
SOLR field name.- See Also:
-
-
Constructor Details
-
CmsSimpleSearchConfigurationParser
public CmsSimpleSearchConfigurationParser(CmsObject cms, CmsConfigurationBean config, String additionalParamJSON) throws JSONException Constructor.- Parameters:
cms
- the cms contextconfig
- the list configurationadditionalParamJSON
- the additional JSON configuration- Throws:
JSONException
- in case parsing the JSON fails
-
-
Method Details
-
createInstanceWithNoJsonConfig
public static CmsSimpleSearchConfigurationParser createInstanceWithNoJsonConfig(CmsObject cms, CmsConfigurationBean config) Creates an instance for an empty JSON configuration.The point of this is that we know that passing an empty configuration makes it impossible for a JSONException to thrown.
- Parameters:
cms
- the current CMS contextconfig
- the search configuration- Returns:
- the search config parser
-
getDefaultFieldFacets
public static Map<String,I_CmsSearchConfigurationFacetField> getDefaultFieldFacets(boolean categoryConjunction) The default field facets.- Parameters:
categoryConjunction
- flag, indicating if category selections in the facet should be "AND" combined.- Returns:
- the default field facets.
-
getInitialQuery
Returns the initial SOLR query.- Returns:
- the SOLR query
-
getSearchLocale
Gets the search locale.- Returns:
- the search locale
-
parseFieldFacets
Description copied from interface:I_CmsSearchConfigurationParser
Returns the configuration for the field facets.- Specified by:
parseFieldFacets
in interfaceI_CmsSearchConfigurationParser
- Overrides:
parseFieldFacets
in classCmsJSONSearchConfigurationParser
- Returns:
- The configuration for the field facets.
- See Also:
-
parsePagination
Description copied from interface:I_CmsSearchConfigurationParser
Returns the configuration for the pagination.- Specified by:
parsePagination
in interfaceI_CmsSearchConfigurationParser
- Overrides:
parsePagination
in classCmsJSONSearchConfigurationParser
- Returns:
- The configuration for the pagination.
- See Also:
-
parseRangeFacets
Description copied from interface:I_CmsSearchConfigurationParser
Returns the configuration for the range facets.- Specified by:
parseRangeFacets
in interfaceI_CmsSearchConfigurationParser
- Overrides:
parseRangeFacets
in classCmsJSONSearchConfigurationParser
- Returns:
- The configuration for the range facets.
- See Also:
-
setIgnoreBlacklist
Sets the 'ignore blacklist' flag.If set, the search will ignore the blacklist from the list configuration.
- Parameters:
ignoreBlacklist
- true if the blacklist should be ignored
-
setPagination
Sets the pagination.If this is set, parsePagination will always return the set value instead of using the default way to compute the pagination
- Parameters:
pagination
- the pagination
-
setSearchLocale
Sets the search locale.- Parameters:
locale
- the search locale
-
setSortOption
Sets the sort option.- Parameters:
sortOption
- the sort option
-
getEscapeQueryChars
Description copied from class:CmsJSONSearchConfigurationParser
Returns the flag, indicating if the characters in the query string that are commands to Solr should be escaped.- Overrides:
getEscapeQueryChars
in classCmsJSONSearchConfigurationParser
- Returns:
- the flag, indicating if the characters in the query string that are commands to Solr should be escaped.
- See Also:
-
getExtraSolrParams
Description copied from class:CmsJSONSearchConfigurationParser
Returns the configured extra parameters that should be given to Solr, or the empty string if no parameters are configured.- Overrides:
getExtraSolrParams
in classCmsJSONSearchConfigurationParser
- Returns:
- The configured extra parameters that should be given to Solr, or the empty string if no parameters are configured.
- See Also:
-
getIgnoreExpirationDate
Description copied from class:CmsJSONSearchConfigurationParser
Returns a flag indicating if also expired resources should be found.- Overrides:
getIgnoreExpirationDate
in classCmsJSONSearchConfigurationParser
- Returns:
- A flag indicating if also expired resources should be found.
- See Also:
-
getIgnoreReleaseDate
Description copied from class:CmsJSONSearchConfigurationParser
Returns a flag indicating if also unreleased resources should be found.- Overrides:
getIgnoreReleaseDate
in classCmsJSONSearchConfigurationParser
- Returns:
- A flag indicating if also unreleased resources should be found.
- See Also:
-
getMaxReturnedResults
Description copied from class:CmsJSONSearchConfigurationParser
Returns the number of maximally returned results, ornull
if the indexes default should be used.- Overrides:
getMaxReturnedResults
in classCmsJSONSearchConfigurationParser
- Parameters:
indexName
- the name of the index to search in.- Returns:
- The number of maximally returned results, or
null
if the indexes default should be used. - See Also:
-
getQueryModifier
Description copied from class:CmsJSONSearchConfigurationParser
Returns the optional query modifier.- Overrides:
getQueryModifier
in classCmsJSONSearchConfigurationParser
- Returns:
- the optional query modifier.
- See Also:
-
getSearchForEmptyQuery
Description copied from class:CmsJSONSearchConfigurationParser
Returns a flag, indicating if search should be performed using a wildcard if the empty query is given.- Overrides:
getSearchForEmptyQuery
in classCmsJSONSearchConfigurationParser
- Returns:
- A flag, indicating if search should be performed using a wildcard if the empty query is given.
- See Also:
-
getSortOptions
Description copied from class:CmsJSONSearchConfigurationParser
Returns the list of the configured sort options, or the empty list if no sort options are configured.- Overrides:
getSortOptions
in classCmsJSONSearchConfigurationParser
- Returns:
- The list of the configured sort options, or the empty list if no sort options are configured.
- See Also:
-