Package org.opencms.jsp.search.config
Class CmsSearchConfigurationCommon
java.lang.Object
org.opencms.jsp.search.config.CmsSearchConfigurationCommon
- All Implemented Interfaces:
I_CmsSearchConfigurationCommon
Search configuration for common parameters as the query parameter etc.
-
Constructor Summary
ConstructorDescriptionCmsSearchConfigurationCommon
(String queryParam, String lastQueryParam, Boolean escapeQueryChars, String reloadedParam, Boolean seachForEmptyQuery, Boolean ignoreQuery, String queryModifier, String solrIndex, String solrCore, String extraSolrParams, Map<String, String> additionalParameters, Boolean ignoreReleaseDate, Boolean ignoreExpirationDate, int maxReturnedResults) Constructor for the common search configuration, where all configuration parameters are provided. -
Method Summary
Modifier and TypeMethodDescriptionReturns a map from request parameter names to Solr query parts (where the parameter's values are typically inserted).boolean
Returns a flag, indicating if special query characters (e.g., ":", "(", "[" ...) should be escaped in the query string.Returns the extra params given to Solr.boolean
Flag, indicating if also resources that are expired.boolean
Returns a flag, indicating if the query and lastquery params should be ignored when generating the query.boolean
Flag, indicating if also resources that are not yet released.Returns the parameter name of the request parameter used to send the last query string.int
Returns the number of maximally returned results.getModifiedQuery
(String queryString) Modifies the query string according to the specified query modifier.Returns the modifier for queries.Returns the parameter name of the request parameter used to send the current query string.Returns the parameter name of the request parameter used to indicate if the search form is loaded the first time or repeatedly.boolean
Returns a flag, indicating if for an empty search query, search should be performed using a wildcard.Returns the Solr core that should be used.Returns the Solr index that should be used.
-
Constructor Details
-
CmsSearchConfigurationCommon
public CmsSearchConfigurationCommon(String queryParam, String lastQueryParam, Boolean escapeQueryChars, String reloadedParam, Boolean seachForEmptyQuery, Boolean ignoreQuery, String queryModifier, String solrIndex, String solrCore, String extraSolrParams, Map<String, String> additionalParameters, Boolean ignoreReleaseDate, Boolean ignoreExpirationDate, int maxReturnedResults) Constructor for the common search configuration, where all configuration parameters are provided.- Parameters:
queryParam
- The query request param used by the search form.lastQueryParam
- The last-query request param used by the search form.escapeQueryChars
- A flag, indicating if special query characters in the query string should be escaped (defaulttrue
).reloadedParam
- The first-call request param used by the search form.seachForEmptyQuery
- A flag, indicating if the empty query should be interpreted as "*:*" or if no search should be performed.ignoreQuery
- A flag, indicating if the query param's values should be used for Solr query generation.queryModifier
- Modifier for the given query string.solrIndex
- The Solr index that should be used for the search.solrCore
- The Solr core that should be used for the search.extraSolrParams
- Extra params that are directly appended to each search query.additionalParameters
- A map from additional request parameters to Solr query parts.ignoreReleaseDate
- A flag, indicating if the release date should be ignored.ignoreExpirationDate
- A flag, indicating if the expiration date should be ignored.maxReturnedResults
- Number of results maximally to return.<= 0
means that there is no limit.
-
-
Method Details
-
getAdditionalParameters
Description copied from interface:I_CmsSearchConfigurationCommon
Returns a map from request parameter names to Solr query parts (where the parameter's values are typically inserted).- Specified by:
getAdditionalParameters
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- A map from request parameter names to Solr query parts (where the parameter's values are typically inserted).
- See Also:
-
getEscapeQueryChars
Description copied from interface:I_CmsSearchConfigurationCommon
Returns a flag, indicating if special query characters (e.g., ":", "(", "[" ...) should be escaped in the query string.- Specified by:
getEscapeQueryChars
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- A flag, indicating if special query characters (e.g., ":", "(", "[" ...) should be escaped in the query string.
- See Also:
-
getExtraSolrParams
Description copied from interface:I_CmsSearchConfigurationCommon
Returns the extra params given to Solr.- Specified by:
getExtraSolrParams
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- The extra params given to Solr - in format "p1=v1&p2=v2".
- See Also:
-
getIgnoreExpirationDate
Description copied from interface:I_CmsSearchConfigurationCommon
Flag, indicating if also resources that are expired.NOTE: if you are not in the edit mode, the flag is ignored and expired resources are never returned.
- Specified by:
getIgnoreExpirationDate
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- Flag, indicating if also resources that are expired should be returned.
- See Also:
-
getIgnoreQueryParam
Description copied from interface:I_CmsSearchConfigurationCommon
Returns a flag, indicating if the query and lastquery params should be ignored when generating the query. This is useful, if you have a fixed query in the extra Solr params configured.- Specified by:
getIgnoreQueryParam
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- A flag, indicating if the query and lastquery params should be ignored.
- See Also:
-
getIgnoreReleaseDate
Description copied from interface:I_CmsSearchConfigurationCommon
Flag, indicating if also resources that are not yet released.NOTE: if you are not in the edit mode, the flag is ignored and unreleased resources are never returned.
- Specified by:
getIgnoreReleaseDate
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- Flag, indicating if also resources that are not yet released should be returned.
- See Also:
-
getLastQueryParam
Description copied from interface:I_CmsSearchConfigurationCommon
Returns the parameter name of the request parameter used to send the last query string.- Specified by:
getLastQueryParam
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- The request parameter name used to send the last query string.
- See Also:
-
getMaxReturnedResults
Description copied from interface:I_CmsSearchConfigurationCommon
Returns the number of maximally returned results. NOTE: If not explicitly specified, this value is read from the (index specific) system wide configuration.- Specified by:
getMaxReturnedResults
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- number of maximally returned results,.
- See Also:
-
getModifiedQuery
Description copied from interface:I_CmsSearchConfigurationCommon
Modifies the query string according to the specified query modifier.- Specified by:
getModifiedQuery
in interfaceI_CmsSearchConfigurationCommon
- Parameters:
queryString
- the query to modify.- Returns:
- the modified query.
- See Also:
-
getQueryModifier
Description copied from interface:I_CmsSearchConfigurationCommon
Returns the modifier for queries.- Specified by:
getQueryModifier
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- the query modifier.
- See Also:
-
getQueryParam
Description copied from interface:I_CmsSearchConfigurationCommon
Returns the parameter name of the request parameter used to send the current query string.- Specified by:
getQueryParam
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- The request parameter name used to send the current query string.
- See Also:
-
getReloadedParam
Description copied from interface:I_CmsSearchConfigurationCommon
Returns the parameter name of the request parameter used to indicate if the search form is loaded the first time or repeatedly.- Specified by:
getReloadedParam
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- The request parameter name used to indicate if the search form is loaded the first time or repeatedly.
- See Also:
-
getSearchForEmptyQueryParam
Description copied from interface:I_CmsSearchConfigurationCommon
Returns a flag, indicating if for an empty search query, search should be performed using a wildcard.- Specified by:
getSearchForEmptyQueryParam
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- A flag, indicating if for an empty search query, search should be performed using a wildcard.
- See Also:
-
getSolrCore
Description copied from interface:I_CmsSearchConfigurationCommon
Returns the Solr core that should be used. Can also benull
.- Specified by:
getSolrCore
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- The Solr core to use, or
null
if none is configured. - See Also:
-
getSolrIndex
Description copied from interface:I_CmsSearchConfigurationCommon
Returns the Solr index that should be used.- Specified by:
getSolrIndex
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- The Solr index to use.
- See Also:
-