Class QueryOptions
- java.lang.Object
-
- org.alfresco.repo.search.impl.querymodel.QueryOptions
-
- Direct Known Subclasses:
CMISQueryOptions
public class QueryOptions extends java.lang.Object
The options for a query- Author:
- andyh
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QueryOptions.Connective
-
Constructor Summary
Constructors Constructor Description QueryOptions(java.lang.String query, StoreRef storeRef)
Create a CMISQueryOptions instance with the default options other than the query and store ref.QueryOptions(java.lang.String query, StoreRef storeRef, java.util.Locale locale)
Create a CMISQueryOptions instance with the default options other than the query, store ref and locale.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
addQueryTemplate(java.lang.String name, java.lang.String template)
Add/replace a query template Not all languages support query templatesstatic QueryOptions
create(SearchParameters searchParameters)
SearchParameters
getAsSearchParmeters()
java.lang.String
getDefaultFieldName()
QueryOptions.Connective
getDefaultFTSConnective()
Get the default connective used when OR and AND are not specified for the FTS contains() function.QueryOptions.Connective
getDefaultFTSFieldConnective()
As getDefaultFTSConnective() but for field groupsboolean
getExcludeTenantFilter()
java.util.List<java.util.Locale>
getLocales()
Get the list of locales to use for the queryint
getMaxItems()
Get the max number of rows for the result set 0 or less is unlimitedint
getMaxPermissionChecks()
long
getMaxPermissionCheckTimeMillis()
java.lang.Integer
getMaxRawResultSetSizeForInMemorySort()
MLAnalysisMode
getMlAnalaysisMode()
Get the mode for multi-lingual text analaysisjava.lang.String
getQuery()
Get the query stringQueryConsistency
getQueryConsistency()
java.util.List<QueryParameterDefinition>
getQueryParameterDefinitions()
Get the query parametersjava.util.Map<java.lang.String,java.lang.String>
getQueryTemplates()
Get the query templatesjava.lang.Long
getSinceTxId()
int
getSkipCount()
Get the skip count - the number of rows to skip at the start of the query.java.util.List<StoreRef>
getStores()
Get the list of stores in which to run the query.java.lang.Boolean
getUseInMemorySort()
boolean
isBulkFetchEnabled()
boolean
isIncludeInTransactionData()
Does the search include any changes made in the current transaction?void
setBulkFetchEnabled(boolean isBulkFetchEnabled)
void
setDefaultFieldName(java.lang.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(java.util.List<java.util.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(java.lang.Integer maxRawResultSetSizeForInMemorySort)
void
setMlAnalaysisMode(MLAnalysisMode mlAnalaysisMode)
Set the mode for multi-lingual text analaysisvoid
setQuery(java.lang.String query)
Set the query stringvoid
setQueryConsistency(QueryConsistency queryConsistency)
void
setQueryParameterDefinitions(java.util.List<QueryParameterDefinition> queryParameterDefinitions)
Set the query parametersvoid
setSinceTxId(java.lang.Long sinceTxId)
void
setSkipCount(int skipCount)
Set the skip count - the number of rows to skip at the start of the query.void
setStores(java.util.List<StoreRef> stores)
Set the stores against which to run the query.void
setUseInMemorySort(java.lang.Boolean useInMemorySort)
-
-
-
Constructor Detail
-
QueryOptions
public QueryOptions(java.lang.String query, StoreRef storeRef)
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
public QueryOptions(java.lang.String query, StoreRef storeRef, java.util.Locale locale)
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 Detail
-
create
public static QueryOptions create(SearchParameters searchParameters)
-
getQuery
public java.lang.String getQuery()
Get the query string- Returns:
- the query
-
setQuery
public void setQuery(java.lang.String query)
Set the query string- Parameters:
query
- the query to set
-
getStores
public java.util.List<StoreRef> 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
public void setStores(java.util.List<StoreRef> stores)
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
public QueryOptions.Connective getDefaultFTSConnective()
Get the default connective used when OR and AND are not specified for the FTS contains() function.- Returns:
- the defaultFTSConnective
-
setDefaultFTSConnective
public void setDefaultFTSConnective(QueryOptions.Connective defaultFTSConnective)
Set the default connective used when OR and AND are not specified for the FTS contains() function.- Parameters:
defaultFTSConnective
- the defaultFTSConnective to set
-
getDefaultFTSFieldConnective
public QueryOptions.Connective getDefaultFTSFieldConnective()
As getDefaultFTSConnective() but for field groups- Returns:
- the defaultFTSFieldConnective
-
setDefaultFTSFieldConnective
public void setDefaultFTSFieldConnective(QueryOptions.Connective defaultFTSFieldConnective)
As setDefaultFTSConnective() but for field groups- Parameters:
defaultFTSFieldConnective
- the defaultFTSFieldConnective to set
-
getLocales
public java.util.List<java.util.Locale> getLocales()
Get the list of locales to use for the query- Returns:
- the locales
-
setLocales
public void setLocales(java.util.List<java.util.Locale> locales)
sSet the list of locales to use for the query- Parameters:
locales
- the locales to set
-
getMlAnalaysisMode
public MLAnalysisMode getMlAnalaysisMode()
Get the mode for multi-lingual text analaysis- Returns:
- the mlAnalaysisMode
-
setMlAnalaysisMode
public void setMlAnalaysisMode(MLAnalysisMode mlAnalaysisMode)
Set the mode for multi-lingual text analaysis- Parameters:
mlAnalaysisMode
- the mlAnalaysisMode to set
-
getQueryParameterDefinitions
public java.util.List<QueryParameterDefinition> getQueryParameterDefinitions()
Get the query parameters- Returns:
- the queryParameterDefinitions
-
setQueryParameterDefinitions
public void setQueryParameterDefinitions(java.util.List<QueryParameterDefinition> queryParameterDefinitions)
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
public java.lang.String getDefaultFieldName()
- Returns:
- the default field name
-
setDefaultFieldName
public void setDefaultFieldName(java.lang.String defaultFieldName)
- Parameters:
defaultFieldName
- - the default field name to use
-
getUseInMemorySort
public java.lang.Boolean getUseInMemorySort()
- Returns:
- the useInMemorySort
-
setUseInMemorySort
public void setUseInMemorySort(java.lang.Boolean useInMemorySort)
- Parameters:
useInMemorySort
- the useInMemorySort to set
-
getMaxRawResultSetSizeForInMemorySort
public java.lang.Integer getMaxRawResultSetSizeForInMemorySort()
- Returns:
- the maxRawResultSetSizeForInMemorySort
-
setMaxRawResultSetSizeForInMemorySort
public void setMaxRawResultSetSizeForInMemorySort(java.lang.Integer maxRawResultSetSizeForInMemorySort)
- 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
public QueryConsistency getQueryConsistency()
- Returns:
- the queryConsistency
-
setQueryConsistency
public void setQueryConsistency(QueryConsistency queryConsistency)
- Parameters:
queryConsistency
- the queryConsistency to set
-
getSinceTxId
public java.lang.Long getSinceTxId()
- Returns:
- the sinceTxId
-
setSinceTxId
public void setSinceTxId(java.lang.Long sinceTxId)
- Parameters:
sinceTxId
- the sinceTxId to set
-
getQueryTemplates
public java.util.Map<java.lang.String,java.lang.String> getQueryTemplates()
Get the query templates- Returns:
- - the query templates
-
addQueryTemplate
public java.lang.String addQueryTemplate(java.lang.String name, java.lang.String template)
Add/replace a query template Not all languages support query templates- Parameters:
name
- Stringtemplate
- String- Returns:
- any removed template or null
-
getAsSearchParmeters
public SearchParameters getAsSearchParmeters()
- Returns:
- SearchParameters
-
-