lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Israel Tsadok <itsa...@gmail.com>
Subject Re: basic example of lucene not working(must be user error, but I am just missing it)
Date Mon, 20 Jun 2011 05:47:59 GMT
You're creating the TopScoreDocCollector with numHits=1. This means the
collector only retains one result, but keep track of the total number of
results. Imagine a situation where there's a million hits. You want to know
the number, but you usually don't need all their doc ids.

That's why scoreDocs.length is 1.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message