// make the reader and searcher, execute the search, return the previous assertion
TopDocs topDocs = searcher.search(query,1);
ScoreDoc[] scoreDocs = topDocs.scoreDocs;
if ((scoreDocs != null) && (scoreDocs.length) > 0) {
Document document = searcher.getIndexReader().document(scoreDocs[0].doc);
Assertion assertion = asnSet.newAssertion(context,false);
assertion.load(document);
return assertion;
}
}
return null;