|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.search.HitCollector
org.opencms.search.CmsSearchCategoryCollector
public class CmsSearchCategoryCollector
Collects category information during a search process.
Please note: The calculation of the category count slows down the search time by an order of magnitude. Make sure that you only use this feature if it's really required! Be especially careful if your search result list can become large (> 1000 documents), since in this case overall system performance will certainly be impacted considerably when calculating the categories.
Field Summary | |
---|---|
static java.lang.String |
UNKNOWN_CATEGORY
Category used in case the document belongs to no category. |
Constructor Summary | |
---|---|
CmsSearchCategoryCollector(org.apache.lucene.search.IndexSearcher searcher)
Creates a new category search collector instance. |
Method Summary | |
---|---|
void |
collect(int id,
float score)
|
static java.lang.String |
formatCategoryMap(java.util.Map categories)
Convenience method to format a map of categories in a nice 2 column list, for example for display of debugging output. |
java.util.Map |
getCategoryCountResult()
Returns the category count result, the returned map contains Strings (category names) mapped to an Integer (the count). |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String UNKNOWN_CATEGORY
Constructor Detail |
---|
public CmsSearchCategoryCollector(org.apache.lucene.search.IndexSearcher searcher)
searcher
- the index searcher usedMethod Detail |
---|
public static final java.lang.String formatCategoryMap(java.util.Map categories)
categories
- the map to format
public void collect(int id, float score)
collect
in class org.apache.lucene.search.HitCollector
HitCollector.collect(int, float)
public java.util.Map getCategoryCountResult()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |