Searcher interface

The Searcher interface is the main interface that the search wrapper must implement.

The basic function of the wrapper as implemented by the Searcher interface can be summarized as follows:
  1. Accepts a query.
  2. Run the query against the specified knowledge source.
  3. Return the query results.
The interface is defined as follows:
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

The interface contains the following 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 the init() method of that instance along with the arguments that are specified in the app file. You can use the init() 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 the SearchPage interface, see SearchPage interface

issue(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 the SearchPage interface.