Class SearchQuestion
- java.lang.Object
-
- com.funnelback.publicui.search.model.transaction.SearchQuestion
-
public class SearchQuestion extends 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearchQuestion.RequestParameters
Common query string parameters names.static class
SearchQuestion.SearchQuestionType
Enum for identifying special types of search requests requiring special processing
-
Field Summary
Fields Modifier and Type Field Description private Map<String,String[]>
additionalParameters
Additional parameters to pass as-is to PADRE.private String[]
clive
Specific component of a meta-collection to queryprivate String
cnClickedCluster
Contextual Navigation: last clicked clusterprivate List<String>
cnPreviousClusters
Contextual Navigation: Previous clicked clustersprivate SearchPackageConfig
collection
SearchedCollection
.private String
currentProfile
The profile which will be used for the request.private Map<String,Object>
customData
Custom data placeholder allowing any arbitrary data to be stored by hook scripts.private List<String>
dynamicQueryProcessorOptions
Dynamic query processor options for PADRE, in addition to the one set in collection.cfg.private Map<String,String>
environmentVariables
List of environment variables to pass to PADRE.private ExecutionContext
executionContext
Execution context of the Search UI.private @NonNull Optional<List<String>>
facetCollectionConstraints
The collections to restrict search to for faceted navigation.private String
facetsGScopeConstraints
GScope constraints to apply for faceted navigation (In addition to existing gscope constraints).private List<String>
facetsQueryConstraints
Query constraints to apply for faceted navigation (In addition to other query expressions).private @NonNull String
form
Display form (template)private FunnelbackVersionI
funnelbackVersion
Funnelback versionprivate String
hostname
Name of the host where PADRE executed the query.private boolean
impersonated
Whether the request is impersonated (Document Level Security)private com.google.common.collect.ListMultimap<String,String>
inputParameters
Raw input parametersprivate 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 Optional<Boolean>
logQuery
Defines if the query should be logged or not, or if it should fall back to default.private Optional<Integer>
maxPadrePacketSize
A optional maxPadrePacketSize which may be overridden to set the max Padre packet size that will be permitted.private List<String>
metaParameters
meta_* / query_* input parameters, transformed in query expressions.private String
originalQuery
Original query, as entered by the user.private Optional<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 Principal
principal
Principal representing the remote user for the current request.private PriorityQueryProcessorOptions
priorityQueryProcessorOptions
Query processor options that are guaranteed to apply.private @NonNull String
profile
The profile to search with, defaulting to "_default".private String
query
Query terms.private @NonNull com.google.common.collect.ListMultimap<String,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 com.google.common.collect.ListMultimap<String,String>
requestHeaders
Headers provided with the incoming search requestprivate String
requestId
Request identifier to log for this transaction.private Map<String,List<String>>
selectedCategoryValues
List of selected facets categories.private Set<String>
selectedFacets
List of selected facets.private Function<SearchQuestion,ServiceConfig>
serviceConfigProvider
private List<String>
systemMetaParameters
smeta_* / squery_* input parameters, transformed in query expressions.private List<String>
userKeys
User keys for early binding Document Level Security.
-
Constructor Summary
Constructors Constructor Description SearchQuestion()
SearchQuestion(ExecutionContext executionContext, com.google.common.collect.ListMultimap<String,String> requestHeaders, String query, String originalQuery, SearchPackageConfig collection, @NonNull String profile, String currentProfile, Function<SearchQuestion,ServiceConfig> serviceConfigProvider, String[] clive, @NonNull String form, String cnClickedCluster, List<String> facetsQueryConstraints, @NonNull Optional<List<String>> facetCollectionConstraints, String facetsGScopeConstraints, boolean impersonated, String requestId, Optional<Boolean> logQuery, @NonNull com.google.common.collect.ListMultimap<String,String> queryStringMap, SearchQuestion.SearchQuestionType questionType, Locale locale, Location location, Principal principal, String hostname, FunnelbackVersionI funnelbackVersion, Optional<Integer> maxPadrePacketSize, Optional<Long> padreTimeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Map<String,String[]>
getAdditionalParameters()
Additional parameters to pass as-is to PADRE.String[]
getClive()
Specific component of a meta-collection to queryString
getCnClickedCluster()
Contextual Navigation: last clicked clusterList<String>
getCnPreviousClusters()
Contextual Navigation: Previous clicked clustersSearchPackageConfig
getCollection()
SearchedCollection
.String
getCurrentProfile()
The profile which will be used for the request.ServiceConfig
getCurrentProfileConfig()
Returns the (modern) config of the currentProfileMap<String,Object>
getCustomData()
Custom data placeholder allowing any arbitrary data to be stored by hook scripts.List<String>
getDynamicQueryProcessorOptions()
Dynamic query processor options for PADRE, in addition to the one set in collection.cfg.Map<String,String>
getEnvironmentVariables()
List of environment variables to pass to PADRE.ExecutionContext
getExecutionContext()
Execution context of the Search UI.@NonNull Optional<List<String>>
getFacetCollectionConstraints()
The collections to restrict search to for faceted navigation.String
getFacetsGScopeConstraints()
GScope constraints to apply for faceted navigation (In addition to existing gscope constraints).List<String>
getFacetsQueryConstraints()
Query constraints to apply for faceted navigation (In addition to other query expressions).@NonNull String
getForm()
Display form (template)FunnelbackVersionI
getFunnelbackVersion()
Funnelback versionString
getHostname()
Name of the host where PADRE executed the query.com.google.common.collect.ListMultimap<String,String>
getInputParameters()
Raw input parameterscom.google.common.collect.ListMultimap<String,String>
getInputParametersCopy()
Returns a copy of thegetInputParameters()
mapLocale
getLocale()
Locale
to use for the search.Location
getLocation()
Location
information detected for the remote user based on information from their request.Optional<Boolean>
getLogQuery()
Defines if the query should be logged or not, or if it should fall back to default.Optional<Integer>
getMaxPadrePacketSize()
A optional maxPadrePacketSize which may be overridden to set the max Padre packet size that will be permitted.List<String>
getMetaParameters()
meta_* / query_* input parameters, transformed in query expressions.String
getOriginalQuery()
Original query, as entered by the user.Optional<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.Principal
getPrincipal()
Principal representing the remote user for the current request.PriorityQueryProcessorOptions
getPriorityQueryProcessorOptions()
Query processor options that are guaranteed to apply.@NonNull String
getProfile()
The profile to search with, defaulting to "_default".String
getQuery()
Query terms.com.google.common.collect.ListMultimap<String,String>
getQueryStringMapCopy()
Query string parameters as a MapSearchQuestion.SearchQuestionType
getQuestionType()
Indicates the 'type' of question, which may trigger special processing in the search lifecycle.com.google.common.collect.ListMultimap<String,String>
getRequestHeaders()
Headers provided with the incoming search requestString
getRequestId()
Request identifier to log for this transaction.Map<String,List<String>>
getSelectedCategoryValues()
List of selected facets categories.Set<String>
getSelectedFacets()
List of selected facets.List<String>
getSystemMetaParameters()
smeta_* / squery_* input parameters, transformed in query expressions.List<String>
getUserKeys()
User keys for early binding Document Level Security.boolean
isExtraSearch()
Deprecated.As of release 14.2, replaced byquestionType
boolean
isImpersonated()
Whether the request is impersonated (Document Level Security)void
setClive(String[] clive)
Specific component of a meta-collection to queryvoid
setCnClickedCluster(String cnClickedCluster)
Contextual Navigation: last clicked clustervoid
setCollection(SearchPackageConfig collection)
SearchedCollection
.void
setCurrentProfile(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 byquestionType
void
setFacetCollectionConstraints(@NonNull Optional<List<String>> facetCollectionConstraints)
The collections to restrict search to for faceted navigation.void
setFacetsGScopeConstraints(String facetsGScopeConstraints)
GScope constraints to apply for faceted navigation (In addition to existing gscope constraints).void
setFacetsQueryConstraints(List<String> facetsQueryConstraints)
Query constraints to apply for faceted navigation (In addition to other query expressions).void
setForm(@NonNull String form)
Display form (template)void
setFunnelbackVersion(FunnelbackVersionI funnelbackVersion)
Funnelback versionvoid
setHostname(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(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(Optional<Boolean> logQuery)
Defines if the query should be logged or not, or if it should fall back to default.void
setMaxPadrePacketSize(Optional<Integer> maxPadrePacketSize)
A optional maxPadrePacketSize which may be overridden to set the max Padre packet size that will be permitted.void
setOriginalQuery(String originalQuery)
Original query, as entered by the user.void
setPadreTimeout(Optional<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(Principal principal)
Principal representing the remote user for the current request.void
setProfile(@NonNull String profile)
The profile to search with, defaulting to "_default".void
setQuery(String query)
Query terms.void
setQueryStringMap(@NonNull com.google.common.collect.ListMultimap<String,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<String,String> requestHeaders)
Headers provided with the incoming search requestvoid
setRequestId(String requestId)
Request identifier to log for this transaction.void
setServiceConfigProvider(Function<SearchQuestion,ServiceConfig> serviceConfigProvider)
String
toString()
-
-
-
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<String,String> requestHeaders
Headers provided with the incoming search request- Since:
- 15.16
-
query
private String query
Query terms.
This may be transformed before being passed to PADRE, depending on the configuration.
-
originalQuery
private String originalQuery
Original query, as entered by the user.
-
collection
private SearchPackageConfig collection
SearchedCollection
.
-
profile
@NonNull private @NonNull String profile
The profile to search with, defaulting to "_default".
-
currentProfile
private 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
-
serviceConfigProvider
private Function<SearchQuestion,ServiceConfig> serviceConfigProvider
-
clive
private String[] clive
Specific component of a meta-collection to query
-
form
@NonNull private @NonNull String form
Display form (template)
-
cnClickedCluster
private String cnClickedCluster
Contextual Navigation: last clicked cluster
-
cnPreviousClusters
private final List<String> cnPreviousClusters
Contextual Navigation: Previous clicked clusters
-
metaParameters
private final List<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 List<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 Map<String,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
inputParameters
. 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
inputParameters
in a hook script won't be copied to this map.
-
environmentVariables
private final Map<String,String> environmentVariables
List of environment variables to pass to PADRE.
-
dynamicQueryProcessorOptions
private final List<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
-
selectedFacets
private final Set<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 Map<String,List<String>> selectedCategoryValues
List of selected facets categories.
Contains the actual values that were selected, indexed by facet. For example: "Location" => ("Sydney", "Melbourne").
-
facetsQueryConstraints
private List<String> facetsQueryConstraints
Query constraints to apply for faceted navigation (In addition to other query expressions).
-
facetCollectionConstraints
@NonNull private @NonNull Optional<List<String>> facetCollectionConstraints
The collections to restrict search to for faceted navigation. (In addition to other clive constraints).- Since:
- 15.12
-
facetsGScopeConstraints
private 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 String requestId
Request identifier to log for this transaction. Depending on 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 fromuserIdToLog
-
logQuery
private Optional<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
-
inputParameters
private final com.google.common.collect.ListMultimap<String,String> inputParameters
Raw input parameters
Contains all the input parameters (query string / request parameters).
Be aware that the value type is
ListMultimap
, thus a single key can have multiple values alsoListMultimap.get(Object)
will never return null.In freemarker to get the first value for a key or empty:
question.inputParameters["query"]?first!
In freemarker to test if the key exists and therefore has values:
question.inputParameters?keys?seq_contains("query")
In Java to replace all values for a key:
A clone of this map can be made withinputParameters.replaceValues("query", List.of("my new query"))
getInputParametersCopy()
.To convert such a map into a query string suitable for URLs, see
QueryStringUtils#toString(ListMultimap, boolean)
- Since:
- 16.0
-
queryStringMap
@NonNull private @NonNull com.google.common.collect.ListMultimap<String,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.26
-
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 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 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 String hostname
Name of the host where PADRE executed the query.
- Since:
- 14.0
-
funnelbackVersion
private FunnelbackVersionI funnelbackVersion
Funnelback version
- Since:
- 15.12
-
maxPadrePacketSize
private Optional<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 Optional<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
-
-
Constructor Detail
-
SearchQuestion
public SearchQuestion(ExecutionContext executionContext, com.google.common.collect.ListMultimap<String,String> requestHeaders, String query, String originalQuery, SearchPackageConfig collection, @NonNull @NonNull String profile, String currentProfile, Function<SearchQuestion,ServiceConfig> serviceConfigProvider, String[] clive, @NonNull @NonNull String form, String cnClickedCluster, List<String> facetsQueryConstraints, @NonNull @NonNull Optional<List<String>> facetCollectionConstraints, String facetsGScopeConstraints, boolean impersonated, String requestId, Optional<Boolean> logQuery, @NonNull @NonNull com.google.common.collect.ListMultimap<String,String> queryStringMap, SearchQuestion.SearchQuestionType questionType, Locale locale, Location location, Principal principal, String hostname, FunnelbackVersionI funnelbackVersion, Optional<Integer> maxPadrePacketSize, Optional<Long> padreTimeout)
-
SearchQuestion
public SearchQuestion()
-
-
Method Detail
-
getCurrentProfileConfig
public ServiceConfig getCurrentProfileConfig()
Returns the (modern) config of the currentProfile
-
getInputParametersCopy
public com.google.common.collect.ListMultimap<String,String> getInputParametersCopy()
Returns a copy of the
getInputParameters()
mapBe aware that the value type is
ListMultimap
, thus a single key can have multiple values alsoListMultimap.get(Object)
will never return null.- Returns:
-
getQueryStringMapCopy
public com.google.common.collect.ListMultimap<String,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(MultiMap, boolean)
- Returns:
- Query string parameters
- Since:
- 15.10
-
isExtraSearch
@Deprecated public boolean isExtraSearch()
Deprecated.As of release 14.2, replaced byquestionType
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 byquestionType
Sets whether this question is part of the "main" search, or part of an "extra" search.
-
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<String,String> getRequestHeaders()
Headers provided with the incoming search request- Since:
- 15.16
-
setRequestHeaders
public void setRequestHeaders(com.google.common.collect.ListMultimap<String,String> requestHeaders)
Headers provided with the incoming search request- Since:
- 15.16
-
getQuery
public String getQuery()
Query terms.
This may be transformed before being passed to PADRE, depending on the configuration.
-
setQuery
public void setQuery(String query)
Query terms.
This may be transformed before being passed to PADRE, depending on the configuration.
-
getOriginalQuery
public String getOriginalQuery()
Original query, as entered by the user.
-
setOriginalQuery
public void setOriginalQuery(String originalQuery)
Original query, as entered by the user.
-
getCollection
public SearchPackageConfig getCollection()
SearchedCollection
.
-
setCollection
public void setCollection(SearchPackageConfig collection)
SearchedCollection
.
-
getProfile
@NonNull public @NonNull String getProfile()
The profile to search with, defaulting to "_default".
-
setProfile
public void setProfile(@NonNull @NonNull String profile)
The profile to search with, defaulting to "_default".
-
getCurrentProfile
public 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(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
-
setServiceConfigProvider
public void setServiceConfigProvider(Function<SearchQuestion,ServiceConfig> serviceConfigProvider)
-
getClive
public String[] getClive()
Specific component of a meta-collection to query
-
setClive
public void setClive(String[] clive)
Specific component of a meta-collection to query
-
getForm
@NonNull public @NonNull String getForm()
Display form (template)
-
setForm
public void setForm(@NonNull @NonNull String form)
Display form (template)
-
getCnClickedCluster
public String getCnClickedCluster()
Contextual Navigation: last clicked cluster
-
setCnClickedCluster
public void setCnClickedCluster(String cnClickedCluster)
Contextual Navigation: last clicked cluster
-
getCnPreviousClusters
public List<String> getCnPreviousClusters()
Contextual Navigation: Previous clicked clusters
-
getMetaParameters
public List<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 List<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 Map<String,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
inputParameters
. 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
inputParameters
in a hook script won't be copied to this map.
-
getEnvironmentVariables
public Map<String,String> getEnvironmentVariables()
List of environment variables to pass to PADRE.
-
getDynamicQueryProcessorOptions
public List<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
-
getSelectedFacets
public Set<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 Map<String,List<String>> getSelectedCategoryValues()
List of selected facets categories.
Contains the actual values that were selected, indexed by facet. For example: "Location" => ("Sydney", "Melbourne").
-
getFacetsQueryConstraints
public List<String> getFacetsQueryConstraints()
Query constraints to apply for faceted navigation (In addition to other query expressions).
-
setFacetsQueryConstraints
public void setFacetsQueryConstraints(List<String> facetsQueryConstraints)
Query constraints to apply for faceted navigation (In addition to other query expressions).
-
getFacetCollectionConstraints
@NonNull public @NonNull Optional<List<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 @NonNull Optional<List<String>> facetCollectionConstraints)
The collections to restrict search to for faceted navigation. (In addition to other clive constraints).- Since:
- 15.12
-
setFacetsGScopeConstraints
public void setFacetsGScopeConstraints(String facetsGScopeConstraints)
GScope constraints to apply for faceted navigation (In addition to existing gscope constraints).
-
getFacetsGScopeConstraints
public 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 String getRequestId()
Request identifier to log for this transaction. Depending on 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 fromuserIdToLog
-
setRequestId
public void setRequestId(String requestId)
Request identifier to log for this transaction. Depending on 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 fromuserIdToLog
-
getLogQuery
public Optional<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(Optional<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
-
getInputParameters
public com.google.common.collect.ListMultimap<String,String> getInputParameters()
Raw input parameters
Contains all the input parameters (query string / request parameters).
Be aware that the value type is
ListMultimap
, thus a single key can have multiple values alsoListMultimap.get(Object)
will never return null.In freemarker to get the first value for a key or empty:
question.inputParameters["query"]?first!
In freemarker to test if the key exists and therefore has values:
question.inputParameters?keys?seq_contains("query")
In Java to replace all values for a key:
A clone of this map can be made withinputParameters.replaceValues("query", List.of("my new query"))
getInputParametersCopy()
.To convert such a map into a query string suitable for URLs, see
QueryStringUtils#toString(ListMultimap, boolean)
- Since:
- 16.0
-
setQueryStringMap
public void setQueryStringMap(@NonNull @NonNull com.google.common.collect.ListMultimap<String,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.26
-
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 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(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 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(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 String getHostname()
Name of the host where PADRE executed the query.
- Since:
- 14.0
-
setHostname
public void setHostname(String hostname)
Name of the host where PADRE executed the query.
- Since:
- 14.0
-
getFunnelbackVersion
public FunnelbackVersionI getFunnelbackVersion()
Funnelback version
- Since:
- 15.12
-
setFunnelbackVersion
public void setFunnelbackVersion(FunnelbackVersionI funnelbackVersion)
Funnelback version
- Since:
- 15.12
-
getMaxPadrePacketSize
public Optional<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(Optional<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 Optional<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(Optional<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
-
-