com.bea.content.federated
Interface ISearchManager


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);
     ISortableFilterablePagedList results = 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: Run additional checks against search criteria searchValidation true

This interface is intended to be implemented only by Oracle Weblogic Portal. Oracle Systems reserves the right to add abstract methods to this interface without notice. Implementations of this interface by other parties must not be expected to compile without change in future versions of Oracle Weblogic Portal.

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

search

ISortableFilterablePagedList<Node> search(ContentContext context,
                                          Search search)
                                          throws RepositoryException
Perform a search in the content repository. 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.)

Parameters
context - The content context object. Refer to javadocs on ICMPagedResults for how to set paging parameters into the context.
search - The search object
Returns
An paged result set containing the matching nodes that the caller has VIEW privileges on.
Throws
RepositoryException - If an error happens in search

postSearchSort

ISortableFilterablePagedList<Node> postSearchSort(ContentContext context,
                                                  Search search)
                                                  throws RepositoryException
Perform a search in the content repository, then sorts the results. This is less efficient than a standard search, but allows one to sort the results on type (object class) properties, which is not normally possible.

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.

Parameters
context - The content context object. Refer to javadocs on ICMPagedResults for how to set paging parameters into the context.
search - The search object
Returns
A sorted paged result set containing the matching nodes that the caller has VIEW privileges on.
Throws
RepositoryException - If an error happens in search

idSearch

ISortableFilterablePagedList<ID> idSearch(ContentContext context,
                                          Search search)
                                          throws RepositoryException
Performs a search in the content repository and returns a list of all ID's of matching nodes in the system. This list will return all matching node Ids, irrespective of whether or not a user has view privileges on the node or not. The user can pass this array to the getNodes() method to retrieve the nodes in the system.

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.)

Parameters
context - The ContentContext object. Refer to javadocs on ICMPagedResults for how to set paging parameters into the context.
search - The search object
Returns
An page iterator of id objects
Throws
RepositoryException - If an error happens in search

indexContentByPath

void indexContentByPath(ContentContext context,
                        String path)
                        throws RepositoryException
Index content by path. All content at the given path and below will be indexed. This method is provided as a convenience. If a repository has been running without search indexing enabled (either repository events were disabled, or the search listener was not configured), then this method can be used to reindex content. This method should be used sparingly, as it can be quite expensive given a large amount of content.

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.

Parameters
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.
Throws
RepositoryException - If an error happens

indexContentByType

void indexContentByType(ContentContext context,
                        ID typeId)
                        throws RepositoryException
Index content by type. All content for the given type will be indexed. This method is provided as a convenience. If a repository has been running without search indexing enabled (either repository events were disabled, or the search listener was not configured), then this method can be used to reindex content. This method should be used sparingly, as it can be quite expensive given a large amount of content.

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.

Parameters
typeId - The id of the type.
Throws
RepositoryException - If an error happens


Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.