Package org.opencms.search.galleries
Class CmsGallerySearch
java.lang.Object
org.opencms.search.galleries.CmsGallerySearch
Contains the functions for the gallery search.
- Since:
- 8.0.0
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetIndex()
Returns the name of the current search index.getResult
(CmsGallerySearchParameters params) Returns the gallery search result list.Returns the current gallery search index.void
Initializes the bean with the provided OpenCms context object.static CmsGallerySearchResult
searchById
(CmsObject cms, CmsUUID structureId, Locale locale) Searches by structure id.searchById
(CmsUUID id, Locale locale) Searches by structure id.searchByPath
(String path, Locale locale) Searches by structure id.static CmsGallerySearchResult
searchByPath
(CmsObject cms, String rootPath, Locale locale) Searches by structure id.void
Set the name of the index to search.void
Sets the index name according to the current project.
-
Field Details
-
m_cms
The OpenCms object used for the search.
-
-
Constructor Details
-
CmsGallerySearch
public CmsGallerySearch()
-
-
Method Details
-
searchById
public static CmsGallerySearchResult searchById(CmsObject cms, CmsUUID structureId, Locale locale) throws CmsException Searches by structure id.- Parameters:
cms
- the OpenCms context to use for the searchstructureId
- the structure id of the document to search forlocale
- the locale for which the search result should be returned- Returns:
- the search result
- Throws:
CmsException
- if something goes wrong
-
searchByPath
public static CmsGallerySearchResult searchByPath(CmsObject cms, String rootPath, Locale locale) throws CmsException Searches by structure id.- Parameters:
cms
- the OpenCms context to use for the searchrootPath
- the resource root pathlocale
- the locale for which the search result should be returned- Returns:
- the search result
- Throws:
CmsException
- if something goes wrong
-
getIndex
Returns the name of the current search index.- Returns:
- the name of the current search index
-
getResult
Returns the gallery search result list.- Parameters:
params
- the gallery search parameters- Returns:
- the gallery search result list
- Throws:
CmsException
- if the search failed
-
getSearchIndex
Returns the current gallery search index.- Returns:
- the current gallery search index
-
init
Initializes the bean with the provided OpenCms context object.- Parameters:
cms
- the OpenCms context to use for the search
-
searchById
Searches by structure id.- Parameters:
id
- the structure id of the document to search forlocale
- the locale for which the search result should be returned- Returns:
- the search result
- Throws:
CmsException
- if something goes wrong
-
searchByPath
Searches by structure id.- Parameters:
path
- the resource pathlocale
- the locale for which the search result should be returned- Returns:
- the search result
- Throws:
CmsException
- if something goes wrong
-
setIndex
Set the name of the index to search.A former search result will be deleted.
- Parameters:
indexName
- the name of the index- Throws:
CmsException
- if the index was not found
-
setIndexForProject
Sets the index name according to the current project.- Parameters:
cms
- the cms context- Throws:
CmsException
- in case setting the index fails
-