CLucene - a full-featured, c++ search engine
API Documentation
Expert: Collects sorted results from Searchable's and collates them. More...
#include <FieldDocSortedHitQueue.h>
Public Member Functions | |
| FieldDocSortedHitQueue (SortField **fields, int32_t size) | |
| Creates a hit queue sorted by the given list of fields. | |
| ~FieldDocSortedHitQueue () | |
| void | setFields (SortField **fields) |
Allows redefinition of sort fields if they are NULL. | |
| SortField ** | getFields () |
| Returns the fields being used to sort. | |
Protected Member Functions | |
| bool | lessThan (FieldDoc *docA, FieldDoc *docB) |
Returns an array of collators, possibly NULL. | |
Expert: Collects sorted results from Searchable's and collates them.
The elements put into this queue must be of type FieldDoc.
| lucene::search::FieldDocSortedHitQueue::FieldDocSortedHitQueue | ( | SortField ** | fields, | |
| int32_t | size | |||
| ) |
Creates a hit queue sorted by the given list of fields.
| fields | Field names, in priority order (highest priority first). | |
| size | The number of hits to retain. Must be greater than zero. |
| lucene::search::FieldDocSortedHitQueue::~FieldDocSortedHitQueue | ( | ) |
| SortField** lucene::search::FieldDocSortedHitQueue::getFields | ( | ) | [inline] |
Returns the fields being used to sort.
| bool lucene::search::FieldDocSortedHitQueue::lessThan | ( | FieldDoc * | docA, | |
| FieldDoc * | docB | |||
| ) | [protected] |
Returns an array of collators, possibly NULL.
The collators correspond to any SortFields which were given a specific locale.
| fields | Array of sort fields. |
NULL.private Collator[] hasCollators (SortField[] fields) { if (fields == NULL) return NULL; Collator[] ret = new Collator[fields.length]; for (int32_t i=0; i<fields.length; ++i) { Locale locale = fields[i].getLocale(); if (locale != NULL) ret[i] = Collator.getInstance (locale); } return ret; } Returns whether a is less relevant than b.
| void lucene::search::FieldDocSortedHitQueue::setFields | ( | SortField ** | fields | ) |
Allows redefinition of sort fields if they are NULL.
This is to handle the case using ParallelMultiSearcher where the original list contains AUTO and we don't know the actual sort type until the values come back. The fields can only be set once. This method is thread safe.
| fields |