SAP NetWeaver '04

com.sapportals.wcm.service.indexmanagement.retrieval.search
Interface IFederatedSearch

[contained in: com.sap.km.cm.service.par - km.shared.service.indexmanagement_api.jar]
public interface IFederatedSearch

Starts a search with a given query within a list of indexes, no matter what search service implementation an index is.
All sub searches are cummulated in one list and finally sorted by rank value.

To get a IFederatedSearch instance follow this example:

  IIndexService indexService = (IIndexService)ResourceFactory.getInstance()
    .getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  IFederatedSearch federatedSearch = (IFederatedSearch)indexService
    .getObjectInstance(IWcmIndexConst.FEDERATED_SEARCH_INSTANCE);
 


Method Summary
 ISearchResultList getEmptySearchResultList()
          Empty search result list where search results from other search result lists can be added to.
 int getMaxSnippetWords()
          Sets the number of snippet words returned for documents in a search.
 IQueryEntry getNewQueryEntry()
          Initial query entry as part of a search query.
 IQueryEntryList getNewQueryEntryList()
          Empty list for adding query entries when creating a search query.
 java.util.List getSearchIndexes()
          Deprecated. as of NW04. Use getSearchIndexes(IResourceContext)
 java.util.List getSearchIndexes(IResourceContext context)
          Gets all indexes that contain one ore more repositories where the index is a search index.
 ISearchResultList search(IQueryEntryList queryEntryList, ICollection searchFromHere, int maxResults, IResourceContext context)
          Performs a search within a list of search indexes restricted by a path.
 ISearchResultList search(IQueryEntryList queryEntryList, java.util.List indexes, int maxResults, IResourceContext context)
          Performs a search within a list of search indexes.
 ISearchResultList searchSimilarDocuments(java.util.List indexes, IResourceList documents, int maxResults)
          Performs a federated similar document search.
 ISearchSession searchSimilarDocumentsWithSession(java.util.List indexes, IResourceList documents)
          Performs a federated similar document search.
 ISearchSession searchSimilarDocumentsWithSession(java.util.List indexes, IResourceList documents, ISortPropertyName sortProperty)
          Performs a federated similar document search.
 java.util.List searchSimilarTerms(java.util.List indexes, java.util.Collection terms, int maxResults)
          Searches for terms to a similar to a collection of terms.
 ISearchSession searchWithSession(IQueryEntryList queryEntryList, ICollection searchFromHere, IResourceContext context)
          Performs a search within a list of search indexes restricted by a path.
 ISearchSession searchWithSession(IQueryEntryList queryEntryList, ICollection searchFromHere, IResourceContext context, ISortPropertyName sortProperty)
          Performs a search within a list of search indexes restricted by a path.
 ISearchSession searchWithSession(IQueryEntryList queryEntryList, ICollection searchFromHere, IResourceContext context, ISortPropertyName sortProperty, java.util.Set languages)
          Performs a search within a list of search indexes restricted by a path.
 ISearchSession searchWithSession(IQueryEntryList queryEntryList, IRidList searchFromHereList, IResourceContext context, ISortPropertyName sortProperty, java.util.Set languages)
           
 ISearchSession searchWithSession(IQueryEntryList queryEntryList, java.util.List indexes, IResourceContext context)
          Performs a search within a list of search indexes.
 ISearchSession searchWithSession(IQueryEntryList queryEntryList, java.util.List indexes, IResourceContext context, ISortPropertyName sortProperty)
          Performs a search within a list of search indexes.
 void setMaxSnippetWords(int numOfWords)
          Sets the number of snippet words returned for documents in a search.
 

Method Detail

getSearchIndexes

public java.util.List getSearchIndexes()
                                throws WcmException
Deprecated. as of NW04. Use getSearchIndexes(IResourceContext)

Gets all indexes that contain one ore more repositories where the index is a search index.
Returns:
list of IIndex objects

getSearchIndexes

public java.util.List getSearchIndexes(IResourceContext context)
                                throws WcmException
Gets all indexes that contain one ore more repositories where the index is a search index.
Parameters:
context - user context
Returns:
list of IIndex objects

