Class QueryOptions
- java.lang.Object
-
- org.alfresco.repo.search.impl.querymodel.QueryOptions
-
- Direct Known Subclasses:
CMISQueryOptions
public class QueryOptions extends java.lang.ObjectThe options for a query- Author:
- andyh
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQueryOptions.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.StringaddQueryTemplate(java.lang.String name, java.lang.String template)Add/replace a query template Not all languages support query templatesstatic QueryOptionscreate(SearchParameters searchParameters)SearchParametersgetAsSearchParmeters()java.lang.StringgetDefaultFieldName()QueryOptions.ConnectivegetDefaultFTSConnective()Get the default connective used when OR and AND are not specified for the FTS contains() function.QueryOptions.ConnectivegetDefaultFTSFieldConnective()As getDefaultFTSConnective() but for field groupsbooleangetExcludeTenantFilter()java.util.List<java.util.Locale>getLocales()Get the list of locales to use for the queryintgetMaxItems()Get the max number of rows for the result set 0 or less is unlimitedintgetMaxPermissionChecks()longgetMaxPermissionCheckTimeMillis()java.lang.IntegergetMaxRawResultSetSizeForInMemorySort()MLAnalysisModegetMlAnalaysisMode()Get the mode for multi-lingual text analaysisjava.lang.StringgetQuery()Get the query stringQueryConsistencygetQueryConsistency()java.util.List<QueryParameterDefinition>getQueryParameterDefinitions()Get the query parametersjava.util.Map<java.lang.String,java.lang.String>getQueryTemplates()Get the query templatesjava.lang.LonggetSinceTxId()intgetSkipCount()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.BooleangetUseInMemorySort()booleanisBulkFetchEnabled()booleanisIncludeInTransactionData()Does the search include any changes made in the current transaction?voidsetBulkFetchEnabled(boolean isBulkFetchEnabled)voidsetDefaultFieldName(java.lang.String defaultFieldName)voidsetDefaultFTSConnective(QueryOptions.Connective defaultFTSConnective)Set the default connective used when OR and AND are not specified for the FTS contains() function.voidsetDefaultFTSFieldConnective(QueryOptions.Connective defaultFTSFieldConnective)As setDefaultFTSConnective() but for field groupsvoidsetExcludeTenantFilter(boolean excludeTenantFilter)voidsetIncludeInTransactionData(boolean includeInTransactionData)Set to true if the search include any changes made in the current transaction.voidsetLocales(java.util.List<java.util.Locale> locales)sSet the list of locales to use for the queryvoidsetMaxItems(int maxItems)Set the max number of rows for the result set 0 or less is unlimitedvoidsetMaxPermissionChecks(int maxPermissionChecks)voidsetMaxPermissionCheckTimeMillis(long maxPermissionCheckTimeMillis)voidsetMaxRawResultSetSizeForInMemorySort(java.lang.Integer maxRawResultSetSizeForInMemorySort)voidsetMlAnalaysisMode(MLAnalysisMode mlAnalaysisMode)Set the mode for multi-lingual text analaysisvoidsetQuery(java.lang.String query)Set the query stringvoidsetQueryConsistency(QueryConsistency queryConsistency)voidsetQueryParameterDefinitions(java.util.List<QueryParameterDefinition> queryParameterDefinitions)Set the query parametersvoidsetSinceTxId(java.lang.Long sinceTxId)voidsetSkipCount(int skipCount)Set the skip count - the number of rows to skip at the start of the query.voidsetStores(java.util.List<StoreRef> stores)Set the stores against which to run the query.voidsetUseInMemorySort(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
-
-