Lucene

Query q = new TermQuery(new Term("contents","lucene"));
TopDocs hits = searcher.search(q,10);
This code instructs Lucene to find the top 10 documents that contain the word lucene in a field named contents,sorting the documents by descending relevance

你可能感兴趣的:(Lucene)