Class CmsGallerySearchParameters
- Since:
- 8.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSort parameter constants. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the categories that have been included in the search.org.opencms.search.galleries.CmsGallerySearchParameters.CmsGallerySearchTimeRangeReturns the time range for the date of creation that has been used for the search result.org.opencms.search.galleries.CmsGallerySearchParameters.CmsGallerySearchTimeRangeReturns the time range for the dadelete examplete of last modification that has been used for the search result.Gets the set of structure IDs of functions to exclude from the search result.Returns the list of folders to search in.Returns the galleries that have been included in the search.Gets the set of ids of functions to include.Returns the locale that has been used for the search.intReturns the maximum number of matches per result page.Returns a CmsSolrQuery representation of this class.Gets the reference path.Returns the names of the resource types that have been included in the search result.intReturns the index of the requested result page.getScope()The gallery search scope.Returns the words (terms) that have been used for the full text search.Returns the sort order that has been used in the search.Gets the template compatibility.booleanIf this returns true, an empty search result should be returned, regardless of other settings.booleanReturns the search exclude property ignore flag.booleanReturns a flag, indicating if release and expiration date should be ignored.voidsetCategories(List<String> categories) Sets the categories for the search.voidsetDateCreatedTimeRange(long startTime, long endTime) Sets the time range for the date of resource creation to consider in the search.voidsetDateLastModifiedTimeRange(long startTime, long endTime) Sets the time range for the date of resource last modification to consider in the search.voidsetExcludedFunctions(Set<CmsUUID> excludedFunctions) Sets the structure IDs of functions to exclude from the search results.voidsetFolders(List<String> folders) Sets the folders to search in.voidsetForceEmptyResult(boolean forceEmptyResult) Enables/disables the 'force empty result' flag.voidsetFunctionAvailability(CmsFunctionAvailability dynamicFunctionAvailability) Sets the dynamic function availability.voidsetGalleries(List<String> galleries) Sets the galleries for the search.voidsetIgnoreSearchExclude(boolean excludeForPageEditor) Sets the search exclude property ignore flag.voidsetIncludedFunctions(Set<CmsUUID> includedFunctions) Sets the ids of functions to include.voidsetIncludeExpired(boolean includeExpired) Set the flag, determining if expired and unreleased resources should be shown.voidsetMatchesPerPage(int matchesPerPage) Sets the maximum number of matches per result page.voidsetReferencePath(String referencePath) Sets the gallery reference path.voidsetResourceTypes(List<String> resourceTypes) Sets the names of the resource types to include in the search result.voidsetResultPage(int resultPage) Sets the index of the result page that should be returned.voidsetScope(CmsGallerySearchScope scope) Sets the search scope.voidsetSearchLocale(String locale) Sets the locale for the search.voidsetSearchWords(String words) Sets the words (terms) for the full text search.voidSets the sort order for the search.voidsetTemplateCompatibility(String compatibility) Sets the template compatibility string.
-
Constructor Details
-
CmsGallerySearchParameters
public CmsGallerySearchParameters()Default constructor.
-
-
Method Details
-
getCategories
Returns the categories that have been included in the search.If no categories have been set, then
nullis returned.- Returns:
- the categories that have been included in the search
-
getDateCreatedRange
public org.opencms.search.galleries.CmsGallerySearchParameters.CmsGallerySearchTimeRange getDateCreatedRange()Returns the time range for the date of creation that has been used for the search result.In case this time range has not been set, this will return an object where the start date is equal to
Long.MIN_VALUEand the end date is equal toLong.MAX_VALUE.- Returns:
- the time range for the date of creation that has been used for the search result
-
getDateLastModifiedRange
public org.opencms.search.galleries.CmsGallerySearchParameters.CmsGallerySearchTimeRange getDateLastModifiedRange()Returns the time range for the dadelete examplete of last modification that has been used for the search result.In case this time range has not been set, this will return an object where the start date is equal to
Long.MIN_VALUEand the end date is equal toLong.MAX_VALUE.- Returns:
- the time range for the date of last modification that has been used for the search result
-
getExcludedFunctions
Gets the set of structure IDs of functions to exclude from the search result.- Returns:
- the set of structure IDs to exclude
-
getFolders
Returns the list of folders to search in.- Returns:
- a list of paths of VFS folders
-
getGalleries
Returns the galleries that have been included in the search.If no galleries have been set, then
nullis returned.- Returns:
- the galleries that have been included in the search
-
getIncludedFunctions
Gets the set of ids of functions to include.Note: If the id of a function is returned in the ID set returned by thsi method, the function may still be excluded from search results based on other parameters.
- Returns:
- the included functions
-
getLocale
Returns the locale that has been used for the search.If no locale has been set, then
nullis returned.- Returns:
- the locale that has been used for the search
-
getMatchesPerPage
Returns the maximum number of matches per result page.- Returns:
- the the maximum number of matches per result page
- See Also:
-
getQuery
Returns a CmsSolrQuery representation of this class.- Parameters:
cms- the openCms object.- Returns:
- CmsSolrQuery representation of this class.
-
getReferencePath
Gets the reference path.- Returns:
- the gallery reference path
-
getResourceTypes
Returns the names of the resource types that have been included in the search result.If no resource types have been set, then
nullis returned.- Returns:
- the names of the resource types that have been included in the search result
-
getResultPage
Returns the index of the requested result page.- Returns:
- the index of the requested result page
- See Also:
-
getScope
The gallery search scope.- Returns:
- the gallery search scope
-
getSearchWords
Returns the words (terms) that have been used for the full text search.If no search words have been set, then
nullis returned.- Returns:
- the words (terms) that have been used for the full text search
-
getSortOrder
Returns the sort order that has been used in the search.If the sort parameter has not been set the default sort order defined by
CmsGallerySearchParameters.CmsGallerySortParam.DEFAULTis used.- Returns:
- the sort order that has been used in the search
-
getTemplateCompatibility
Gets the template compatibility.If set, matches those resources whose template.compatibility property is either empty or contains the value (possibly together with other values, separated by whitespace).
- Returns:
- the template compatibility
-
isForceEmptyResult
If this returns true, an empty search result should be returned, regardless of other settings.- Returns:
- true if an empty search result should be forced
-
isIgnoreSearchExclude
Returns the search exclude property ignore flag.- Returns:
- the search exclude property ignore flag
-
isIncludeExpired
Returns a flag, indicating if release and expiration date should be ignored.- Returns:
- a flag, indicating if release and expiration date should be ignored
-
setCategories
Sets the categories for the search.Results are found only if they are contained in at least one of the given categories.
- Parameters:
categories- the categories to set
-
setDateCreatedTimeRange
Sets the time range for the date of resource creation to consider in the search.- Parameters:
startTime- the start time of the time rangeendTime- the end time of the time range
-
setDateLastModifiedTimeRange
Sets the time range for the date of resource last modification to consider in the search.- Parameters:
startTime- the start time of the time rangeendTime- the end time of the time range
-
setExcludedFunctions
Sets the structure IDs of functions to exclude from the search results.- Parameters:
excludedFunctions- the structure IDs of functions to exclude
-
setFolders
Sets the folders to search in.- Parameters:
folders- the list of VFS folders
-
setForceEmptyResult
Enables/disables the 'force empty result' flag. If this is set to true, an empty search result should be returned regardless of the other parameters.- Parameters:
forceEmptyResult- if true, force an empty search result
-
setFunctionAvailability
Sets the dynamic function availability.- Parameters:
dynamicFunctionAvailability- the dynamic function availability
-
setGalleries
Sets the galleries for the search.Results are found only if they are contained in one of the given galleries. If no gallery is set, results from all galleries will be returned in the search result.
- Parameters:
galleries- the galleries to set
-
setIgnoreSearchExclude
Sets the search exclude property ignore flag.- Parameters:
excludeForPageEditor- the search exclude property ignore flag
-
setIncludedFunctions
Sets the ids of functions to include.- Parameters:
includedFunctions- the ids of functions to include
-
setIncludeExpired
Set the flag, determining if expired and unreleased resources should be shown.- Parameters:
includeExpired- ifftrueexpired and unreleased resources are shown.
-
setMatchesPerPage
Sets the maximum number of matches per result page.Use this together with
setResultPage(int)in order to split the result in more than one page.- Parameters:
matchesPerPage- the the maximum number of matches per result page to set- See Also:
-
setReferencePath
Sets the gallery reference path.- Parameters:
referencePath- the gallery reference path
-
setResourceTypes
Sets the names of the resource types to include in the search result.Results are found only if they resources match one of the given resource type names. If no resource type name is set, all resource types will be returned in the search result.
- Parameters:
resourceTypes- the names of the resource types to include in the search result
-
setResultPage
Sets the index of the result page that should be returned.Use this together with
setMatchesPerPage(int)in order to split the result in more than one page.- Parameters:
resultPage- the index of the result page to return- See Also:
-
setSearchLocale
Sets the locale for the search.Results are found only if they match the given locale. If no locale is set, results for all locales will be returned in the search result.
- Parameters:
locale- the locale to set
-
setSearchWords
Sets the words (terms) for the full text search.Results are found only if they text extraction for the resource contains all given search words. If no search word is set, all resources will be returned in the search result.
Please note that this should be a list of words separated by white spaces. Simple Lucene modifiers such as (+), (-) and (*) are allowed, but anything more complex then this will be removed.
- Parameters:
words- the words (terms) for the full text search to set
-
setSortOrder
Sets the sort order for the search.- Parameters:
sortOrder- the sort order to set
-
setTemplateCompatibility
Sets the template compatibility string.- Parameters:
compatibility- the template compatibility string
-