Class QueryOptions
java.lang.Object
org.alfresco.repo.search.impl.querymodel.QueryOptions
- Direct Known Subclasses:
CMISQueryOptions
The options for a query
- Author:
- andyh
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionQueryOptions
(String query, StoreRef storeRef) Create a CMISQueryOptions instance with the default options other than the query and store ref.QueryOptions
(String query, StoreRef storeRef, Locale locale) Create a CMISQueryOptions instance with the default options other than the query, store ref and locale. -
Method Summary
Modifier and TypeMethodDescriptionaddQueryTemplate
(String name, String template) Add/replace a query template Not all languages support query templatesstatic QueryOptions
create
(SearchParameters searchParameters) Get the default connective used when OR and AND are not specified for the FTS contains() function.As getDefaultFTSConnective() but for field groupsboolean
Get the list of locales to use for the queryint
Get the max number of rows for the result set 0 or less is unlimitedint
long
Get the mode for multi-lingual text analaysisgetQuery()
Get the query stringGet the query parametersGet the query templatesint
Get the skip count - the number of rows to skip at the start of the query.Get the list of stores in which to run the query.boolean
boolean
Does the search include any changes made in the current transaction?void
setBulkFetchEnabled
(boolean isBulkFetchEnabled) void
setDefaultFieldName
(String defaultFieldName) void
setDefaultFTSConnective
(QueryOptions.Connective defaultFTSConnective) Set the default connective used when OR and AND are not specified for the FTS contains() function.void
setDefaultFTSFieldConnective
(QueryOptions.Connective defaultFTSFieldConnective) As setDefaultFTSConnective() but for field groupsvoid
setExcludeTenantFilter
(boolean excludeTenantFilter) void
setIncludeInTransactionData
(boolean includeInTransactionData) Set to true if the search include any changes made in the current transaction.void
setLocales
(List<Locale> locales) sSet the list of locales to use for the queryvoid
setMaxItems
(int maxItems) Set the max number of rows for the result set 0 or less is unlimitedvoid
setMaxPermissionChecks
(int maxPermissionChecks) void
setMaxPermissionCheckTimeMillis
(long maxPermissionCheckTimeMillis) void
setMaxRawResultSetSizeForInMemorySort
(Integer maxRawResultSetSizeForInMemorySort) void
setMlAnalaysisMode
(MLAnalysisMode mlAnalaysisMode) Set the mode for multi-lingual text analaysisvoid
Set the query stringvoid
setQueryConsistency
(QueryConsistency queryConsistency) void
setQueryParameterDefinitions
(List<QueryParameterDefinition> queryParameterDefinitions) Set the query parametersvoid
setSinceTxId
(Long sinceTxId) void
setSkipCount
(int skipCount) Set the skip count - the number of rows to skip at the start of the query.void
Set the stores against which to run the query.void
setUseInMemorySort
(Boolean useInMemorySort)
-
Constructor Details
-
QueryOptions
Create a CMISQueryOptions instance with the default options other than the query and store ref. The query will be run using the locale returned by I18NUtil.getLocale()- Parameters:
query
- - the query to runstoreRef
- - the store against which to run the query
-
QueryOptions
Create a CMISQueryOptions instance with the default options other than the query, store ref and locale.- Parameters:
query
- - the query to runstoreRef
- - the store against which to run the query
-
-
Method Details
-
create
-
getQuery
Get the query string- Returns:
- the query
-
setQuery
Set the query string- Parameters:
query
- the query to set
-
getStores
Get the list of stores in which to run the query. Only one store is supported at the momentOnly one store is supported at the moment- Returns:
- the stores
-
setStores
Set the stores against which to run the query. Only one store is supported at the moment.- Parameters:
stores
- the stores to set
-
getMaxItems
public int getMaxItems()Get the max number of rows for the result set 0 or less is unlimited- Returns:
- the maxItems
-
setMaxItems
public void setMaxItems(int maxItems) Set the max number of rows for the result set 0 or less is unlimited- Parameters:
maxItems
- the maxItems to set
-
getSkipCount
public int getSkipCount()Get the skip count - the number of rows to skip at the start of the query.- Returns:
- the skipCount
-
setSkipCount
public void setSkipCount(int skipCount) Set the skip count - the number of rows to skip at the start of the query.- Parameters:
skipCount
- the skipCount to set
-
getDefaultFTSConnective
Get the default connective used when OR and AND are not specified for the FTS contains() function.- Returns:
- the defaultFTSConnective
-
setDefaultFTSConnective
Set the default connective used when OR and AND are not specified for the FTS contains() function.- Parameters:
defaultFTSConnective
- the defaultFTSConnective to set
-
getDefaultFTSFieldConnective
As getDefaultFTSConnective() but for field groups- Returns:
- the defaultFTSFieldConnective
-
setDefaultFTSFieldConnective
As setDefaultFTSConnective() but for field groups- Parameters:
defaultFTSFieldConnective
- the defaultFTSFieldConnective to set
-
getLocales
Get the list of locales to use for the query- Returns:
- the locales
-
setLocales
sSet the list of locales to use for the query- Parameters:
locales
- the locales to set
-
getMlAnalaysisMode
Get the mode for multi-lingual text analaysis- Returns:
- the mlAnalaysisMode
-
setMlAnalaysisMode
Set the mode for multi-lingual text analaysis- Parameters:
mlAnalaysisMode
- the mlAnalaysisMode to set
-
getQueryParameterDefinitions
Get the query parameters- Returns:
- the queryParameterDefinitions
-
setQueryParameterDefinitions
Set the query parameters- Parameters:
queryParameterDefinitions
- the queryParameterDefinitions to set
-
isIncludeInTransactionData
public boolean isIncludeInTransactionData()Does the search include any changes made in the current transaction?- Returns:
- the includeInTransactionData
-
setIncludeInTransactionData
public void setIncludeInTransactionData(boolean includeInTransactionData) Set to true if the search include any changes made in the current transaction.- Parameters:
includeInTransactionData
- the includeInTransactionData to set
-
getMaxPermissionCheckTimeMillis
public long getMaxPermissionCheckTimeMillis()- Returns:
- the timeout in millis for permission checks
-
setMaxPermissionCheckTimeMillis
public void setMaxPermissionCheckTimeMillis(long maxPermissionCheckTimeMillis) - Parameters:
maxPermissionCheckTimeMillis
- - the timeout in millis for permission checks
-
getMaxPermissionChecks
public int getMaxPermissionChecks()- Returns:
- the max number of permission checks to carry out
-
setMaxPermissionChecks
public void setMaxPermissionChecks(int maxPermissionChecks) - Parameters:
maxPermissionChecks
- - the max number of permission checks to carry out
-
getDefaultFieldName
- Returns:
- the default field name
-
setDefaultFieldName
- Parameters:
defaultFieldName
- - the default field name to use
-
getUseInMemorySort
- Returns:
- the useInMemorySort
-
setUseInMemorySort
- Parameters:
useInMemorySort
- the useInMemorySort to set
-
getMaxRawResultSetSizeForInMemorySort
- Returns:
- the maxRawResultSetSizeForInMemorySort
-
setMaxRawResultSetSizeForInMemorySort
- Parameters:
maxRawResultSetSizeForInMemorySort
- the maxRawResultSetSizeForInMemorySort to set
-
isBulkFetchEnabled
public boolean isBulkFetchEnabled()- Returns:
- true if bulk fetch is enabled
-
setBulkFetchEnabled
public void setBulkFetchEnabled(boolean isBulkFetchEnabled) - Parameters:
isBulkFetchEnabled
- boolean
-
getExcludeTenantFilter
public boolean getExcludeTenantFilter()- Returns:
- the tenants
-
setExcludeTenantFilter
public void setExcludeTenantFilter(boolean excludeTenantFilter) - Parameters:
excludeTenantFilter
- boolean
-
getQueryConsistency
- Returns:
- the queryConsistency
-
setQueryConsistency
- Parameters:
queryConsistency
- the queryConsistency to set
-
getSinceTxId
- Returns:
- the sinceTxId
-
setSinceTxId
- Parameters:
sinceTxId
- the sinceTxId to set
-
getQueryTemplates
Get the query templates- Returns:
- - the query templates
-
addQueryTemplate
Add/replace a query template Not all languages support query templates- Parameters:
name
- Stringtemplate
- String- Returns:
- any removed template or null
-
getAsSearchParmeters
- Returns:
- SearchParameters
-