001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.jsp.search.config;
029
030import java.util.Map;
031
032/** Interface the common search configuration must implement. */
033public interface I_CmsSearchConfigurationCommon {
034
035    /** Returns a map from request parameter names to Solr query parts (where the parameter's values are typically inserted).
036     * @return A map from request parameter names to Solr query parts (where the parameter's values are typically inserted).
037     */
038    Map<String, String> getAdditionalParameters();
039
040    /** Returns a flag, indicating if special query characters (e.g., ":", "(", "[" ...) should be escaped in the query string.
041     * @return A flag, indicating if special query characters (e.g., ":", "(", "[" ...) should be escaped in the query string.
042     */
043    boolean getEscapeQueryChars();
044
045    /** Returns the extra params given to Solr.
046     * @return The extra params given to Solr - in format "p1=v1&p2=v2".
047     */
048    String getExtraSolrParams();
049
050    /**Flag, indicating if also resources that are expired.<p>
051     * NOTE: if you are not in the edit mode, the flag is ignored and expired resources are never returned.
052     *
053     * @return Flag, indicating if also resources that are expired should be returned.
054     */
055    boolean getIgnoreExpirationDate();
056
057    /** Returns a flag, indicating if the query and lastquery params should be ignored when
058     *  generating the query. This is useful, if you have a fixed query in the extra Solr params
059     *  configured.
060     * @return A flag, indicating if the query and lastquery params should be ignored.
061     */
062    boolean getIgnoreQueryParam();
063
064    /**Flag, indicating if also resources that are not yet released.<p>
065     * NOTE: if you are not in the edit mode, the flag is ignored and unreleased resources are never returned.
066     *
067     * @return Flag, indicating if also resources that are not yet released should be returned.
068     */
069    boolean getIgnoreReleaseDate();
070
071    /** Returns the parameter name of the request parameter used to send the last query string.
072     * @return The request parameter name used to send the last query string.
073     */
074    String getLastQueryParam();
075
076    /** Modifies the query string according to the specified query modifier.
077     * @param queryString the query to modify.
078     * @return the modified query.
079     */
080    String getModifiedQuery(String queryString);
081
082    /** Returns the modifier for queries.
083     * @return the query modifier.
084     */
085    String getQueryModifier();
086
087    /** Returns the parameter name of the request parameter used to send the current query string.
088     * @return The request parameter name used to send the current query string.
089     */
090    String getQueryParam();
091
092    /** Returns the parameter name of the request parameter used to indicate if the search form is loaded the first time or repeatedly.
093     * @return The request parameter name used to indicate if the search form is loaded the first time or repeatedly.
094     */
095    String getReloadedParam();
096
097    /** Returns a flag, indicating if for an empty search query, search should be performed using a wildcard.
098     * @return A flag, indicating if for an empty search query, search should be performed using a wildcard.
099     */
100    boolean getSearchForEmptyQueryParam();
101
102    /** Returns the Solr core that should be used. Can also be <code>null</code>.
103     * @return The Solr core to use, or <code>null</code> if none is configured.
104     */
105    String getSolrCore();
106
107    /** Returns the Solr index that should be used. Can also be <code>null</code>.
108     * @return The Solr index to use, or <code>null</code> if none is configured.
109     */
110    String getSolrIndex();
111
112}