Class SearchQuestion


  • public class SearchQuestion
    extends java.lang.Object

    This class contains all the input data related to a search.

    This data will be collected from the input parameters (query string parameters) and possibly transformed by some processing before PADRE is called.

    Since:
    11.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.lang.String[]> additionalParameters
      Additional parameters to pass as-is to PADRE.
      private java.lang.String[] clive
      Specific component of a meta-collection to query
      private java.lang.String cnClickedCluster
      Contextual Navigation: last clicked cluster
      private java.util.List<java.lang.String> cnPreviousClusters
      Contextual Navigation: Previous clicked clusters
      private Collection collection
      Searched Collection.
      private java.lang.String currentProfile
      The profile which will be used for the request.
      private java.util.Map<java.lang.String,​java.lang.Object> customData
      Custom data placeholder allowing any arbitrary data to be stored by hook scripts.
      private java.util.List<java.lang.String> dynamicQueryProcessorOptions
      Dynamic query processor options for PADRE, in addition to the one set in collection.cfg.
      private java.util.Map<java.lang.String,​java.lang.String> environmentVariables
      List of environment variables to pass to PADRE.
      private ExecutionContext executionContext
      Execution context of the Search UI.
      private java.util.Optional<java.util.List<java.lang.String>> facetCollectionConstraints
      The collections to restrict search to for faceted navigation.
      private java.lang.String facetsGScopeConstraints
      GScope constraints to apply for faceted navigation (In addition to existing gscope constraints).
      private java.util.List<java.lang.String> facetsQueryConstraints
      Query constraints to apply for faceted navigation (In addition to other query expressions).
      private @Pattern(regexp="[\\w-_]+") java.lang.String form
      Display form (template)
      private com.funnelback.common.Environment.FunnelbackVersion funnelbackVersion
      Funnelback version
      private java.lang.String hostname
      Name of the host where PADRE executed the query.
      private boolean impersonated
      Whether the request is impersonated (Document Level Security)
      private java.util.Map<java.lang.String,​java.lang.String> inputParameterMap
      Input parameters map.
      private java.util.Locale locale
      Locale to use for the search.
      private Location location
      Location information detected for the remote user based on information from their request.
      private java.util.Optional<java.lang.Boolean> logQuery
      Defines if the query should be logged or not, or if it should fall back to default.
      private java.util.Optional<java.lang.Integer> maxPadrePacketSize
      A optional maxPadrePacketSize which may be overridden to set the max Padre packet size that will be permitted.
      private java.util.List<java.lang.String> metaParameters
      meta_* / query_* input parameters, transformed in query expressions.
      private java.lang.String originalQuery
      Original query, as entered by the user.
      private java.util.Optional<java.lang.Long> padreTimeout
      A optional timeout which when set overrides the value of collection.cfg option ui.modern.padre_fork_timeout_ms, which controls how long the main padre forking may take.
      private java.security.Principal principal
      Principal representing the remote user for the current request.
      private PriorityQueryProcessorOptions priorityQueryProcessorOptions
      Query processor options that are guaranteed to apply.
      private @Pattern(regexp="[\\w-_]+") java.lang.String profile
      Search Profile, defaulting to "_default"
      private java.lang.String query
      Query terms.
      private java.util.Map<java.lang.String,​java.util.List<java.lang.String>> queryStringMap
      Sets the query string parameter map.
      private SearchQuestion.SearchQuestionType questionType
      Indicates the 'type' of question, which may trigger special processing in the search lifecycle.
      private java.util.Map<java.lang.String,​java.lang.String[]> rawInputParameters
      Raw input parameters
      private com.google.common.collect.ListMultimap<java.lang.String,​java.lang.String> requestHeaders
      Headers provided with the incoming search request
      private java.lang.String requestId
      Request identifier to log for this transaction.
      private java.util.Map<java.lang.String,​java.util.List<java.lang.String>> selectedCategoryValues
      List of selected facets categories.
      private java.util.Set<java.lang.String> selectedFacets
      List of selected facets.
      private java.util.List<java.lang.String> systemMetaParameters
      smeta_* / squery_* input parameters, transformed in query expressions.
      private java.util.List<java.lang.String> userKeys
      User keys for early binding Document Level Security.
    • Constructor Summary

      Constructors 
      Constructor Description
      SearchQuestion()  
      SearchQuestion​(ExecutionContext executionContext, com.google.common.collect.ListMultimap<java.lang.String,​java.lang.String> requestHeaders, java.lang.String query, java.lang.String originalQuery, Collection collection, java.lang.String profile, java.lang.String currentProfile, java.lang.String[] clive, java.lang.String form, java.lang.String cnClickedCluster, java.util.List<java.lang.String> facetsQueryConstraints, java.util.Optional<java.util.List<java.lang.String>> facetCollectionConstraints, java.lang.String facetsGScopeConstraints, boolean impersonated, java.lang.String requestId, java.util.Optional<java.lang.Boolean> logQuery, java.util.Map<java.lang.String,​java.util.List<java.lang.String>> queryStringMap, SearchQuestion.SearchQuestionType questionType, java.util.Locale locale, Location location, java.security.Principal principal, java.lang.String hostname, com.funnelback.common.Environment.FunnelbackVersion funnelbackVersion, java.util.Optional<java.lang.Integer> maxPadrePacketSize, java.util.Optional<java.lang.Long> padreTimeout)  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.String[]> getAdditionalParameters()
      Additional parameters to pass as-is to PADRE.
      java.lang.String[] getClive()
      Specific component of a meta-collection to query
      java.lang.String getCnClickedCluster()
      Contextual Navigation: last clicked cluster
      java.util.List<java.lang.String> getCnPreviousClusters()
      Contextual Navigation: Previous clicked clusters
      Collection getCollection()
      Searched Collection.
      java.lang.String getCurrentProfile()
      The profile which will be used for the request.
      com.funnelback.config.configtypes.service.ServiceConfigReadOnly getCurrentProfileConfig()
      Returns the (modern) config of the currentProfile
      java.util.Map<java.lang.String,​java.lang.Object> getCustomData()
      Custom data placeholder allowing any arbitrary data to be stored by hook scripts.
      java.util.List<java.lang.String> getDynamicQueryProcessorOptions()
      Dynamic query processor options for PADRE, in addition to the one set in collection.cfg.
      java.util.Map<java.lang.String,​java.lang.String> getEnvironmentVariables()
      List of environment variables to pass to PADRE.
      ExecutionContext getExecutionContext()
      Execution context of the Search UI.
      java.util.Optional<java.util.List<java.lang.String>> getFacetCollectionConstraints()
      The collections to restrict search to for faceted navigation.
      java.lang.String getFacetsGScopeConstraints()
      GScope constraints to apply for faceted navigation (In addition to existing gscope constraints).
      java.util.List<java.lang.String> getFacetsQueryConstraints()
      Query constraints to apply for faceted navigation (In addition to other query expressions).
      java.lang.String getForm()
      Display form (template)
      com.funnelback.common.Environment.FunnelbackVersion getFunnelbackVersion()
      Funnelback version
      java.lang.String getHostname()
      Name of the host where PADRE executed the query.
      java.util.Map<java.lang.String,​java.lang.String> getInputParameterMap()
      Input parameters map.
      java.util.Locale getLocale()
      Locale to use for the search.
      Location getLocation()
      Location information detected for the remote user based on information from their request.
      java.util.Optional<java.lang.Boolean> getLogQuery()
      Defines if the query should be logged or not, or if it should fall back to default.
      java.util.Optional<java.lang.Integer> getMaxPadrePacketSize()
      A optional maxPadrePacketSize which may be overridden to set the max Padre packet size that will be permitted.
      java.util.List<java.lang.String> getMetaParameters()
      meta_* / query_* input parameters, transformed in query expressions.
      java.lang.String getOriginalQuery()
      Original query, as entered by the user.
      java.util.Optional<java.lang.Long> getPadreTimeout()
      A optional timeout which when set overrides the value of collection.cfg option ui.modern.padre_fork_timeout_ms, which controls how long the main padre forking may take.
      java.security.Principal getPrincipal()
      Principal representing the remote user for the current request.
      PriorityQueryProcessorOptions getPriorityQueryProcessorOptions()
      Query processor options that are guaranteed to apply.
      java.lang.String getProfile()
      Search Profile, defaulting to "_default"
      java.lang.String getQuery()
      Query terms.
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getQueryStringMapCopy()
      Query string parameters as a Map
      SearchQuestion.SearchQuestionType getQuestionType()
      Indicates the 'type' of question, which may trigger special processing in the search lifecycle.
      java.util.Map<java.lang.String,​java.lang.String[]> getRawInputParameters()  
      com.google.common.collect.ListMultimap<java.lang.String,​java.lang.String> getRequestHeaders()
      Headers provided with the incoming search request
      java.lang.String getRequestId()
      Request identifier to log for this transaction.
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getSelectedCategoryValues()
      List of selected facets categories.
      java.util.Set<java.lang.String> getSelectedFacets()
      List of selected facets.
      java.util.List<java.lang.String> getSystemMetaParameters()
      smeta_* / squery_* input parameters, transformed in query expressions.
      java.util.List<java.lang.String> getUserKeys()
      User keys for early binding Document Level Security.
      boolean isExtraSearch()
      Deprecated.
      As of release 14.2, replaced by questionType
      boolean isImpersonated()
      Whether the request is impersonated (Document Level Security)
      void setClive​(java.lang.String[] clive)
      Specific component of a meta-collection to query
      void setCnClickedCluster​(java.lang.String cnClickedCluster)
      Contextual Navigation: last clicked cluster
      void setCollection​(Collection collection)
      Searched Collection.
      void setCurrentProfile​(java.lang.String currentProfile)
      The profile which will be used for the request.
      void setExecutionContext​(ExecutionContext executionContext)
      Execution context of the Search UI.
      void setExtraSearch​(boolean isExtraSearch)
      Deprecated.
      As of release 14.2, replaced by questionType
      void setFacetCollectionConstraints​(java.util.Optional<java.util.List<java.lang.String>> facetCollectionConstraints)
      The collections to restrict search to for faceted navigation.
      void setFacetsGScopeConstraints​(java.lang.String facetsGScopeConstraints)
      GScope constraints to apply for faceted navigation (In addition to existing gscope constraints).
      void setFacetsQueryConstraints​(java.util.List<java.lang.String> facetsQueryConstraints)
      Query constraints to apply for faceted navigation (In addition to other query expressions).
      void setForm​(java.lang.String form)
      Display form (template)
      void setFunnelbackVersion​(com.funnelback.common.Environment.FunnelbackVersion funnelbackVersion)
      Funnelback version
      void setHostname​(java.lang.String hostname)
      Name of the host where PADRE executed the query.
      void setImpersonated​(boolean impersonated)
      Whether the request is impersonated (Document Level Security)
      void setLocale​(java.util.Locale locale)
      Locale to use for the search.
      void setLocation​(Location location)
      Location information detected for the remote user based on information from their request.
      void setLogQuery​(java.util.Optional<java.lang.Boolean> logQuery)
      Defines if the query should be logged or not, or if it should fall back to default.
      void setMaxPadrePacketSize​(java.util.Optional<java.lang.Integer> maxPadrePacketSize)
      A optional maxPadrePacketSize which may be overridden to set the max Padre packet size that will be permitted.
      void setOriginalQuery​(java.lang.String originalQuery)
      Original query, as entered by the user.
      void setPadreTimeout​(java.util.Optional<java.lang.Long> padreTimeout)
      A optional timeout which when set overrides the value of collection.cfg option ui.modern.padre_fork_timeout_ms, which controls how long the main padre forking may take.
      void setPrincipal​(java.security.Principal principal)
      Principal representing the remote user for the current request.
      void setProfile​(java.lang.String profile)
      Search Profile, defaulting to "_default"
      void setQuery​(java.lang.String query)
      Query terms.
      void setQueryStringMap​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> queryStringMap)
      Sets the query string parameter map.
      void setQuestionType​(SearchQuestion.SearchQuestionType questionType)
      Indicates the 'type' of question, which may trigger special processing in the search lifecycle.
      void setRequestHeaders​(com.google.common.collect.ListMultimap<java.lang.String,​java.lang.String> requestHeaders)
      Headers provided with the incoming search request
      void setRequestId​(java.lang.String requestId)
      Request identifier to log for this transaction.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • executionContext

        private ExecutionContext executionContext
        Execution context of the Search UI. Can be "admin" or "public", depending if the search is ran on the admin port or public port.
        Since:
        15.12
      • requestHeaders

        private com.google.common.collect.ListMultimap<java.lang.String,​java.lang.String> requestHeaders
        Headers provided with the incoming search request
        Since:
        15.16
      • query

        private java.lang.String query

        Query terms.

        This may be transformed before being passed to PADRE, depending on the configuration.

      • originalQuery

        private java.lang.String originalQuery
        Original query, as entered by the user.
      • profile

        @NonNull
        @Pattern(regexp="[\\w-_]+")
        private @Pattern(regexp="[\\w-_]+") java.lang.String profile
        Search Profile, defaulting to "_default"
      • currentProfile

        private java.lang.String currentProfile
        The profile which will be used for the request. This one will always correspond to the name of a profile which exists within the selected collection. Note that this may differ from profile if the requested profile does not actually exist on disk (in which case it will be set to DefaultValues.DEFAULT_PROFILE, as that is what's used).
        Since:
        15.12
      • clive

        private java.lang.String[] clive
        Specific component of a meta-collection to query
      • form

        @NonNull
        @Pattern(regexp="[\\w-_]+")
        private @Pattern(regexp="[\\w-_]+") java.lang.String form
        Display form (template)
      • cnClickedCluster

        private java.lang.String cnClickedCluster
        Contextual Navigation: last clicked cluster
      • cnPreviousClusters

        private final java.util.List<java.lang.String> cnPreviousClusters
        Contextual Navigation: Previous clicked clusters
      • metaParameters

        private final java.util.List<java.lang.String> metaParameters

        meta_* / query_* input parameters, transformed in query expressions.

        Those parameters are supposed to be specified by the user, usually in an advanced search form. If you need to inject parameters for technical / behind-the-scene reasons, consider using systemMetaParameters.

        See Also:
        systemMetaParameters
      • systemMetaParameters

        private final java.util.List<java.lang.String> systemMetaParameters

        smeta_* / squery_* input parameters, transformed in query expressions.

        Those parameters are supposed to be "technical" parameters, usually injected through a hook script. If you want the user to specify parameters, consider using metaParameters.

        Since:
        12.2
        See Also:
        metaParameters
      • additionalParameters

        private final java.util.Map<java.lang.String,​java.lang.String[]> additionalParameters

        Additional parameters to pass as-is to PADRE.

        The values of this map will be passed through to PADRE and won't be processed at all by the Modern UI. Only parameters relevant to PADRE should be injected here.

        Depending on the parameters you want to inject or manipulate, consider using inputParameterMap or rawInputParameters. Those parameters will be processed by the Modern UI (For example to inject faceted navigation constraints).

        Note that this map is populated before the first hook script is run: Any additional parameter injected in inputParameterMap or rawInputParameters in a hook script won't be copied to this map.

      • environmentVariables

        private final java.util.Map<java.lang.String,​java.lang.String> environmentVariables
        List of environment variables to pass to PADRE.
      • dynamicQueryProcessorOptions

        private final java.util.List<java.lang.String> dynamicQueryProcessorOptions

        Dynamic query processor options for PADRE, in addition to the one set in collection.cfg.

        Will be updated by the input processing.

      • priorityQueryProcessorOptions

        private final PriorityQueryProcessorOptions priorityQueryProcessorOptions
        Query processor options that are guaranteed to apply.

        Internal use only

        Since:
        15.12
      • userKeys

        private final java.util.List<java.lang.String> userKeys

        User keys for early binding Document Level Security.

      • selectedFacets

        private final java.util.Set<java.lang.String> selectedFacets

        List of selected facets.

        Contains the name of the facets that were selected, such as "Location" or "Brand", but not the actual value.

      • selectedCategoryValues

        private final java.util.Map<java.lang.String,​java.util.List<java.lang.String>> selectedCategoryValues

        List of selected facets categories.

        Contains the actual values that were selected, indexed by facet. For example: "Location" => ("Sydney", "Melbourne").

      • facetsQueryConstraints

        private java.util.List<java.lang.String> facetsQueryConstraints
        Query constraints to apply for faceted navigation (In addition to other query expressions).
      • facetCollectionConstraints

        @NonNull
        private java.util.Optional<java.util.List<java.lang.String>> facetCollectionConstraints
        The collections to restrict search to for faceted navigation. (In addition to other clive constraints).
        Since:
        15.12
      • facetsGScopeConstraints

        private java.lang.String facetsGScopeConstraints
        GScope constraints to apply for faceted navigation (In addition to existing gscope constraints).
      • impersonated

        private boolean impersonated
        Whether the request is impersonated (Document Level Security)
      • requestId

        private java.lang.String requestId
        Request identifier to log for this transaction. Depending of the collection configuration it can be an IP address, an md5 hash of the address, nothing ("-") or null.
        Since:
        12.4 - Renamed from userId, 12.5 - Renamed from userIdToLog
      • logQuery

        private java.util.Optional<java.lang.Boolean> logQuery
        Defines if the query should be logged or not, or if it should fall back to default. If false this will prevent the query from being recorded in query logs as well as session history. If not set this will result in the defaults being used. For padre the default is to follow what is in collection.cfg, profile.cfg or padre_opts.cfg, otherwise if the log option is not set in any of those files padre will log the query. This will typically be set false for system generated searches or for extra searches. This may be set from groovy scripts. This can be set to false with cgi parameters on the admin side if the request is authenticated. To do this set &log=false in the URL.
        Since:
        15.14
      • rawInputParameters

        private final java.util.Map<java.lang.String,​java.lang.String[]> rawInputParameters

        Raw input parameters

        Contains all the input parameters (query string / request parameters).

        Be aware that the value type is String array, allowing for multiple value of the same parameter (e.g. &param=value1&param=value2). Putting a single valued String in this Map will not work, it must be an array of size one. Example in a Groovy hook script:

         transaction.question.rawInputParameters["param"] = [ "value" ]
         

        inputParameterMap provides a simpler way to inject or retrieve simple mono-valued parameters. inputParameterMap and rawInputParameters are backed by the same Map: Any change made in one will be reflected in the other.

        See Also:
        inputParameterMap
      • inputParameterMap

        private final java.util.Map<java.lang.String,​java.lang.String> inputParameterMap

        Input parameters map.

        Contains all the input parameters (query string / request parameters) in a convenient fashion: Only the first value of each parameter is returned to avoid having to deal with arrays of Strings.

        For example if the query string is &param=value1&param=value2 then this map will contain only one key-value pair: param=value1. The value2 won't be available unless you use rawInputParameters.

        rawInputParameters provides a way to inject or retrieve multi-valued parameters. Both inputParameterMap and rawInputParameters are backed by the same Map: Any change made in one will be reflected in the other.

        See Also:
        rawInputParameters
      • queryStringMap

        private java.util.Map<java.lang.String,​java.util.List<java.lang.String>> queryStringMap

        Sets the query string parameter map.

        This is for internal use only and shouldn't be called outside of initializing the search question. Changing the query string map will affect all the URLs that are constructed in the data model

        Since:
        15.10
      • questionType

        private SearchQuestion.SearchQuestionType questionType

        Indicates the 'type' of question, which may trigger special processing in the search lifecycle.

        e.g. Extra searches or Content Auditor requests.

      • locale

        private java.util.Locale locale

        Locale to use for the search.

        This will affect the UI only, to configure the locale for the query processor please refer to the corresponding option -lang.

        Since:
        12.0
      • location

        private Location location

        Location information detected for the remote user based on information from their request.

        Since:
        13.0 (12.4 included a MaxMind location class directly here)
      • principal

        private java.security.Principal principal

        Principal representing the remote user for the current request.

        Will be NULL if the user isn't authenticated.

        Note: This is not included in the JSON / XML output for security reasons

        Since:
        12.2
      • hostname

        private java.lang.String hostname

        Name of the host where PADRE executed the query.

        Since:
        14.0
      • funnelbackVersion

        private com.funnelback.common.Environment.FunnelbackVersion funnelbackVersion

        Funnelback version

        Since:
        15.12
      • maxPadrePacketSize

        private java.util.Optional<java.lang.Integer> maxPadrePacketSize

        A optional maxPadrePacketSize which may be overridden to set the max Padre packet size that will be permitted. Generally the Config option ui.modern.padre_response_size_limit_bytes should be set in preference to setting this.

        Since:
        15.12
      • padreTimeout

        private java.util.Optional<java.lang.Long> padreTimeout

        A optional timeout which when set overrides the value of collection.cfg option ui.modern.padre_fork_timeout_ms, which controls how long the main padre forking may take.

        Since:
        15.12
      • customData

        private final java.util.Map<java.lang.String,​java.lang.Object> customData
        Custom data placeholder allowing any arbitrary data to be stored by hook scripts.
        Since:
        15.12
    • Constructor Detail

      • SearchQuestion

        public SearchQuestion​(ExecutionContext executionContext,
                              com.google.common.collect.ListMultimap<java.lang.String,​java.lang.String> requestHeaders,
                              java.lang.String query,
                              java.lang.String originalQuery,
                              Collection collection,
                              @NonNull
                              java.lang.String profile,
                              java.lang.String currentProfile,
                              java.lang.String[] clive,
                              @NonNull
                              java.lang.String form,
                              java.lang.String cnClickedCluster,
                              java.util.List<java.lang.String> facetsQueryConstraints,
                              @NonNull
                              java.util.Optional<java.util.List<java.lang.String>> facetCollectionConstraints,
                              java.lang.String facetsGScopeConstraints,
                              boolean impersonated,
                              java.lang.String requestId,
                              java.util.Optional<java.lang.Boolean> logQuery,
                              java.util.Map<java.lang.String,​java.util.List<java.lang.String>> queryStringMap,
                              SearchQuestion.SearchQuestionType questionType,
                              java.util.Locale locale,
                              Location location,
                              java.security.Principal principal,
                              java.lang.String hostname,
                              com.funnelback.common.Environment.FunnelbackVersion funnelbackVersion,
                              java.util.Optional<java.lang.Integer> maxPadrePacketSize,
                              java.util.Optional<java.lang.Long> padreTimeout)
      • SearchQuestion

        public SearchQuestion()
    • Method Detail

      • getCurrentProfileConfig

        public com.funnelback.config.configtypes.service.ServiceConfigReadOnly getCurrentProfileConfig()
        Returns the (modern) config of the currentProfile
      • getRawInputParameters

        public java.util.Map<java.lang.String,​java.lang.String[]> getRawInputParameters()
      • getQueryStringMapCopy

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getQueryStringMapCopy()

        Query string parameters as a Map

        Return a copy of the internal map representing the query string, for easy manipulation of individual parameters rather than having to decode the query string.

        The map is a copy intended to be modifiable to add/remove/update query string parameters.

        To convert such a map into a query string suitable for URLs, see QueryStringUtils.toString(Map, boolean)

        Returns:
        Query string parameters
        Since:
        15.10
      • isExtraSearch

        @Deprecated
        public boolean isExtraSearch()
        Deprecated.
        As of release 14.2, replaced by questionType

        Indicates if this question is part of the "main" search, or part of an "extra" search.

        This is needed to perform some actions only on the main search but not for every extra search.

      • setExtraSearch

        @Deprecated
        public void setExtraSearch​(boolean isExtraSearch)
        Deprecated.
        As of release 14.2, replaced by questionType

        Sets whether this question is part of the "main" search, or part of an "extra" search.

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getExecutionContext

        public ExecutionContext getExecutionContext()
        Execution context of the Search UI. Can be "admin" or "public", depending if the search is ran on the admin port or public port.
        Since:
        15.12
      • setExecutionContext

        public void setExecutionContext​(ExecutionContext executionContext)
        Execution context of the Search UI. Can be "admin" or "public", depending if the search is ran on the admin port or public port.
        Since:
        15.12
      • getRequestHeaders

        public com.google.common.collect.ListMultimap<java.lang.String,​java.lang.String> getRequestHeaders()
        Headers provided with the incoming search request
        Since:
        15.16
      • setRequestHeaders

        public void setRequestHeaders​(com.google.common.collect.ListMultimap<java.lang.String,​java.lang.String> requestHeaders)
        Headers provided with the incoming search request
        Since:
        15.16
      • getQuery

        public java.lang.String getQuery()

        Query terms.

        This may be transformed before being passed to PADRE, depending on the configuration.

      • setQuery

        public void setQuery​(java.lang.String query)

        Query terms.

        This may be transformed before being passed to PADRE, depending on the configuration.

      • getOriginalQuery

        public java.lang.String getOriginalQuery()
        Original query, as entered by the user.
      • setOriginalQuery

        public void setOriginalQuery​(java.lang.String originalQuery)
        Original query, as entered by the user.
      • getProfile

        @NonNull
        public java.lang.String getProfile()
        Search Profile, defaulting to "_default"
      • setProfile

        public void setProfile​(@NonNull
                               java.lang.String profile)
        Search Profile, defaulting to "_default"
      • getCurrentProfile

        public java.lang.String getCurrentProfile()
        The profile which will be used for the request. This one will always correspond to the name of a profile which exists within the selected collection. Note that this may differ from profile if the requested profile does not actually exist on disk (in which case it will be set to DefaultValues.DEFAULT_PROFILE, as that is what's used).
        Since:
        15.12
      • setCurrentProfile

        public void setCurrentProfile​(java.lang.String currentProfile)
        The profile which will be used for the request. This one will always correspond to the name of a profile which exists within the selected collection. Note that this may differ from profile if the requested profile does not actually exist on disk (in which case it will be set to DefaultValues.DEFAULT_PROFILE, as that is what's used).
        Since:
        15.12
      • getClive

        public java.lang.String[] getClive()
        Specific component of a meta-collection to query
      • setClive

        public void setClive​(java.lang.String[] clive)
        Specific component of a meta-collection to query
      • getForm

        @NonNull
        public java.lang.String getForm()
        Display form (template)
      • setForm

        public void setForm​(@NonNull
                            java.lang.String form)
        Display form (template)
      • getCnClickedCluster

        public java.lang.String getCnClickedCluster()
        Contextual Navigation: last clicked cluster
      • setCnClickedCluster

        public void setCnClickedCluster​(java.lang.String cnClickedCluster)
        Contextual Navigation: last clicked cluster
      • getCnPreviousClusters

        public java.util.List<java.lang.String> getCnPreviousClusters()
        Contextual Navigation: Previous clicked clusters
      • getMetaParameters

        public java.util.List<java.lang.String> getMetaParameters()

        meta_* / query_* input parameters, transformed in query expressions.

        Those parameters are supposed to be specified by the user, usually in an advanced search form. If you need to inject parameters for technical / behind-the-scene reasons, consider using systemMetaParameters.

        See Also:
        systemMetaParameters
      • getSystemMetaParameters

        public java.util.List<java.lang.String> getSystemMetaParameters()

        smeta_* / squery_* input parameters, transformed in query expressions.

        Those parameters are supposed to be "technical" parameters, usually injected through a hook script. If you want the user to specify parameters, consider using metaParameters.

        Since:
        12.2
        See Also:
        metaParameters
      • getAdditionalParameters

        public java.util.Map<java.lang.String,​java.lang.String[]> getAdditionalParameters()

        Additional parameters to pass as-is to PADRE.

        The values of this map will be passed through to PADRE and won't be processed at all by the Modern UI. Only parameters relevant to PADRE should be injected here.

        Depending on the parameters you want to inject or manipulate, consider using inputParameterMap or rawInputParameters. Those parameters will be processed by the Modern UI (For example to inject faceted navigation constraints).

        Note that this map is populated before the first hook script is run: Any additional parameter injected in inputParameterMap or rawInputParameters in a hook script won't be copied to this map.

      • getEnvironmentVariables

        public java.util.Map<java.lang.String,​java.lang.String> getEnvironmentVariables()
        List of environment variables to pass to PADRE.
      • getDynamicQueryProcessorOptions

        public java.util.List<java.lang.String> getDynamicQueryProcessorOptions()

        Dynamic query processor options for PADRE, in addition to the one set in collection.cfg.

        Will be updated by the input processing.

      • getPriorityQueryProcessorOptions

        public PriorityQueryProcessorOptions getPriorityQueryProcessorOptions()
        Query processor options that are guaranteed to apply.

        Internal use only

        Since:
        15.12
      • getUserKeys

        public java.util.List<java.lang.String> getUserKeys()

        User keys for early binding Document Level Security.

      • getSelectedFacets

        public java.util.Set<java.lang.String> getSelectedFacets()

        List of selected facets.

        Contains the name of the facets that were selected, such as "Location" or "Brand", but not the actual value.

      • getSelectedCategoryValues

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getSelectedCategoryValues()

        List of selected facets categories.

        Contains the actual values that were selected, indexed by facet. For example: "Location" => ("Sydney", "Melbourne").

      • getFacetsQueryConstraints

        public java.util.List<java.lang.String> getFacetsQueryConstraints()
        Query constraints to apply for faceted navigation (In addition to other query expressions).
      • setFacetsQueryConstraints

        public void setFacetsQueryConstraints​(java.util.List<java.lang.String> facetsQueryConstraints)
        Query constraints to apply for faceted navigation (In addition to other query expressions).
      • getFacetCollectionConstraints

        @NonNull
        public java.util.Optional<java.util.List<java.lang.String>> getFacetCollectionConstraints()
        The collections to restrict search to for faceted navigation. (In addition to other clive constraints).
        Since:
        15.12
      • setFacetCollectionConstraints

        public void setFacetCollectionConstraints​(@NonNull
                                                  java.util.Optional<java.util.List<java.lang.String>> facetCollectionConstraints)
        The collections to restrict search to for faceted navigation. (In addition to other clive constraints).
        Since:
        15.12
      • setFacetsGScopeConstraints

        public void setFacetsGScopeConstraints​(java.lang.String facetsGScopeConstraints)
        GScope constraints to apply for faceted navigation (In addition to existing gscope constraints).
      • getFacetsGScopeConstraints

        public java.lang.String getFacetsGScopeConstraints()
        GScope constraints to apply for faceted navigation (In addition to existing gscope constraints).
      • isImpersonated

        public boolean isImpersonated()
        Whether the request is impersonated (Document Level Security)
      • setImpersonated

        public void setImpersonated​(boolean impersonated)
        Whether the request is impersonated (Document Level Security)
      • getRequestId

        public java.lang.String getRequestId()
        Request identifier to log for this transaction. Depending of the collection configuration it can be an IP address, an md5 hash of the address, nothing ("-") or null.
        Since:
        12.4 - Renamed from userId, 12.5 - Renamed from userIdToLog
      • setRequestId

        public void setRequestId​(java.lang.String requestId)
        Request identifier to log for this transaction. Depending of the collection configuration it can be an IP address, an md5 hash of the address, nothing ("-") or null.
        Since:
        12.4 - Renamed from userId, 12.5 - Renamed from userIdToLog
      • getLogQuery

        public java.util.Optional<java.lang.Boolean> getLogQuery()
        Defines if the query should be logged or not, or if it should fall back to default. If false this will prevent the query from being recorded in query logs as well as session history. If not set this will result in the defaults being used. For padre the default is to follow what is in collection.cfg, profile.cfg or padre_opts.cfg, otherwise if the log option is not set in any of those files padre will log the query. This will typically be set false for system generated searches or for extra searches. This may be set from groovy scripts. This can be set to false with cgi parameters on the admin side if the request is authenticated. To do this set &log=false in the URL.
        Since:
        15.14
      • setLogQuery

        public void setLogQuery​(java.util.Optional<java.lang.Boolean> logQuery)
        Defines if the query should be logged or not, or if it should fall back to default. If false this will prevent the query from being recorded in query logs as well as session history. If not set this will result in the defaults being used. For padre the default is to follow what is in collection.cfg, profile.cfg or padre_opts.cfg, otherwise if the log option is not set in any of those files padre will log the query. This will typically be set false for system generated searches or for extra searches. This may be set from groovy scripts. This can be set to false with cgi parameters on the admin side if the request is authenticated. To do this set &log=false in the URL.
        Since:
        15.14
      • getInputParameterMap

        public java.util.Map<java.lang.String,​java.lang.String> getInputParameterMap()

        Input parameters map.

        Contains all the input parameters (query string / request parameters) in a convenient fashion: Only the first value of each parameter is returned to avoid having to deal with arrays of Strings.

        For example if the query string is &param=value1&param=value2 then this map will contain only one key-value pair: param=value1. The value2 won't be available unless you use rawInputParameters.

        rawInputParameters provides a way to inject or retrieve multi-valued parameters. Both inputParameterMap and rawInputParameters are backed by the same Map: Any change made in one will be reflected in the other.

        See Also:
        rawInputParameters
      • setQueryStringMap

        public void setQueryStringMap​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> queryStringMap)

        Sets the query string parameter map.

        This is for internal use only and shouldn't be called outside of initializing the search question. Changing the query string map will affect all the URLs that are constructed in the data model

        Since:
        15.10
      • getQuestionType

        public SearchQuestion.SearchQuestionType getQuestionType()

        Indicates the 'type' of question, which may trigger special processing in the search lifecycle.

        e.g. Extra searches or Content Auditor requests.

      • setQuestionType

        public void setQuestionType​(SearchQuestion.SearchQuestionType questionType)

        Indicates the 'type' of question, which may trigger special processing in the search lifecycle.

        e.g. Extra searches or Content Auditor requests.

      • getLocale

        public java.util.Locale getLocale()

        Locale to use for the search.

        This will affect the UI only, to configure the locale for the query processor please refer to the corresponding option -lang.

        Since:
        12.0
      • setLocale

        public void setLocale​(java.util.Locale locale)

        Locale to use for the search.

        This will affect the UI only, to configure the locale for the query processor please refer to the corresponding option -lang.

        Since:
        12.0
      • getLocation

        public Location getLocation()

        Location information detected for the remote user based on information from their request.

        Since:
        13.0 (12.4 included a MaxMind location class directly here)
      • setLocation

        public void setLocation​(Location location)

        Location information detected for the remote user based on information from their request.

        Since:
        13.0 (12.4 included a MaxMind location class directly here)
      • getPrincipal

        public java.security.Principal getPrincipal()

        Principal representing the remote user for the current request.

        Will be NULL if the user isn't authenticated.

        Note: This is not included in the JSON / XML output for security reasons

        Since:
        12.2
      • setPrincipal

        public void setPrincipal​(java.security.Principal principal)

        Principal representing the remote user for the current request.

        Will be NULL if the user isn't authenticated.

        Note: This is not included in the JSON / XML output for security reasons

        Since:
        12.2
      • getHostname

        public java.lang.String getHostname()

        Name of the host where PADRE executed the query.

        Since:
        14.0
      • setHostname

        public void setHostname​(java.lang.String hostname)

        Name of the host where PADRE executed the query.

        Since:
        14.0
      • getFunnelbackVersion

        public com.funnelback.common.Environment.FunnelbackVersion getFunnelbackVersion()

        Funnelback version

        Since:
        15.12
      • setFunnelbackVersion

        public void setFunnelbackVersion​(com.funnelback.common.Environment.FunnelbackVersion funnelbackVersion)

        Funnelback version

        Since:
        15.12
      • getMaxPadrePacketSize

        public java.util.Optional<java.lang.Integer> getMaxPadrePacketSize()

        A optional maxPadrePacketSize which may be overridden to set the max Padre packet size that will be permitted. Generally the Config option ui.modern.padre_response_size_limit_bytes should be set in preference to setting this.

        Since:
        15.12
      • setMaxPadrePacketSize

        public void setMaxPadrePacketSize​(java.util.Optional<java.lang.Integer> maxPadrePacketSize)

        A optional maxPadrePacketSize which may be overridden to set the max Padre packet size that will be permitted. Generally the Config option ui.modern.padre_response_size_limit_bytes should be set in preference to setting this.

        Since:
        15.12
      • getPadreTimeout

        public java.util.Optional<java.lang.Long> getPadreTimeout()

        A optional timeout which when set overrides the value of collection.cfg option ui.modern.padre_fork_timeout_ms, which controls how long the main padre forking may take.

        Since:
        15.12
      • setPadreTimeout

        public void setPadreTimeout​(java.util.Optional<java.lang.Long> padreTimeout)

        A optional timeout which when set overrides the value of collection.cfg option ui.modern.padre_fork_timeout_ms, which controls how long the main padre forking may take.

        Since:
        15.12
      • getCustomData

        public java.util.Map<java.lang.String,​java.lang.Object> getCustomData()
        Custom data placeholder allowing any arbitrary data to be stored by hook scripts.
        Since:
        15.12