Searcher
interface
The Searcher
interface is the main interface
that the search wrapper must implement.
Searcher
interface
can be summarized as follows:- Accepts a query.
- Run the query against the specified knowledge source.
- Return the query results.
package com.ibm.tivoli.unity.loganalytics.knowledgeSource;
public interface Searcher {
public void init(String[] args) throws Exception;
public SearchPage issue(String query) throws Exception;
public SearchPage issue(QueryLevel<String> query) throws Exception;
}
Methods
init(String[] args)
Expert advice dynamically loads the Java™ Archive file that is specified in the app file. It then creates an instance of the class that implements the
Searcher
interface that is also specified in the app file. You must ensure that an empty constructor exists for this class. After the Expert Advice app creates an instance of the class, it calls theinit()
method of that instance along with the arguments that are specified in the app file. You can use theinit()
method to specify any initialization that requires external arguments.issue(String query)
Use this method to run a simple query against the knowledge source. Billing error is an example of a simple input query. The output object must be a class that implements the
SearchPage
interface. For more information about theSearchPage
interface, see SearchPage interfaceissue(QueryLevel<String> query)
Use this method to run a structured query against the knowledge source. The
QueryLevel
structured query object encapsulates the query levels or order. The output object must be a class that implements theSearchPage
interface.