|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgate.creole.annic.apache.lucene.util.PriorityQueue
gate.creole.annic.apache.lucene.search.FieldSortedHitQueue
class FieldSortedHitQueue
Expert: A hit queue for sorting by hits by terms in more than one field.
Uses FieldCache.DEFAULT for maintaining internal term lookup tables.
Created: Dec 8, 2003 12:56:03 PM
Searchable.search(Query,Filter,int,Sort),
FieldCache| Field Summary | |
|---|---|
protected ScoreDocComparator[] |
comparators
Stores a comparator corresponding to each field being sorted by |
(package private) static Map |
Comparators
Internal cache of comparators. |
protected SortField[] |
fields
Stores the sort criteria being used. |
protected float |
maxscore
Stores the maximum score value encountered, for normalizing. |
| Constructor Summary | |
|---|---|
FieldSortedHitQueue(IndexReader reader,
SortField[] fields,
int size)
Creates a hit queue sorted by the given list of fields. |
|
| Method Summary | |
|---|---|
(package private) static ScoreDocComparator |
comparatorAuto(IndexReader reader,
String fieldname)
Returns a comparator for sorting hits according to values in the given field. |
(package private) static ScoreDocComparator |
comparatorFloat(IndexReader reader,
String fieldname)
Returns a comparator for sorting hits according to a field containing floats. |
(package private) static ScoreDocComparator |
comparatorInt(IndexReader reader,
String fieldname)
Returns a comparator for sorting hits according to a field containing integers. |
(package private) static ScoreDocComparator |
comparatorString(IndexReader reader,
String fieldname)
Returns a comparator for sorting hits according to a field containing strings. |
(package private) static ScoreDocComparator |
comparatorStringLocale(IndexReader reader,
String fieldname,
Locale locale)
Returns a comparator for sorting hits according to a field containing strings. |
(package private) FieldDoc |
fillFields(FieldDoc doc)
Given a FieldDoc object, stores the values used to sort the given document. |
(package private) static ScoreDocComparator |
getCachedComparator(IndexReader reader,
String fieldname,
int type,
Locale locale,
SortComparatorSource factory)
|
(package private) SortField[] |
getFields()
Returns the SortFields being used by this hit queue. |
protected boolean |
lessThan(Object a,
Object b)
Returns whether a is less relevant than b. |
(package private) static ScoreDocComparator |
lookup(IndexReader reader,
String field,
int type,
Object factory)
Returns a comparator if it is in the cache. |
(package private) static Object |
store(IndexReader reader,
String field,
int type,
Object factory,
Object value)
Stores a comparator into the cache. |
| Methods inherited from class gate.creole.annic.apache.lucene.util.PriorityQueue |
|---|
adjustTop, clear, initialize, insert, pop, put, size, top |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ScoreDocComparator[] comparators
protected SortField[] fields
protected float maxscore
static final Map Comparators
| Constructor Detail |
|---|
FieldSortedHitQueue(IndexReader reader,
SortField[] fields,
int size)
throws IOException
reader - Index to use.fields - Field names, in priority order (highest priority first). Cannot be null or empty.size - The number of hits to retain. Must be greater than zero.
IOException| Method Detail |
|---|
protected final boolean lessThan(Object a,
Object b)
a is less relevant than b.
lessThan in class PriorityQueuea - ScoreDocb - ScoreDoc
true if document a should be sorted after document b.FieldDoc fillFields(FieldDoc doc)
doc - The FieldDoc to store sort values into.
Searchable.search(Query,Filter,int,Sort)SortField[] getFields()
static ScoreDocComparator lookup(IndexReader reader,
String field,
int type,
Object factory)
static Object store(IndexReader reader,
String field,
int type,
Object factory,
Object value)
static ScoreDocComparator getCachedComparator(IndexReader reader,
String fieldname,
int type,
Locale locale,
SortComparatorSource factory)
throws IOException
IOException
static ScoreDocComparator comparatorInt(IndexReader reader,
String fieldname)
throws IOException
reader - Index to use.fieldname - Field containg integer values.
IOException - If an error occurs reading the index.
static ScoreDocComparator comparatorFloat(IndexReader reader,
String fieldname)
throws IOException
reader - Index to use.fieldname - Field containg float values.
IOException - If an error occurs reading the index.
static ScoreDocComparator comparatorString(IndexReader reader,
String fieldname)
throws IOException
reader - Index to use.fieldname - Field containg string values.
IOException - If an error occurs reading the index.
static ScoreDocComparator comparatorStringLocale(IndexReader reader,
String fieldname,
Locale locale)
throws IOException
reader - Index to use.fieldname - Field containg string values.
IOException - If an error occurs reading the index.
static ScoreDocComparator comparatorAuto(IndexReader reader,
String fieldname)
throws IOException
reader - Index to use.fieldname - Field containg values.
IOException - If an error occurs reading the index.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||