indexer.close();
}
}
public void search() throws QueryNodeException, IOException {
final SimpleSearcher searcher = new SimpleSearcher(indexDir);
final String[] keywordQueries = this.getKeywordQueries();
final String[] jsonQueries = this.getJsonQueries();
assert keywordQueries.length == jsonQueries.length;
for (int i = 0; i < keywordQueries.length; i++) {
Query q = searcher.parseKeywordQuery(keywordQueries[i]);
logger.info("Executing keyword query: '{}'", keywordQueries[i]);
String[] results = searcher.search(q, 1000);
logger.info("Keyword query returned {} results: {}", results.length, Arrays.toString(results));
q = searcher.parseJsonQuery(jsonQueries[i]);
logger.info("Executing json query: '{}'", jsonQueries[i]);
results = searcher.search(q, 1000);
logger.info("Json query returned {} results: {}", results.length, Arrays.toString(results));
}
}