search

public ISearchResultList search(IQueryEntryList queryEntryList,
                                java.util.List indexes,
                                int maxResults,
                                IResourceContext context)
                         throws WcmException
Performs a search within a list of search indexes.
Parameters:
queryEntryList - list of query entries for the search
indexes - list of IIndex objects that have been choosen for the search. To get all existing search indexes call the getSearchIndexes method.
maxResults - maximum number of search results
context - user context
Returns:
list with all search results.

searchWithSession

public ISearchSession searchWithSession(IQueryEntryList queryEntryList,
                                        java.util.List indexes,
                                        IResourceContext context)
                                 throws WcmException
Performs a search within a list of search indexes.
It returns a session object that contains the search results in a raw format. To get search results getSearchResults must be called on that session. The session concept optimizes performance because only for the displayed results resources must be retrieved from the resource factory.
Parameters:
queryEntryList - list of query entries for the search
indexes - list of IIndex objects that have been choosen for the search. To get all existing search indexes call the getSearchIndexes method.
context - user context
Returns:
search session result

searchWithSession

public ISearchSession searchWithSession(IQueryEntryList queryEntryList,
                                        java.util.List indexes,
                                        IResourceContext context,
                                        ISortPropertyName sortProperty)
                                 throws WcmException
Performs a search within a list of search indexes.
It returns a session object that contains the search results in a raw format. To get search results getSearchResults must be called on that session. The session concept optimizes performance because only for the displayed results resources must be retrieved from the resource factory.
Parameters:
queryEntryList - list of query entries for the search
indexes - list of IIndex objects that have been choosen for the search. To get all existing search indexes call the getSearchIndexes method.
context - user context
sortProperty - property name for sorting the results; if null, the results are sorted according to their rank value
Returns:
search session result

search

public ISearchResultList search(IQueryEntryList queryEntryList,
                                ICollection searchFromHere,
                                int maxResults,
                                IResourceContext context)
                         throws WcmException
Performs a search within a list of search indexes restricted by a path.
The list of indexes is determined by looking for all search indexes that are assigned to a repository starting from a given folder.
Parameters:
queryEntryList - list of query entries for the search
searchFromHere - folder from where search results must be direct or indirect children
maxResults - maximum number of search results
context - user context
Returns:
list with all search results.

searchWithSession

public ISearchSession searchWithSession(IQueryEntryList queryEntryList,
                                        ICollection searchFromHere,
                                        IResourceContext context)
                                 throws WcmException
Performs a search within a list of search indexes restricted by a path.
The list of indexes is determined by looking for all search indexes that are assigned to a repository starting from a given folder. It returns a session object that contains the search results in a raw format. To get search results getSearchResults must be called on that session. The session concept optimizes performance because only for the displayed results resources must be retrieved from the resource factory.
Parameters:
queryEntryList - list of query entries for the search
searchFromHere - folder from where search results must be direct or indirect children
context - user context
Returns:
the search session result

searchWithSession

public ISearchSession searchWithSession(IQueryEntryList queryEntryList,
                                        ICollection searchFromHere,
                                        IResourceContext context,
                                        ISortPropertyName sortProperty)
                                 throws WcmException
Performs a search within a list of search indexes restricted by a path.
The list of indexes is determined by looking for all search indexes that are assigned to a repository starting from a given folder. It returns a session object that contains the search results in a raw format. To get search results getSearchResults must be called on that session. The session concept optimizes performance because only for the displayed results resources must be retrieved from the resource factory.
Parameters:
queryEntryList - list of query entries for the search
searchFromHere - folder from where search results must be direct or indirect children
context - user context
sortProperty - property name for sorting the results
Returns:
the search session result

searchWithSession

public ISearchSession searchWithSession(IQueryEntryList queryEntryList,
                                        ICollection searchFromHere,
                                        IResourceContext context,
                                        ISortPropertyName sortProperty,
                                        java.util.Set languages)
                                 throws WcmException
Performs a search within a list of search indexes restricted by a path.
The list of indexes is determined by looking for all search indexes that are assigned to a repository starting from a given folder. languages describes a set of languages, on which the search is restricted. If this parameter is null or empty, no restriction takes place. It returns a session object that contains the search results in a raw format. To get search results getSearchResults must be called on that session. The session concept optimizes performance because only for the displayed results resources must be retrieved from the resource factory.
Parameters:
queryEntryList - list of query entries for the search
searchFromHere - folder from where search results must be direct or indirect children
context - user context
sortProperty - property name for sorting the results
languages - set of strings, each describing a language
Returns:
the search session result

searchWithSession

public ISearchSession searchWithSession(IQueryEntryList queryEntryList,
                                        IRidList searchFromHereList,
                                        IResourceContext context,
                                        ISortPropertyName sortProperty,
                                        java.util.Set languages)
                                 throws WcmException

searchSimilarDocuments

public ISearchResultList searchSimilarDocuments(java.util.List indexes,
                                                IResourceList documents,
                                                int maxResults)
                                         throws WcmException
Performs a federated similar document search.
Each index returns a list of documents that are similar to the input document list. The results are merged to the returned result list, sorted by rank value.
Parameters:
indexes - list of IIndex objects that have been choosen for the search. To get all existing search indexes call the getSearchIndexes method.
documents - list of documents for that similar documents have to be found
maxResults - maximum number of search results
Returns:
list with all search results.

searchSimilarDocumentsWithSession

public ISearchSession searchSimilarDocumentsWithSession(java.util.List indexes,
                                                        IResourceList documents)
                                                 throws WcmException
Performs a federated similar document search.
Each index returns a list of documents that are similar to the input document list. The results are merged to the one result list, sorted by rank value. It returns a session object that contains the search results in a raw format. To get search results getSearchResults must be called on that session. The session concept optimizes performance because only for the displayed results resources must be retrieved from the resource factory.
Parameters:
indexes - is a list of (IIndex)index objects that have been choosen for the search. To get all existing search indexes call the getSearchIndexes method.
documents - list of documents for that similar documents have to be found
Returns:
search session result

searchSimilarDocumentsWithSession

public ISearchSession searchSimilarDocumentsWithSession(java.util.List indexes,
                                                        IResourceList documents,
                                                        ISortPropertyName sortProperty)
                                                 throws WcmException
Performs a federated similar document search.
Each index returns a list of documents that are similar to the input document list. The results are merged to the one result list, sorted by rank value. It returns a session object that contains the search results in a raw format. To get search results getSearchResults must be called on that session. The session concept optimizes performance because only for the displayed results resources must be retrieved from the resource factory.
Parameters:
indexes - is a list of (IIndex)index objects that have been choosen for the search. To get all existing search indexes call the getSearchIndexes method.
documents - list of documents for that similar documents have to be found
sortProperty - property name for sorting the results; if null, the results are sorted according to their rank value
Returns:
search session result

searchSimilarTerms

public java.util.List searchSimilarTerms(java.util.List indexes,
                                         java.util.Collection terms,
                                         int maxResults)
                                  throws WcmException
Searches for terms to a similar to a collection of terms.
Parameters:
indexes - list of IIndex objects that have been choosen for the search. To get all existing search indexes call the getSearchIndexes method.
terms - collection of terms of type String
maxResults - maximum number of returned similar terms
Returns:
List of ITextminingTerm

getNewQueryEntry

public IQueryEntry getNewQueryEntry()
Initial query entry as part of a search query.
Returns:
a new, empty query entry

getNewQueryEntryList

public IQueryEntryList getNewQueryEntryList()
Empty list for adding query entries when creating a search query.
Returns:
a new, empty query entry list

getEmptySearchResultList

public ISearchResultList getEmptySearchResultList()
Empty search result list where search results from other search result lists can be added to.
Returns:
an empty search result list

setMaxSnippetWords

public void setMaxSnippetWords(int numOfWords)
Sets the number of snippet words returned for documents in a search. If not set, a default value is used.
Parameters:
numOfWords -  

getMaxSnippetWords

public int getMaxSnippetWords()
Sets the number of snippet words returned for documents in a search.
Returns:
number of snippet words

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.