public class SimpleFacets extends Object
Modifier and Type | Class and Description |
---|---|
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.
|
Modifier and Type | Field and Description |
---|---|
protected DocSet |
docs
The main set of documents all facet counts should be relative to
|
protected SimpleOrderedMap |
facetResponse |
protected SolrParams |
params
Configuration params behavior should be driven by
|
protected ResponseBuilder |
rb |
protected SolrQueryRequest |
req |
protected SolrParams |
required |
protected SolrIndexSearcher |
searcher
Searcher to use for all calculations
|
Constructor and Description |
---|
SimpleFacets(SolrQueryRequest req,
DocSet docs,
SolrParams params) |
SimpleFacets(SolrQueryRequest req,
DocSet docs,
SolrParams params,
ResponseBuilder rb) |
Modifier and Type | Method and Description |
---|---|
NamedList |
getFacetCounts()
Looks at various Params to determing if any simple Facet Constraint count
computations are desired.
|
NamedList |
getFacetDateCounts()
Deprecated.
Use getFacetRangeCounts which is more generalized
|
void |
getFacetDateCounts(String dateFacet,
NamedList resOuter)
Deprecated.
Use getFacetRangeCounts which is more generalized
|
NamedList |
getFacetFieldCounts()
Returns a list of value constraints and the associated facet counts
for each facet field specified in the params.
|
NamedList |
getFacetQueryCounts()
Returns a list of facet counts for each of the facet queries
specified in the params
|
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
|
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 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.
|
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
|
protected DocSet docs
protected SolrParams params
protected SolrParams required
protected SolrIndexSearcher searcher
protected SolrQueryRequest req
protected ResponseBuilder rb
protected SimpleOrderedMap facetResponse
public SimpleFacets(SolrQueryRequest req, DocSet docs, SolrParams params)
public SimpleFacets(SolrQueryRequest req, DocSet docs, SolrParams params, ResponseBuilder rb)
public NamedList getFacetCounts()
getFacetQueryCounts()
,
getFacetFieldCounts()
,
getFacetDateCounts()
,
getFacetRangeCounts()
,
FacetParams.FACET
public NamedList getFacetQueryCounts() throws IOException, ParseException
IOException
ParseException
FacetParams.FACET_QUERY
public NamedList getTermCounts(String field) throws IOException
IOException
public NamedList getFacetFieldCounts() throws IOException, ParseException
IOException
ParseException
FacetParams.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
IOException
FacetParams.FACET_MISSING
public static 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 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.IOException
FacetParams.FACET_LIMIT
,
FacetParams.FACET_ZEROS
,
FacetParams.FACET_MISSING
@Deprecated public NamedList getFacetDateCounts() throws IOException, ParseException
IOException
ParseException
FacetParams.FACET_DATE
@Deprecated public void getFacetDateCounts(String dateFacet, NamedList resOuter) throws IOException, ParseException
IOException
ParseException
public NamedList getFacetRangeCounts() throws IOException, ParseException
IOException
ParseException
FacetParams.FACET_RANGE
protected int rangeCount(SchemaField sf, String low, String high, boolean iLow, boolean iHigh) throws IOException
@Deprecated protected int rangeCount(SchemaField sf, Date low, Date high, boolean iLow, boolean iHigh) throws IOException
IOException