|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.solr.request.SimpleFacets
public class SimpleFacets
A class that generates simple Facet information for a request. More advanced facet implementations may compose or subclass this class to leverage any of it's functionality.
| Nested Class Summary | |
|---|---|
static class |
SimpleFacets.CountPair<K extends Comparable<? super K>,V extends Comparable<? super V>>
A simple key=>val pair whose natural order is such that higher vals come before lower vals. |
| Field Summary | |
|---|---|
protected DocSet |
docs
The main set of documents all facet counts should be relative to |
protected org.apache.solr.common.util.SimpleOrderedMap |
facetResponse
|
Date |
NOW
|
protected org.apache.solr.common.params.SolrParams |
params
Configuration params behavior should be driven by |
protected ResponseBuilder |
rb
|
protected SolrQueryRequest |
req
|
protected org.apache.solr.common.params.SolrParams |
required
|
protected SolrIndexSearcher |
searcher
Searcher to use for all calculations |
| Constructor Summary | |
|---|---|
SimpleFacets(SolrQueryRequest req,
DocSet docs,
org.apache.solr.common.params.SolrParams params)
|
|
SimpleFacets(SolrQueryRequest req,
DocSet docs,
org.apache.solr.common.params.SolrParams params,
ResponseBuilder rb)
|
|
| Method Summary | |
|---|---|
org.apache.solr.common.util.NamedList |
getFacetCounts()
Looks at various Params to determing if any simple Facet Constraint count computations are desired. |
org.apache.solr.common.util.NamedList |
getFacetDateCounts()
Deprecated. Use getFacetRangeCounts which is more generalized |
void |
getFacetDateCounts(String dateFacet,
org.apache.solr.common.util.NamedList resOuter)
Deprecated. Use getFacetRangeCounts which is more generalized |
org.apache.solr.common.util.NamedList |
getFacetFieldCounts()
Returns a list of value constraints and the associated facet counts for each facet field specified in the params. |
org.apache.solr.common.util.NamedList |
getFacetQueryCounts()
Returns a list of facet counts for each of the facet queries specified in the params |
org.apache.solr.common.util.NamedList |
getFacetRangeCounts()
Returns a list of value constraints and the associated facet counts for each facet numerical field, range, and interval specified in the SolrParams |
org.apache.solr.common.util.NamedList |
getFacetTermEnumCounts(SolrIndexSearcher searcher,
DocSet docs,
String field,
int offset,
int limit,
int mincount,
boolean missing,
String sort,
String prefix)
Returns a list of terms in the specified field along with the corresponding count of documents in the set that match that constraint. |
static org.apache.solr.common.util.NamedList |
getFieldCacheCounts(SolrIndexSearcher searcher,
DocSet docs,
String fieldName,
int offset,
int limit,
int mincount,
boolean missing,
String sort,
String prefix)
Use the Lucene FieldCache to get counts for each unique field value in docs. |
static int |
getFieldMissingCount(SolrIndexSearcher searcher,
DocSet docs,
String fieldName)
Returns a count of the documents in the set which do not have any terms for for the specified field. |
org.apache.solr.common.util.NamedList |
getTermCounts(String field)
|
protected int |
rangeCount(SchemaField sf,
Date low,
Date high,
boolean iLow,
boolean iHigh)
Deprecated. Use rangeCount(SchemaField,String,String,boolean,boolean) which is more generalized |
protected int |
rangeCount(SchemaField sf,
String low,
String high,
boolean iLow,
boolean iHigh)
Macro for getting the numDocs of range over docs |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DocSet docs
protected org.apache.solr.common.params.SolrParams params
protected org.apache.solr.common.params.SolrParams required
protected SolrIndexSearcher searcher
protected SolrQueryRequest req
protected ResponseBuilder rb
protected org.apache.solr.common.util.SimpleOrderedMap facetResponse
public final Date NOW
| Constructor Detail |
|---|
public SimpleFacets(SolrQueryRequest req,
DocSet docs,
org.apache.solr.common.params.SolrParams params)
public SimpleFacets(SolrQueryRequest req,
DocSet docs,
org.apache.solr.common.params.SolrParams params,
ResponseBuilder rb)
| Method Detail |
|---|
public org.apache.solr.common.util.NamedList getFacetCounts()
getFacetQueryCounts(),
getFacetFieldCounts(),
getFacetDateCounts(),
getFacetRangeCounts(),
FacetParams.FACET
public org.apache.solr.common.util.NamedList getFacetQueryCounts()
throws IOException,
org.apache.lucene.queryParser.ParseException
IOException
org.apache.lucene.queryParser.ParseExceptionFacetParams.FACET_QUERY
public org.apache.solr.common.util.NamedList getTermCounts(String field)
throws IOException
IOException
public org.apache.solr.common.util.NamedList getFacetFieldCounts()
throws IOException,
org.apache.lucene.queryParser.ParseException
IOException
org.apache.lucene.queryParser.ParseExceptionFacetParams.FACET_FIELD,
getFieldMissingCount(org.apache.solr.search.SolrIndexSearcher, org.apache.solr.search.DocSet, java.lang.String),
getFacetTermEnumCounts(org.apache.solr.search.SolrIndexSearcher, org.apache.solr.search.DocSet, java.lang.String, int, int, int, boolean, java.lang.String, java.lang.String)
public static int getFieldMissingCount(SolrIndexSearcher searcher,
DocSet docs,
String fieldName)
throws IOException
IOExceptionFacetParams.FACET_MISSING
public static org.apache.solr.common.util.NamedList getFieldCacheCounts(SolrIndexSearcher searcher,
DocSet docs,
String fieldName,
int offset,
int limit,
int mincount,
boolean missing,
String sort,
String prefix)
throws IOException
docs.
The field must have at most one indexed token per document.
IOException
public org.apache.solr.common.util.NamedList getFacetTermEnumCounts(SolrIndexSearcher searcher,
DocSet docs,
String field,
int offset,
int limit,
int mincount,
boolean missing,
String sort,
String prefix)
throws IOException
docs
and the DocSet for each term in the filter.
IOExceptionFacetParams.FACET_LIMIT,
FacetParams.FACET_ZEROS,
FacetParams.FACET_MISSING
@Deprecated
public org.apache.solr.common.util.NamedList getFacetDateCounts()
throws IOException,
org.apache.lucene.queryParser.ParseException
IOException
org.apache.lucene.queryParser.ParseExceptionFacetParams.FACET_DATE
@Deprecated
public void getFacetDateCounts(String dateFacet,
org.apache.solr.common.util.NamedList resOuter)
throws IOException,
org.apache.lucene.queryParser.ParseException
IOException
org.apache.lucene.queryParser.ParseException
public org.apache.solr.common.util.NamedList getFacetRangeCounts()
throws IOException,
org.apache.lucene.queryParser.ParseException
IOException
org.apache.lucene.queryParser.ParseExceptionFacetParams.FACET_RANGE
protected int rangeCount(SchemaField sf,
String low,
String high,
boolean iLow,
boolean iHigh)
throws IOException
IOExceptionSolrIndexSearcher.numDocs(org.apache.lucene.search.Query, org.apache.solr.search.DocSet),
TermRangeQuery
@Deprecated
protected int rangeCount(SchemaField sf,
Date low,
Date high,
boolean iLow,
boolean iHigh)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||