public class Grouping extends Object
Modifier and Type | Class and Description |
---|---|
class |
Grouping.Command<T>
General group command.
|
class |
Grouping.CommandField
A group command for grouping on a field.
|
class |
Grouping.CommandFunc
A command for grouping on a function.
|
class |
Grouping.CommandQuery
A group command for grouping on a query.
|
static class |
Grouping.Format |
static class |
Grouping.TotalCount |
Modifier and Type | Field and Description |
---|---|
DocList |
mainResult |
Constructor and Description |
---|
Grouping(SolrIndexSearcher searcher,
QueryResult qr,
QueryCommand cmd,
boolean cacheSecondPassSearch,
int maxDocsPercentageToCache,
boolean main) |
Modifier and Type | Method and Description |
---|---|
void |
add(Grouping.Command groupingCommand) |
void |
addFieldCommand(String field,
SolrQueryRequest request)
Adds a field command based on the specified field.
|
void |
addFunctionCommand(String groupByStr,
SolrQueryRequest request) |
void |
addQueryCommand(String groupByStr,
SolrQueryRequest request) |
void |
execute() |
List<Grouping.Command> |
getCommands() |
static int |
getMax(int offset,
int len,
int max)
Returns offset + len if len equals zero or higher.
|
boolean |
isSignalCacheWarning()
Returns whether a cache warning should be send to the client.
|
Grouping |
setDefaultFormat(Grouping.Format defaultFormat) |
Grouping |
setDefaultTotalCount(Grouping.TotalCount defaultTotalCount) |
Grouping |
setDocsPerGroupDefault(int docsPerGroupDefault) |
Grouping |
setGetGroupedDocSet(boolean getGroupedDocSet) |
Grouping |
setGroupOffsetDefault(int groupOffsetDefault) |
Grouping |
setGroupSort(Sort groupSort) |
Grouping |
setLimitDefault(int limitDefault) |
Grouping |
setWithinGroupSort(Sort withinGroupSort) |
public DocList mainResult
public Grouping(SolrIndexSearcher searcher, QueryResult qr, QueryCommand cmd, boolean cacheSecondPassSearch, int maxDocsPercentageToCache, boolean main)
cacheSecondPassSearch
- Whether to cache the documents and scores from the first pass search for the second
pass search.maxDocsPercentageToCache
- The maximum number of documents in a percentage relative from maxdoc
that is allowed in the cache. When this threshold is met,
the cache is not used in the second pass search.public void add(Grouping.Command groupingCommand)
public void addFieldCommand(String field, SolrQueryRequest request) throws SyntaxError
Grouping.CommandField
it invokes the
addFunctionCommand(String, org.apache.solr.request.SolrQueryRequest)
method.field
- The fieldname to group by.SyntaxError
public void addFunctionCommand(String groupByStr, SolrQueryRequest request) throws SyntaxError
SyntaxError
public void addQueryCommand(String groupByStr, SolrQueryRequest request) throws SyntaxError
SyntaxError
public Grouping setLimitDefault(int limitDefault)
public Grouping setDocsPerGroupDefault(int docsPerGroupDefault)
public Grouping setGroupOffsetDefault(int groupOffsetDefault)
public Grouping setDefaultFormat(Grouping.Format defaultFormat)
public Grouping setDefaultTotalCount(Grouping.TotalCount defaultTotalCount)
public Grouping setGetGroupedDocSet(boolean getGroupedDocSet)
public List<Grouping.Command> getCommands()
public void execute() throws IOException
IOException
public static int getMax(int offset, int len, int max)
offset
- The offsetlen
- The number of documents to returnmax
- The number of document to return if len < 0 or if offset + len > 0public boolean isSignalCacheWarning()
true
is returned when the cache is emptied because the caching limits where met, otherwise
false
is returned.Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.