|
Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISearchManager
Search Interface which honors security placed on nodes. Node link properties are not currently supported in a search expression. Note: new methods may be added to this interface periodically -- therefore, this not a good CM extension point. The recommended extension point is at the Service Provider Interface, in package com.bea.content.spi
Here is a full example:
IMetadataQuery mQuery = FullTextQueryFactory.getMetadataQuery(); ITextQuery tQuery = FullTextQueryFactory.getTextQuery(); ITextQueryParameter textCriteria = tQuery.buildEquals(textString); IMetadataQueryParameter metadataCriteria = mQuery.buildContains("*", new String[]{metaDataString}); IFullTextSearch expression = FullTextSearchFactory.buildFullTextSearch(metadataCriteria, textCriteria, true); String repositoryPath = "/MyRepository"; Search search = new Search(repositoryPath, -1, null, expression, true); ISearchManager searchManager = ContentManagerFactory.getSearchManager(); ContentContext cc = new ContentContext(); cc.setParameter(ContentListKeys.BATCH_LOADING_SIZE_KEY, 100); ISortableFilterablePagedListresults = searchManager.search(cc, search);
The Search criteria are validated, but by default, will only print a WARNING to the WebLogic console if they are
invalid. It is recommended that you enable full validation of the search critera, which will throw an Exception for invalid
criteria; otherwise, the sort may fail to return valid or sorted results. To enable full validation, set this
repository property in your content-config.xml:
Method Summary | |
---|---|
ISortableFilterablePagedList<ID> |
idSearch(ContentContext context,
Search search)
Performs a search in the content repository and returns a list of all ID's of matching nodes in the system. |
void |
indexContentByPath(ContentContext context,
String path)
Index content by path. |
void |
indexContentByType(ContentContext context,
ID typeId)
Index content by type. |
ISortableFilterablePagedList<Node> |
postSearchSort(ContentContext context,
Search search)
Perform a search in the content repository, then sorts the results. |
ISortableFilterablePagedList<Node> |
search(ContentContext context,
Search search)
Perform a search in the content repository. |
Method Detail |
---|
ISortableFilterablePagedList<Node> search(ContentContext context, Search search) throws RepositoryException
SearchFeatureCapability.SearchKeyword
or SearchFeatureCapability.SearchMetadata
(depending on the type of Search object given.)
context
- The content context object. Refer to javadocs on ICMPagedResults for how to set paging parameters
into the context.search
- The search object
RepositoryException
- If an error happens in searchISortableFilterablePagedList<Node> postSearchSort(ContentContext context, Search search) throws RepositoryException
For example, the WLP Repository can normally only sort system properties and any manually-added explicit properties (properties mapped to a column on the CM_NODE table). Other node properties cannot normally be sorted on.
If sorting on non system properties, this method works will only return correct results if the sortcritiera includes sorting properties which are single valued
If no sortCriteria is specified, it will not sort the results. The sort criteria must be specified
as part of the search object. If specified as a ContextKey
on the
ContentContext
, then the sorting will be performed by the paging subsystem instead of the VCR. The
paging subsystem does not sort on implicit property values out of the box, so it is important to specify
the parameters to this method appropriately.
context
- The content context object. Refer to javadocs on ICMPagedResults for how to set paging parameters
into the context.search
- The search object
RepositoryException
- If an error happens in searchISortableFilterablePagedList<ID> idSearch(ContentContext context, Search search) throws RepositoryException
Repositories in the search object (or all configured repositories if no path is specified), will be ignored if
they do not support the SearchFeatureCapability.SearchKeyword
or SearchFeatureCapability.SearchMetadata
(depending on the type of Search object given.)
context
- The ContentContext object. Refer to javadocs on ICMPagedResults for how to set paging parameters
into the context.search
- The search object
RepositoryException
- If an error happens in searchvoid indexContentByPath(ContentContext context, String path) throws RepositoryException
Will throw a RepositoryException if the repository specified in the path does not support the
SearchFeatureCapability.SearchKeywordIndexPath
capability.
Events must be enabled for this to work, as it goes thru the repository event system.
context
- The ContentContext object. Refer to javadocs on ICMPagedResults for how to set paging parameters
into the context.path
- The path of the node on which to start the index operation.
RepositoryException
- If an error happensvoid indexContentByType(ContentContext context, ID typeId) throws RepositoryException
Will throw a RepositoryException if the repository specified in the path does not support the
SearchFeatureCapability.SearchKeywordIndexType
capability.
Events must be enabled for this to work, as it goes thru the repository event system.
typeId
- The id of the type.
RepositoryException
- If an error happens
|
Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |