public interface ISearchService
Provides an interface to the Global Search capabilities of OpenPages. This interfaces
performs searches using the integrated search engine. For more information on Global Search and
related administration topics refer to main package documentation for com.ibm.openpages.api.search
.
For searching via querying
objects in the OpenPages database directly, see IQueryService
.
Context context = ... IServiceFactory serviceFactory = ServiceFactory.getServiceFactory(context); ISearchService searchService = serviceFactory.createQueryService(); if(!searchServiceisSearchReadyForUse()){ //search service is not currently available } String searchTerm = "High Impact Risk"; SearchOptions options = new SearchOptions(); //ask for range of first 25 results options.setRangeStart(0); options.setRangeEnd(24); //perform search ISearchResults results = searchSvc.search(searchTerm, options); //get the results ListresultList = results.getResultList(); for (ISearchResource searchRes : resultList) { //display or user the ISearchResource which results from the search ... }
com.ibm.openpages.api.search
Modifier and Type | Method and Description |
---|---|
boolean |
isSearchReadyForUse()
Checks if the Global Search feature is ready for use.
|
ISearchResults |
search(java.lang.String searchTerms,
SearchOptions options)
Perform a search with the given search terms and options.
|
ISearchResults search(java.lang.String searchTerms, SearchOptions options) throws SearchException
isSearchReadyForUse()
method.searchTerms
- case-insensitive string containing search terms or keywords to
be searched for across any Object Type configured for search
by administrators. Quoted strings will be searched for as an
'exact match', otherwise the search terms are processed for
search against the OpenPages Global Search index in
language-sensitive fashion based on the Language Analyzer
currently selected.options
- specifies options to perform the search. Options such as the
Object Types to search for and the range of results to return.SearchException
- for any search server or processing exceptionboolean isSearchReadyForUse() throws SearchException
SearchException
- for any search server or processing exception
Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2020. All Rights Reserved.
US Government Users Restricted Rights -
Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.