In the tutorial of Lucene ( http://www.lucenetutorial.com/lucene-in-5-minutes.html ),
public class HelloLucene {
public static void main(String[] args) throws IOException, ParseException {
IndexWriter w = new IndexWriter(index, config);
addDoc(w, "Lucene lucene in Action");
addDoc(w, "Lucene for Dummies");
addDoc(w, "Managing Gigabytes");
addDoc(w, "The Art of Computer Science");
w.close();
String querystr = args.length > 0 ? args[0] : "lucene";
//...
}
}
When I change as indicated above the string to "Lucene lucene in Action", then search the doc for keyword "lucene", it finds the number of hits 1 for the string "Lucene lucene in Action". I want to send a string (e.g. "asd asd fds asd") to function and search for "asd" and find the result 3. How can I do that by using the query addDoc(w, "asd asd fds asd"); ???
It does not giving the number of hits in selected line. It writes 1 if there is a hit or hits, and 0 if there is not.