Re: How to use TermQuery() to find particular document in the index
Posted By:
Otis_Gospodnetic
Posted On:
Wednesday, July 28, 2004 02:50 AM
Yes, that is how you should check if a certain term exists in your index. Create your Term, then create TermQuery and pass it your Term in the constructor. Then pass that TermQuery to IndexSearcher's search method and get Hits back. Use Hits' .length() method to see if your Term exists in the index or not.