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.
|
protected static class |
SimpleFacets.ParsedParams |
| Modifier and Type | Field and Description |
|---|---|
protected DocSet |
docsOrig
The main set of documents all facet counts should be relative to
|
protected SolrParams |
global
Configuration params behavior should be driven by
|
protected ResponseBuilder |
rb |
protected SolrQueryRequest |
req |
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 |
|---|---|
protected DocSet |
computeDocSet(DocSet baseDocSet,
List<String> excludeTagList) |
static boolean |
contains(String ref,
String substring,
boolean ignoreCase)
Returns
true if a String contains the given substring. |
DocSet |
getDocsOrig() |
NamedList<Object> |
getFacetFieldCounts()
Returns a list of value constraints and the associated facet counts
for each facet field specified in the params.
|
NamedList<Object> |
getFacetIntervalCounts()
Returns a
NamedList with each entry having the "key" of the interval as name and the count of docs
in that interval as value. |
void |
getFacetQueryCount(SimpleFacets.ParsedParams parsed,
NamedList<Integer> res) |
NamedList<Integer> |
getFacetQueryCounts()
Returns a list of facet counts for each of the facet queries
specified in the params
|
NamedList<Integer> |
getFacetTermEnumCounts(SolrIndexSearcher searcher,
DocSet docs,
String field,
int offset,
int limit,
int mincount,
boolean missing,
String sort,
String prefix,
String contains,
boolean ignoreCase,
SolrParams params)
Returns a list of terms in the specified field along with the
corresponding count of documents in the set that match that constraint.
|
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.
|
SolrParams |
getGlobalParams() |
NamedList<Integer> |
getGroupedCounts(SolrIndexSearcher searcher,
DocSet base,
String field,
boolean multiToken,
int offset,
int limit,
int mincount,
boolean missing,
String sort,
String prefix,
String contains,
boolean ignoreCase) |
int |
getGroupedFacetQueryCount(Query facetQuery,
DocSet docSet)
Returns a grouped facet count for the facet query
|
NamedList |
getHeatmapCounts() |
protected NamedList<Integer> |
getListedTermCounts(String field,
SimpleFacets.ParsedParams parsed,
List<String> terms)
Computes the term->count counts for the specified term values relative to the
|
SolrQueryRequest |
getRequest() |
ResponseBuilder |
getResponseBuilder() |
NamedList<Integer> |
getTermCounts(String field,
SimpleFacets.ParsedParams parsed)
Term counts for use in field faceting that resepects the appropriate mincount
|
NamedList<Integer> |
getTermCountsForPivots(String field,
SimpleFacets.ParsedParams parsed)
Term counts for use in pivot faceting that resepcts the appropriate mincount
|
protected SimpleFacets.ParsedParams |
parseParams(String type,
String param) |
protected DocSet docsOrig
protected final SolrParams global
protected final SolrIndexSearcher searcher
protected final SolrQueryRequest req
protected final ResponseBuilder rb
public SimpleFacets(SolrQueryRequest req, DocSet docs, SolrParams params)
public SimpleFacets(SolrQueryRequest req, DocSet docs, SolrParams params, ResponseBuilder rb)
public static boolean contains(String ref, String substring, boolean ignoreCase)
true if a String contains the given substring. Otherwise
false.ref - the String to testsubstring - the substring to look forignoreCase - whether the comparison should be case-insensitivetrue iff the String contains the given substring.
Otherwise false.protected SimpleFacets.ParsedParams parseParams(String type, String param) throws SyntaxError, IOException
SyntaxErrorIOExceptionprotected DocSet computeDocSet(DocSet baseDocSet, List<String> excludeTagList) throws SyntaxError, IOException
SyntaxErrorIOExceptionpublic NamedList<Integer> getFacetQueryCounts() throws IOException, SyntaxError
IOExceptionSyntaxErrorFacetParams.FACET_QUERYpublic void getFacetQueryCount(SimpleFacets.ParsedParams parsed, NamedList<Integer> res) throws SyntaxError, IOException
SyntaxErrorIOExceptionpublic int getGroupedFacetQueryCount(Query facetQuery, DocSet docSet) throws IOException
IOExceptionFacetParams.FACET_QUERYpublic NamedList<Integer> getTermCountsForPivots(String field, SimpleFacets.ParsedParams parsed) throws IOException
IOExceptionFacetParams.FACET_PIVOT_MINCOUNTpublic NamedList<Integer> getTermCounts(String field, SimpleFacets.ParsedParams parsed) throws IOException
IOExceptionFacetParams.FACET_MINCOUNTpublic NamedList<Integer> getGroupedCounts(SolrIndexSearcher searcher, DocSet base, String field, boolean multiToken, int offset, int limit, int mincount, boolean missing, String sort, String prefix, String contains, boolean ignoreCase) throws IOException
IOExceptionpublic NamedList<Object> getFacetFieldCounts() throws IOException, SyntaxError
IOExceptionSyntaxErrorFacetParams.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, java.lang.String, boolean, org.apache.solr.common.params.SolrParams)protected NamedList<Integer> getListedTermCounts(String field, SimpleFacets.ParsedParams parsed, List<String> terms) throws IOException
field - the name of the field to compute term counts againstparsed - contains the docset to compute term counts relative toterms - a list of term values (in the specified field) to compute the counts forIOExceptionpublic static int getFieldMissingCount(SolrIndexSearcher searcher, DocSet docs, String fieldName) throws IOException
IOExceptionFacetParams.FACET_MISSINGpublic NamedList<Integer> getFacetTermEnumCounts(SolrIndexSearcher searcher, DocSet docs, String field, int offset, int limit, int mincount, boolean missing, String sort, String prefix, String contains, boolean ignoreCase, SolrParams params) throws IOException
docs
and the DocSet for each term in the filter.IOExceptionFacetParams.FACET_LIMIT,
FacetParams.FACET_ZEROS,
FacetParams.FACET_MISSINGpublic NamedList<Object> getFacetIntervalCounts() throws IOException, SyntaxError
NamedList with each entry having the "key" of the interval as name and the count of docs
in that interval as value. All intervals added in the request are included in the returned
NamedList (included those with 0 count), and it's required that the order of the intervals
is deterministic and equals in all shards of a distributed request, otherwise the collation of results
will fail.IOExceptionSyntaxErrorpublic NamedList getHeatmapCounts() throws IOException, SyntaxError
IOExceptionSyntaxErrorpublic SolrParams getGlobalParams()
public DocSet getDocsOrig()
public SolrQueryRequest getRequest()
public ResponseBuilder getResponseBuilder()
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.