|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.search.CmsSearchIndex
org.opencms.search.galleries.CmsGallerySearchIndex
public class CmsGallerySearchIndex
Implements the search within a the gallery index.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.opencms.search.CmsSearchIndex |
|---|
CmsSearchIndex.LazyContentReader |
| Field Summary | |
|---|---|
static java.lang.String |
FOLDER_SYSTEM
The system folder. |
static java.lang.String |
FOLDER_SYSTEM_GALLERIES
The system galleries path. |
static java.lang.String |
FOLDER_SYTEM_MODULES
The system modules folder path. |
static java.lang.String |
GALLERY_INDEX_NAME
The advanced gallery index name. |
static java.lang.String |
TYPE_XMLCONTENT_GALLERIES
The gallery document type name for xml-contents. |
static java.lang.String |
TYPE_XMLPAGE_GALLERIES
The gallery document type name for xml-pages. |
| Fields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler |
|---|
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD |
| Constructor Summary | |
|---|---|
CmsGallerySearchIndex()
Default constructor only intended to be used by the XML configuration. |
|
CmsGallerySearchIndex(java.lang.String name)
Creates a new gallery search index with the given name. |
|
| Method Summary | |
|---|---|
protected org.apache.lucene.search.BooleanFilter |
appendContainerTypeFilter(CmsObject cms,
org.apache.lucene.search.BooleanFilter filter,
java.util.List<java.lang.String> containers)
Appends a container type filter to the given filter clause that matches all given container types. |
protected org.apache.lucene.search.BooleanFilter |
appendIgnoreSearchExclude(org.apache.lucene.search.BooleanFilter filter,
boolean ignoreSearchExclude)
Appends the ignore search exclude property filter. |
protected org.apache.lucene.search.BooleanFilter |
appendLocaleFilter(CmsObject cms,
org.apache.lucene.search.BooleanFilter filter,
java.lang.String locale)
Appends the locale filter to the given filter clause that matches the given locale. |
protected org.apache.lucene.search.BooleanFilter |
appendPathFilter(CmsObject cms,
org.apache.lucene.search.BooleanFilter filter,
java.util.List<java.lang.String> roots)
Appends the a VFS path filter to the given filter clause that matches all given root paths. |
protected boolean |
excludeFromIndex(CmsObject cms,
CmsResource resource)
Checks if the provided resource should be excluded from this search index. |
I_CmsSearchDocument |
getDocument(CmsUUID structureId)
Deprecated. Use CmsSearchIndex.getDocument(String, String) instead and provide CmsGallerySearchFieldMapping.FIELD_RESOURCE_STRUCTURE_ID as field to search in |
I_CmsDocumentFactory |
getDocumentFactory(CmsResource res)
Returns the document type factory used for the given resource in this index, or null
in case the resource is not indexed by this index. |
protected java.util.List<java.lang.String> |
getLocaleExtendedFields(java.util.List<java.lang.String> fields,
java.util.Locale locale)
Returns a list of locale extended field names. |
java.util.Locale |
getLocaleForResource(CmsObject cms,
CmsResource resource,
java.util.List<java.util.Locale> availableLocales)
Returns the language locale for the given resource in this index. |
protected CmsResource |
getResource(CmsObject cms,
I_CmsSearchDocument doc)
We are overriding getResource since the default implementation uses the path to read the resource, which doesn't work for resources in a different site. |
java.util.List<java.lang.String> |
getSearchRootsForScope(CmsGallerySearchScope scope,
java.lang.String siteParam,
java.lang.String subSiteParam)
Gets the search roots to use for the given site/subsite parameters. |
CmsGallerySearchResultList |
searchGallery(CmsObject cms,
CmsGallerySearchParameters params)
Performs a search on the gallery index. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String FOLDER_SYSTEM
public static final java.lang.String FOLDER_SYSTEM_GALLERIES
public static final java.lang.String FOLDER_SYTEM_MODULES
public static final java.lang.String GALLERY_INDEX_NAME
public static final java.lang.String TYPE_XMLCONTENT_GALLERIES
public static final java.lang.String TYPE_XMLPAGE_GALLERIES
| Constructor Detail |
|---|
public CmsGallerySearchIndex()
It is recommended to use the constructor
as it enforces the mandatory name argument. CmsGallerySearchIndex(String)
public CmsGallerySearchIndex(java.lang.String name)
throws CmsIllegalArgumentException
name - the system-wide unique name for the search index
CmsIllegalArgumentException - if the given name is null, empty or already taken by another search index| Method Detail |
|---|
@Deprecated public I_CmsSearchDocument getDocument(CmsUUID structureId)
CmsSearchIndex.getDocument(String, String) instead and provide CmsGallerySearchFieldMapping.FIELD_RESOURCE_STRUCTURE_ID as field to search in
structureId - the structure id of the document to retrieve
public I_CmsDocumentFactory getDocumentFactory(CmsResource res)
CmsSearchIndexnull
in case the resource is not indexed by this index.A resource is indexed if the following is all true:
getDocumentFactory in class CmsSearchIndexres - the resource to check
null
in case the resource is not indexed by this indexCmsSearchIndex.getDocumentFactory(org.opencms.file.CmsResource)
public java.util.Locale getLocaleForResource(CmsObject cms,
CmsResource resource,
java.util.List<java.util.Locale> availableLocales)
getLocaleForResource in class CmsSearchIndexcms - the current OpenCms user contextresource - the resource to checkavailableLocales - a list of locales supported by the resource
public java.util.List<java.lang.String> getSearchRootsForScope(CmsGallerySearchScope scope,
java.lang.String siteParam,
java.lang.String subSiteParam)
scope - the search scopesiteParam - the current sitesubSiteParam - the current subsite
public CmsGallerySearchResultList searchGallery(CmsObject cms,
CmsGallerySearchParameters params)
throws CmsSearchException
cms - the current users OpenCms contextparams - the parameters to use for the search
CmsSearchException - if something goes wrong
protected org.apache.lucene.search.BooleanFilter appendContainerTypeFilter(CmsObject cms,
org.apache.lucene.search.BooleanFilter filter,
java.util.List<java.lang.String> containers)
In case the provided List is null or empty, the original filter is left unchanged.
The original filter parameter is extended and also provided as return value.
cms - the current OpenCms search contextfilter - the filter to extendcontainers - the containers that will compose the filter
protected org.apache.lucene.search.BooleanFilter appendIgnoreSearchExclude(org.apache.lucene.search.BooleanFilter filter,
boolean ignoreSearchExclude)
filter - the filter to extendignoreSearchExclude - true if the search exclude property should be ignored
protected org.apache.lucene.search.BooleanFilter appendLocaleFilter(CmsObject cms,
org.apache.lucene.search.BooleanFilter filter,
java.lang.String locale)
In case the provided List is null or empty, the original filter is left unchanged.
The original filter parameter is extended and also provided as return value.
cms - the current OpenCms search contextfilter - the filter to extendlocale - the locale that will compose the filter
protected org.apache.lucene.search.BooleanFilter appendPathFilter(CmsObject cms,
org.apache.lucene.search.BooleanFilter filter,
java.util.List<java.lang.String> roots)
In case the provided List is null or empty, the current request context site root is appended.
The original filter parameter is extended and also provided as return value.
appendPathFilter in class CmsSearchIndexcms - the current OpenCms search contextfilter - the filter to extendroots - the VFS root paths that will compose the filter
protected boolean excludeFromIndex(CmsObject cms,
CmsResource resource)
excludeFromIndex in class CmsSearchIndexcms - the OpenCms context used for building the search indexresource - the resource to index
protected java.util.List<java.lang.String> getLocaleExtendedFields(java.util.List<java.lang.String> fields,
java.util.Locale locale)
fields - the field name to extendlocale - the locale to extend the field names with
protected CmsResource getResource(CmsObject cms,
I_CmsSearchDocument doc)
getResource in class CmsSearchIndexcms - the OpenCms user context to use for permission testingdoc - the search result document to check
CmsResource or null if the user is not permittedCmsSearchIndex.getResource(org.opencms.file.CmsObject, org.opencms.search.I_CmsSearchDocument)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||