Package org.opencms.jsp.search.config
Class CmsSearchConfigurationCommon
- java.lang.Object
-
- org.opencms.jsp.search.config.CmsSearchConfigurationCommon
-
- All Implemented Interfaces:
I_CmsSearchConfigurationCommon
public class CmsSearchConfigurationCommon extends java.lang.Object implements I_CmsSearchConfigurationCommon
Search configuration for common parameters as the query parameter etc.
-
-
Constructor Summary
Constructors Constructor Description CmsSearchConfigurationCommon(java.lang.String queryParam, java.lang.String lastQueryParam, java.lang.Boolean escapeQueryChars, java.lang.String reloadedParam, java.lang.Boolean seachForEmptyQuery, java.lang.Boolean ignoreQuery, java.lang.String queryModifier, java.lang.String solrIndex, java.lang.String solrCore, java.lang.String extraSolrParams, java.util.Map<java.lang.String,java.lang.String> additionalParameters, java.lang.Boolean ignoreReleaseDate, java.lang.Boolean ignoreExpirationDate, int maxReturnedResults)
Constructor for the common search configuration, where all configuration parameters are provided.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>
getAdditionalParameters()
Returns a map from request parameter names to Solr query parts (where the parameter's values are typically inserted).boolean
getEscapeQueryChars()
Returns a flag, indicating if special query characters (e.g., ":", "(", "[" ...) should be escaped in the query string.java.lang.String
getExtraSolrParams()
Returns the extra params given to Solr.boolean
getIgnoreExpirationDate()
Flag, indicating if also resources that are expired.boolean
getIgnoreQueryParam()
Returns a flag, indicating if the query and lastquery params should be ignored when generating the query.boolean
getIgnoreReleaseDate()
Flag, indicating if also resources that are not yet released.java.lang.String
getLastQueryParam()
Returns the parameter name of the request parameter used to send the last query string.int
getMaxReturnedResults()
Returns the number of maximally returned results.java.lang.String
getModifiedQuery(java.lang.String queryString)
Modifies the query string according to the specified query modifier.java.lang.String
getQueryModifier()
Returns the modifier for queries.java.lang.String
getQueryParam()
Returns the parameter name of the request parameter used to send the current query string.java.lang.String
getReloadedParam()
Returns the parameter name of the request parameter used to indicate if the search form is loaded the first time or repeatedly.boolean
getSearchForEmptyQueryParam()
Returns a flag, indicating if for an empty search query, search should be performed using a wildcard.java.lang.String
getSolrCore()
Returns the Solr core that should be used.java.lang.String
getSolrIndex()
Returns the Solr index that should be used.
-
-
-
Constructor Detail
-
CmsSearchConfigurationCommon
public CmsSearchConfigurationCommon(java.lang.String queryParam, java.lang.String lastQueryParam, java.lang.Boolean escapeQueryChars, java.lang.String reloadedParam, java.lang.Boolean seachForEmptyQuery, java.lang.Boolean ignoreQuery, java.lang.String queryModifier, java.lang.String solrIndex, java.lang.String solrCore, java.lang.String extraSolrParams, java.util.Map<java.lang.String,java.lang.String> additionalParameters, java.lang.Boolean ignoreReleaseDate, java.lang.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 Detail
-
getAdditionalParameters
public java.util.Map<java.lang.String,java.lang.String> 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:
I_CmsSearchConfigurationCommon.getAdditionalParameters()
-
getEscapeQueryChars
public boolean 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:
I_CmsSearchConfigurationCommon.getEscapeQueryChars()
-
getExtraSolrParams
public java.lang.String 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:
I_CmsSearchConfigurationCommon.getExtraSolrParams()
-
getIgnoreExpirationDate
public boolean 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:
I_CmsSearchConfigurationCommon.getIgnoreExpirationDate()
-
getIgnoreQueryParam
public boolean 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:
I_CmsSearchConfigurationCommon.getIgnoreQueryParam()
-
getIgnoreReleaseDate
public boolean 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:
I_CmsSearchConfigurationCommon.getIgnoreReleaseDate()
-
getLastQueryParam
public java.lang.String 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:
I_CmsSearchConfigurationCommon.getLastQueryParam()
-
getMaxReturnedResults
public int 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:
I_CmsSearchConfigurationCommon.getMaxReturnedResults()
-
getModifiedQuery
public java.lang.String getModifiedQuery(java.lang.String queryString)
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:
I_CmsSearchConfigurationCommon.getModifiedQuery(java.lang.String)
-
getQueryModifier
public java.lang.String getQueryModifier()
Description copied from interface:I_CmsSearchConfigurationCommon
Returns the modifier for queries.- Specified by:
getQueryModifier
in interfaceI_CmsSearchConfigurationCommon
- Returns:
- the query modifier.
- See Also:
I_CmsSearchConfigurationCommon.getQueryModifier()
-
getQueryParam
public java.lang.String 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:
I_CmsSearchConfigurationCommon.getQueryParam()
-
getReloadedParam
public java.lang.String 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:
I_CmsSearchConfigurationCommon.getReloadedParam()
-
getSearchForEmptyQueryParam
public boolean 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:
I_CmsSearchConfigurationCommon.getSearchForEmptyQueryParam()
-
getSolrCore
public java.lang.String 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:
I_CmsSearchConfigurationCommon.getSolrCore()
-
getSolrIndex
public java.lang.String 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:
I_CmsSearchConfigurationCommon.getSolrIndex()
-
-