public class

LuceneSubsetResultFilter

extends Object
implements LuceneResultFilter
java.lang.Object
   ↳ com.atlassian.confluence.search.v2.lucene.LuceneSubsetResultFilter

Class Overview

A result filter that filters out all but a particular "window" (offset from start, count) of results. Depending on the number of results in the hit set being filtered, there may be fewer than count results returned, or even none at all.

If offset is zero, has the effect of limiting the number of results.

Summary

Public Constructors
LuceneSubsetResultFilter(int count)
Construct a filter that returns at most the first count hits.
LuceneSubsetResultFilter(int startOffset, int count)
Construct a filter with the given start offset and count.
Public Methods
int getExpectedResultsCount()
The number of results that the filter expects to allow into the final search result.
boolean isIncludedInResults(WrappedHit hit)
boolean shouldContinueIterating()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.search.v2.lucene.LuceneResultFilter

Public Constructors

public LuceneSubsetResultFilter (int count)

Construct a filter that returns at most the first count hits. This is the equivalent of new LuceneSubsetResultFilter(0, count).

Parameters
count the number of hits to return

public LuceneSubsetResultFilter (int startOffset, int count)

Construct a filter with the given start offset and count. Offsets are zero-based, so an offset of 0 means "start at the first hit".

Parameters
startOffset the zero-based offset of the first hit to return
count the maximum number of hits to return

Public Methods

public int getExpectedResultsCount ()

The number of results that the filter expects to allow into the final search result. This is used as a purely advisory number to initialise the size of collections, and so on. Returning a number less than or equal to zero indicates that the filter has no idea how many results it is likely to return.

Returns
  • the number of results the filter expects to permit in the search results, or zero if no prediction can be made.

public boolean isIncludedInResults (WrappedHit hit)

public boolean shouldContinueIterating ()