Class: HitCollection

helma.Search.HitCollection(hits)

This class provides Helma-like methods for accessing a collection of search hits.

Constructor

new HitCollection(hits)

Creates a new instance of helma.Search.HitCollection
Parameters:
Name Type Description
hits org.lucene.search.Hits The hit collection returned by lucene.
Source:

Methods

forEach(fun, context)

Executes a provided function once per hit.
Parameters:
Name Type Description
fun function Function to execute for each element
context Object Object to use as "this" when executing callback.
Source:
See:

get(idx)

Silently converts the hit at the given index position into an instance of helma.Search.Document.
Parameters:
Name Type Description
idx Number The index position of the hit
Source:
Returns:
The document object at the given index position

length()

Returns the number of hits in this collection. This method is deprecated, use #size instead.
Deprecated:
  • Yes
Source:
See:
Returns:
The number of hits.

size()

Returns the number of hits in this collection.
Source:
Returns:
The number of hits.