IRemoteSearcher searcher = new RmiSearcherStub(basePort, host);
//The simplest example.
System.out.println("Simple search results:\n" + searcher.search(new LazyParsedQuery(query), 0, 10, new NoGroup(), 1, null, null).toString());
//The same example, with some error management
GroupedSearchResults gsr = null;
try {
gsr = searcher.search(new LazyParsedQuery(query), 0, 10, new NoGroup(), 1, null, null);
} catch (RpcException e) {
System.err.println("Error while executing the search." + e);
System.exit(-1);
}
System.out.println("Search successfull.");