public class

TopDocs

extends Object
implements Serializable
java.lang.Object
   ↳ org.apache.lucene.search.TopDocs
Known Direct Subclasses

Class Overview

Represents hits returned by search(Query, Filter, int) and search(Query, int).

Summary

Fields
public ScoreDoc[] scoreDocs The top hits for the query.
public int totalHits The total number of hits for the query.
Public Constructors
TopDocs(int totalHits, ScoreDoc[] scoreDocs, float maxScore)
Public Methods
float getMaxScore()
Returns the maximum score value encountered.
void setMaxScore(float maxScore)
Sets the maximum score value encountered.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public ScoreDoc[] scoreDocs

The top hits for the query.

public int totalHits

The total number of hits for the query.

Public Constructors

public TopDocs (int totalHits, ScoreDoc[] scoreDocs, float maxScore)

Public Methods

public float getMaxScore ()

Returns the maximum score value encountered. Note that in case scores are not tracked, this returns NaN.

public void setMaxScore (float maxScore)

Sets the maximum score value encountered.