public class CmsGallerySearchParameters
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
class |
CmsGallerySearchParameters.CmsGallerySearchTimeRange
Helper class to store a time range.
|
static class |
CmsGallerySearchParameters.CmsGallerySortParam
Sort parameter constants.
|
限定符和类型 | 字段和说明 |
---|---|
static org.apache.lucene.search.Sort |
SORT_DATE_CREATED_ASC
Sort result documents by date of creation ascending.
|
static org.apache.lucene.search.Sort |
SORT_DATE_CREATED_DESC
Sort result documents by date of creation descending.
|
static org.apache.lucene.search.Sort |
SORT_DATE_EXPIRED_ASC
Sort result documents by date of expiration ascending.
|
static org.apache.lucene.search.Sort |
SORT_DATE_EXPIRED_DESC
Sort result documents by date of expiration descending.
|
static org.apache.lucene.search.Sort |
SORT_DATE_LASTMODIFIED_ASC
Sort result documents by date of last modification ascending.
|
static org.apache.lucene.search.Sort |
SORT_DATE_LASTMODIFIED_DESC
Sort result documents by date of last modification descending.
|
static org.apache.lucene.search.Sort |
SORT_DATE_RELEASED_ASC
Sort result documents by date of release ascending.
|
static org.apache.lucene.search.Sort |
SORT_DATE_RELEASED_DESC
Sort result documents by date of release descending.
|
static org.apache.lucene.search.Sort |
SORT_LENGTH_ASC
Sort result documents by resource length ascending, then score.
|
static org.apache.lucene.search.Sort |
SORT_LENGTH_DESC
Sort result documents by resource length descending, then score.
|
static org.apache.lucene.search.Sort |
SORT_PATH_ASC
Sort result documents by VFS path ascending.
|
static org.apache.lucene.search.Sort |
SORT_PATH_DESC
Sort result documents by VFS path descending.
|
static org.apache.lucene.search.Sort |
SORT_SCORE
Sort result documents by score.
|
static org.apache.lucene.search.Sort |
SORT_STATE_ASC
Sort result documents by resource state ascending, then score.
|
static org.apache.lucene.search.Sort |
SORT_STATE_DESC
Sort result documents by resource state descending, then score.
|
static org.apache.lucene.search.Sort |
SORT_TITLE_ASC
Sort result documents by title ascending, then score.
|
static org.apache.lucene.search.Sort |
SORT_TITLE_DESC
Sort result documents by title descending, then score.
|
static org.apache.lucene.search.Sort |
SORT_TYPE_ASC
Sort result documents by resource type ascending, then score.
|
static org.apache.lucene.search.Sort |
SORT_TYPE_DESC
Sort result documents by resource type descending, then score.
|
static org.apache.lucene.search.Sort |
SORT_USER_CREATED_ASC
Sort result documents by date user who created ascending, then date of creation.
|
static org.apache.lucene.search.Sort |
SORT_USER_CREATED_DESC
Sort result documents by date user who created descending, then date of creation.
|
static org.apache.lucene.search.Sort |
SORT_USER_LASTMODIFIED_ASC
Sort result documents by date user who did the last modification ascending, then date of last modification.
|
static org.apache.lucene.search.Sort |
SORT_USER_LASTMODIFIED_DESC
Sort result documents by date user who did the last modification descending, then date of last modification.
|
构造器和说明 |
---|
CmsGallerySearchParameters()
Default constructor.
|
限定符和类型 | 方法和说明 |
---|---|
java.util.List<java.lang.String> |
getCategories()
Returns the categories that have been included in the search.
|
protected CmsSearchParameters |
getCmsSearchParams()
Wraps this parameters to the standard search parameters, so that inherited methods in the search index
can be used.
|
java.util.List<java.lang.String> |
getContainerTypes()
Returns the container types that have been included in the search.
|
CmsGallerySearchParameters.CmsGallerySearchTimeRange |
getDateCreatedRange()
Returns the time range for the date of creation that has been used for the search result.
|
CmsGallerySearchParameters.CmsGallerySearchTimeRange |
getDateLastModifiedRange()
Returns the time range for the date of last modification that has been used for the search result.
|
java.util.List<java.lang.String> |
getFields()
Returns the list of the names of the fields to search in.
|
java.util.List<java.lang.String> |
getFolders()
Returns the list of folders to search in.
|
java.util.List<java.lang.String> |
getGalleries()
Returns the galleries that have been included in the search.
|
java.lang.String |
getLocale()
Returns the locale that has been used for the search.
|
int |
getMatchesPerPage()
Returns the maximum number of matches per result page.
|
java.lang.String |
getReferencePath()
Gets the reference path.
|
java.util.List<java.lang.String> |
getResourceTypes()
Returns the names of the resource types that have been included in the search result.
|
int |
getResultPage()
Returns the index of the requested result page.
|
CmsGallerySearchScope |
getScope()
The gallery search scope.
|
java.lang.String |
getSearchWords()
Returns the words (terms) that have been used for the full text search.
|
org.apache.lucene.search.Sort |
getSort()
Returns the Lucene sort indicated by the selected sort order.
|
CmsGallerySearchParameters.CmsGallerySortParam |
getSortOrder()
Returns the sort order that has been used in the search.
|
org.apache.lucene.search.Sort |
getTitleSort(java.lang.String locale,
boolean desc)
Returns a sort for a localized title.
|
boolean |
isIgnoreSearchExclude()
Returns the search exclude property ignore flag.
|
void |
setCategories(java.util.List<java.lang.String> categories)
Sets the categories for the search.
|
void |
setContainerTypes(java.util.List<java.lang.String> containerTypes)
Sets the container types for the search.
|
void |
setDateCreatedTimeRange(long startTime,
long endTime)
Sets the time range for the date of resource creation to consider in the search.
|
void |
setDateLastModifiedTimeRange(long startTime,
long endTime)
Sets the time range for the date of resource last modification to consider in the search.
|
void |
setFields(java.util.List<java.lang.String> fields)
Sets the list of the names of the fields to search in.
|
void |
setFolders(java.util.List<java.lang.String> folders)
Sets the folders to search in.
|
void |
setGalleries(java.util.List<java.lang.String> galleries)
Sets the galleries for the search.
|
void |
setIgnoreSearchExclude(boolean excludeForPageEditor)
Sets the search exclude property ignore flag.
|
void |
setMatchesPerPage(int matchesPerPage)
Sets the maximum number of matches per result page.
|
void |
setReferencePath(java.lang.String referencePath)
Sets the gallery reference path.
|
void |
setResourceTypes(java.util.List<java.lang.String> resourceTypes)
Sets the names of the resource types to include in the search result.
|
void |
setResultPage(int resultPage)
Sets the index of the result page that should be returned.
|
void |
setScope(CmsGallerySearchScope scope)
Sets the search scope.
|
void |
setSearchLocale(java.lang.String locale)
Sets the locale for the search.
|
void |
setSearchWords(java.lang.String words)
Sets the words (terms) for the full text search.
|
void |
setSortOrder(CmsGallerySearchParameters.CmsGallerySortParam sortOrder)
Sets the sort order for the search.
|
public static final org.apache.lucene.search.Sort SORT_DATE_CREATED_ASC
public static final org.apache.lucene.search.Sort SORT_DATE_CREATED_DESC
public static final org.apache.lucene.search.Sort SORT_DATE_EXPIRED_ASC
public static final org.apache.lucene.search.Sort SORT_DATE_EXPIRED_DESC
public static final org.apache.lucene.search.Sort SORT_DATE_LASTMODIFIED_ASC
public static final org.apache.lucene.search.Sort SORT_DATE_LASTMODIFIED_DESC
public static final org.apache.lucene.search.Sort SORT_DATE_RELEASED_ASC
public static final org.apache.lucene.search.Sort SORT_DATE_RELEASED_DESC
public static final org.apache.lucene.search.Sort SORT_LENGTH_ASC
public static final org.apache.lucene.search.Sort SORT_LENGTH_DESC
public static final org.apache.lucene.search.Sort SORT_PATH_ASC
public static final org.apache.lucene.search.Sort SORT_PATH_DESC
public static final org.apache.lucene.search.Sort SORT_SCORE
public static final org.apache.lucene.search.Sort SORT_STATE_ASC
public static final org.apache.lucene.search.Sort SORT_STATE_DESC
public static final org.apache.lucene.search.Sort SORT_TITLE_ASC
public static final org.apache.lucene.search.Sort SORT_TITLE_DESC
public static final org.apache.lucene.search.Sort SORT_TYPE_ASC
public static final org.apache.lucene.search.Sort SORT_TYPE_DESC
public static final org.apache.lucene.search.Sort SORT_USER_CREATED_ASC
public static final org.apache.lucene.search.Sort SORT_USER_CREATED_DESC
public static final org.apache.lucene.search.Sort SORT_USER_LASTMODIFIED_ASC
public static final org.apache.lucene.search.Sort SORT_USER_LASTMODIFIED_DESC
public java.util.List<java.lang.String> getCategories()
If no categories have been set, then null
is returned.
public java.util.List<java.lang.String> getContainerTypes()
public CmsGallerySearchParameters.CmsGallerySearchTimeRange getDateCreatedRange()
In case this time range has not been set, this will return an object
where the start date is equal to Long.MIN_VALUE
and the end date is equal to Long.MAX_VALUE
.
public CmsGallerySearchParameters.CmsGallerySearchTimeRange getDateLastModifiedRange()
In case this time range has not been set, this will return an object
where the start date is equal to Long.MIN_VALUE
and the end date is equal to Long.MAX_VALUE
.
public java.util.List<java.lang.String> getFields()
If this has not been set, then the default fields defined in
CmsSearchIndex.DOC_META_FIELDS
are used as default.
public java.util.List<java.lang.String> getFolders()
public java.util.List<java.lang.String> getGalleries()
If no galleries have been set, then null
is returned.
public java.lang.String getLocale()
If no locale has been set, then null
is returned.
public int getMatchesPerPage()
getMatchesPerPage()
,
setResultPage(int)
public java.lang.String getReferencePath()
public java.util.List<java.lang.String> getResourceTypes()
If no resource types have been set, then null
is returned.
public int getResultPage()
setResultPage(int)
,
getMatchesPerPage()
,
setMatchesPerPage(int)
public CmsGallerySearchScope getScope()
public java.lang.String getSearchWords()
If no search words have been set, then null
is returned.
public org.apache.lucene.search.Sort getSort()
getSortOrder()
public CmsGallerySearchParameters.CmsGallerySortParam getSortOrder()
If the sort parameter has not been set the default sort order
defined by CmsGallerySearchParameters.CmsGallerySortParam.DEFAULT
is used.
public org.apache.lucene.search.Sort getTitleSort(java.lang.String locale, boolean desc)
locale
- the locale to sort withdesc
- indicates if the sort should be descendingpublic boolean isIgnoreSearchExclude()
public void setCategories(java.util.List<java.lang.String> categories)
Results are found only if they are contained in at least one of the given categories.
categories
- the categories to setpublic void setContainerTypes(java.util.List<java.lang.String> containerTypes)
Results are found only if they are compatible with one of the given container types. If no container type is set, results compatible with any container will be returned in the search result.
containerTypes
- the container types to setpublic void setDateCreatedTimeRange(long startTime, long endTime)
startTime
- the start time of the time rangeendTime
- the end time of the time rangepublic void setDateLastModifiedTimeRange(long startTime, long endTime)
startTime
- the start time of the time rangeendTime
- the end time of the time rangepublic void setFields(java.util.List<java.lang.String> fields)
fields
- the list of names of the fields to setpublic void setFolders(java.util.List<java.lang.String> folders)
folders
- the list of VFS folderspublic void setGalleries(java.util.List<java.lang.String> galleries)
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.
galleries
- the galleries to setpublic void setIgnoreSearchExclude(boolean excludeForPageEditor)
excludeForPageEditor
- the search exclude property ignore flagpublic void setMatchesPerPage(int matchesPerPage)
Use this together with setResultPage(int)
in order to split the result
in more than one page.
matchesPerPage
- the the maximum number of matches per result page to setgetMatchesPerPage()
,
setResultPage(int)
public void setReferencePath(java.lang.String referencePath)
referencePath
- the gallery reference pathpublic void setResourceTypes(java.util.List<java.lang.String> resourceTypes)
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.
resourceTypes
- the names of the resource types to include in the search resultpublic void setResultPage(int resultPage)
Use this together with setMatchesPerPage(int)
in order to split the result
in more than one page.
resultPage
- the index of the result page to returngetResultPage()
,
getMatchesPerPage()
,
setMatchesPerPage(int)
public void setScope(CmsGallerySearchScope scope)
scope
- the search scopepublic void setSearchLocale(java.lang.String locale)
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.
locale
- the locale to setpublic void setSearchWords(java.lang.String words)
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.
words
- the words (terms) for the full text search to setpublic void setSortOrder(CmsGallerySearchParameters.CmsGallerySortParam sortOrder)
sortOrder
- the sort order to setprotected CmsSearchParameters getCmsSearchParams()