|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.gouv.culture.sdx.search.lucene.query.SortSpecification
Indications for sorting of search results. The specifications of sorting are an ordered list of sort keys (SortKey class).
Field Summary | |
static int |
SORT_ORDER_ASCENDANT
int to specifiy and an ascending sort. |
static int |
SORT_ORDER_DESCENDANT
int to specifiy and an descending sort. |
static java.lang.String |
SORT_RANKING
The field for the sorting by relevance. |
Constructor Summary | |
SortSpecification()
Build a specification for sorting. |
Method Summary | |
void |
addSortKey(Field field)
Adds an ascending sort key to the specification by a field. |
void |
addSortKey(Field field,
int order)
Adds a sort key to the specification by a field and an order. |
void |
addSortKey(java.lang.String fieldName,
int order,
SearchLocations locations)
Adds a sort key to the specification, a searchLocation is needed to obtains information about locale and analysers |
void |
addSortKey(java.lang.String fieldName,
SearchLocations locations)
Adds a sort key to the specification, a searchLocation is needed to obtains information about locale and analysers |
int |
compare(java.lang.Object doc1,
java.lang.Object doc2)
Carries out the comparison of two documents with the aim of sorting them . |
void |
enableLogging(org.apache.avalon.framework.logger.Logger logger)
Sets the logger. |
ResultDocuments |
sortResults(org.apache.lucene.search.Hits hits)
Sorts the search results. |
ResultDocuments |
sortResults(ResultDocuments res)
Sorts the search results. |
void |
toSAX(org.xml.sax.ContentHandler hdl)
Returns an XML representation of this sort specification. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
equals |
Field Detail |
public static final int SORT_ORDER_ASCENDANT
public static final int SORT_ORDER_DESCENDANT
public static final java.lang.String SORT_RANKING
Constructor Detail |
public SortSpecification() throws SDXException
Method Detail |
public void addSortKey(Field field, int order) throws SDXException
field
- The field.order
- The order.
SDXException
public void addSortKey(Field field) throws SDXException
field
- The field.
SDXException
public void addSortKey(java.lang.String fieldName, int order, SearchLocations locations) throws SDXException
fieldName
- The field.order
- orderlocations
-
SDXException
public void addSortKey(java.lang.String fieldName, SearchLocations locations) throws SDXException
fieldName
- The field.locations
-
SDXException
public ResultDocuments sortResults(org.apache.lucene.search.Hits hits) throws SDXException
hits
- The search hits
SDXException
public ResultDocuments sortResults(ResultDocuments res) throws SDXException, java.io.IOException
res
- The result documents
SDXException
java.io.IOException
public int compare(java.lang.Object doc1, java.lang.Object doc2)
compare
in interface java.util.Comparator
doc1
- The first document.doc2
- The second document.public void toSAX(org.xml.sax.ContentHandler hdl) throws org.xml.sax.SAXException, org.apache.cocoon.ProcessingException
hdl
- The ContentHandler to feed with events.
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException
public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
enableLogging
in interface org.apache.avalon.framework.logger.LogEnabled
logger
- The logger to use.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |