lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Lucene-java Wiki] Trivial Update of "TheBasics" by JayDonnell
Date Wed, 14 Jan 2009 19:04:06 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lucene-java Wiki" for change notification.

The following page has been changed by JayDonnell:
http://wiki.apache.org/lucene-java/TheBasics

------------------------------------------------------------------------------
  	    IndexSearcher searcher = new IndexSearcher(directory);
  	    Query query = new TermQuery(new Term("partnum", "Q36"));   
  	    TopDocs rs = searcher.search(query, null, 10);
- 	    System.out.println(rs.totalHits);	
+ 	    System.out.println(rs.totalHits);
+ 
+ 	    Document firstHit = searcher.doc(rs.scoreDocs[0].doc);
+ 	    System.out.println(firstHit.getField("partnum").name());
  	}
  }
  }}}

Mime
View raw message