Skip to content

Commit 6817dfc

Browse files
committed
we do not necessarily have topDocs.totalHits hits available
1 parent 6c696b3 commit 6817dfc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/lucene/example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function search(searcher, queryString) {
5252

5353
console.log("Found " + topDocs.totalHits + " hits for query \"" + queryString + "\".");
5454
var scoreDocs = topDocs.scoreDocs;
55-
for(var i=0; i<topDocs.totalHits; i++) {
55+
for(var i=0; i<topDocs.scoreDocs.length; i++) {
5656
var docId = scoreDocs[i].doc;
5757
var doc = searcher.docSync(docId);
5858
console.log(" " + (i + 1) + ". " + doc.getSync("title"));

0 commit comments

Comments
 (0)