public class CmsSimpleSearchConfigurationParser extends CmsJSONSearchConfigurationParser
| Modifier and Type | Class and Description |
|---|---|
static class |
CmsSimpleSearchConfigurationParser.SortOption
Sort options that are available by default.
|
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_DIDYOUMEAN, JSON_KEY_DIDYOUMEAN_COLLATE, JSON_KEY_DIDYOUMEAN_COUNT, JSON_KEY_DIDYOUMEAN_QUERYPARAM, JSON_KEY_ESCAPE_QUERY_CHARACTERS, JSON_KEY_EXTRASOLRPARAMS, 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_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_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 and Description |
|---|
CmsSimpleSearchConfigurationParser(CmsObject cms,
CmsListManager.ListConfigurationBean config,
java.lang.String additionalParamJSON)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static CmsSimpleSearchConfigurationParser |
createInstanceWithNoJsonConfig(CmsObject cms,
CmsListManager.ListConfigurationBean config)
Creates an instance for an empty JSON configuration.
|
protected java.lang.Boolean |
getEscapeQueryChars()
Returns the flag, indicating if the characters in the query string that are commands to Solr should be escaped.
|
protected java.lang.String |
getExtraSolrParams()
Returns the configured extra parameters that should be given to Solr, or the empty string if no parameters are configured.
|
protected java.lang.Boolean |
getIgnoreExpirationDate()
Returns a flag indicating if also expired resources should be found.
|
protected java.lang.Boolean |
getIgnoreReleaseDate()
Returns a flag indicating if also unreleased resources should be found.
|
CmsSolrQuery |
getInitialQuery()
Returns the initial SOLR query.
|
protected java.lang.String |
getQueryModifier()
Returns the optional query modifier.
|
protected java.lang.Boolean |
getSearchForEmptyQuery()
Returns a flag, indicating if search should be performed using a wildcard if the empty query is given.
|
java.util.Locale |
getSearchLocale()
Gets the search locale.
|
protected java.util.List<I_CmsSearchConfigurationSortOption> |
getSortOptions()
Returns the list of the configured sort options, or the empty list if no sort options are configured.
|
java.util.Map<java.lang.String,I_CmsSearchConfigurationFacetField> |
parseFieldFacets()
Returns the configuration for the field facets.
|
I_CmsSearchConfigurationPagination |
parsePagination()
Returns the configuration for the pagination.
|
java.util.Map<java.lang.String,I_CmsSearchConfigurationFacetRange> |
parseRangeFacets()
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(java.util.Locale locale)
Sets the search locale.
|
void |
setSortOption(java.lang.String sortOption)
Sets the sort option.
|
getAdditionalParameters, getCore, getFirstCallParam, getIgnoreQuery, getIndex, getLastQueryParam, getPageNavLength, getPageParam, getPageSizes, getQueryParam, getSortParam, init, parseCommon, parseDidYouMean, parseFacetQueryItem, parseFacetQueryItems, parseFieldFacet, parseHighlighter, parseMandatoryStringValues, parseOptionalBooleanValue, parseOptionalIntValue, parseOptionalStringValue, parseOptionalStringValues, parseQueryFacet, parseRangeFacet, parseSorting, parseSortOptionpublic CmsSimpleSearchConfigurationParser(CmsObject cms, CmsListManager.ListConfigurationBean config, java.lang.String additionalParamJSON) throws JSONException
cms - the cms contextconfig - the list configurationadditionalParamJSON - the additional JSON configurationJSONException - in case parsing the JSON failspublic static CmsSimpleSearchConfigurationParser createInstanceWithNoJsonConfig(CmsObject cms, CmsListManager.ListConfigurationBean config)
The point of this is that we know that passing an empty configuration makes it impossible for a JSONException to thrown.
cms - the current CMS contextconfig - the search configurationpublic CmsSolrQuery getInitialQuery()
public java.util.Locale getSearchLocale()
public java.util.Map<java.lang.String,I_CmsSearchConfigurationFacetField> parseFieldFacets()
I_CmsSearchConfigurationParserparseFieldFacets in interface I_CmsSearchConfigurationParserparseFieldFacets in class CmsJSONSearchConfigurationParserI_CmsSearchConfigurationParser.parseFieldFacets()public I_CmsSearchConfigurationPagination parsePagination()
I_CmsSearchConfigurationParserparsePagination in interface I_CmsSearchConfigurationParserparsePagination in class CmsJSONSearchConfigurationParserCmsJSONSearchConfigurationParser.parsePagination()public java.util.Map<java.lang.String,I_CmsSearchConfigurationFacetRange> parseRangeFacets()
I_CmsSearchConfigurationParserparseRangeFacets in interface I_CmsSearchConfigurationParserparseRangeFacets in class CmsJSONSearchConfigurationParserI_CmsSearchConfigurationParser.parseRangeFacets()public void setIgnoreBlacklist(boolean ignoreBlacklist)
If set, the search will ignore the blacklist from the list configuration.
ignoreBlacklist - true if the blacklist should be ignoredpublic void setPagination(I_CmsSearchConfigurationPagination pagination)
If this is set, parsePagination will always return the set value instead of using the default way to compute the pagination
pagination - the paginationpublic void setSearchLocale(java.util.Locale locale)
locale - the search localepublic void setSortOption(java.lang.String sortOption)
sortOption - the sort optionprotected java.lang.Boolean getEscapeQueryChars()
CmsJSONSearchConfigurationParsergetEscapeQueryChars in class CmsJSONSearchConfigurationParserCmsJSONSearchConfigurationParser.getEscapeQueryChars()protected java.lang.String getExtraSolrParams()
CmsJSONSearchConfigurationParsergetExtraSolrParams in class CmsJSONSearchConfigurationParserCmsJSONSearchConfigurationParser.getExtraSolrParams()protected java.lang.Boolean getIgnoreExpirationDate()
CmsJSONSearchConfigurationParsergetIgnoreExpirationDate in class CmsJSONSearchConfigurationParserCmsJSONSearchConfigurationParser.getIgnoreExpirationDate()protected java.lang.Boolean getIgnoreReleaseDate()
CmsJSONSearchConfigurationParsergetIgnoreReleaseDate in class CmsJSONSearchConfigurationParserCmsJSONSearchConfigurationParser.getIgnoreReleaseDate()protected java.lang.String getQueryModifier()
CmsJSONSearchConfigurationParsergetQueryModifier in class CmsJSONSearchConfigurationParserCmsJSONSearchConfigurationParser.getQueryModifier()protected java.lang.Boolean getSearchForEmptyQuery()
CmsJSONSearchConfigurationParsergetSearchForEmptyQuery in class CmsJSONSearchConfigurationParserCmsJSONSearchConfigurationParser.getSearchForEmptyQuery()protected java.util.List<I_CmsSearchConfigurationSortOption> getSortOptions()
CmsJSONSearchConfigurationParsergetSortOptions in class CmsJSONSearchConfigurationParserCmsJSONSearchConfigurationParser.getSortOptions()