Grouping (Solr 3.6.2 API)
Keywords: org.apache.solr.search.Grouping class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.solr.search
Class Grouping

    java.lang.Object
      org.apache.solr.search.Grouping

    public class Grouping

extends Object

Basic Solr Grouping infrastructure. Warning NOT thread save!

WARNING: This API is experimental and might change in incompatible ways in the next release.

Nested Class Summary
`class` | `Grouping.Command<GROUP_VALUE_TYPE>` General group command.
`class` | `Grouping.CommandField` A group command for grouping on a field.
`class` | `Grouping.CommandQuery` A group command for grouping on a query.
`static class` | `Grouping.Format`
`static class` | `Grouping.TotalCount`

Field Summary
`DocList` | `mainResult`

Constructor Summary
`Grouping(SolrIndexSearcher searcher, SolrIndexSearcher.QueryResult qr, SolrIndexSearcher.QueryCommand cmd, boolean cacheSecondPassSearch, int maxDocsPercentageToCache, boolean main)`

Method Summary
`void` | `add(Grouping.Command groupingCommand)`
`void` | `addFieldCommand(String field, SolrQueryRequest request)` Adds a field command based on the specified field.
`void` | `addQueryCommand(String groupByStr, SolrQueryRequest request)`
`void` | `execute()`
`List<Grouping.Command>` | `getCommands()`
`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` | `setSort(Sort sort)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### mainResult

    public DocList mainResult

Constructor Detail

### Grouping

    public Grouping(SolrIndexSearcher searcher,
                    SolrIndexSearcher.QueryResult qr,
                    SolrIndexSearcher.QueryCommand cmd,
                    boolean cacheSecondPassSearch,
                    int maxDocsPercentageToCache,
                    boolean main)

Parameters:
  `searcher` -
  `qr` -
  `cmd` -
  `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.

Method Detail

### add

    public void add(Grouping.Command groupingCommand)

### addFieldCommand

    public void addFieldCommand(String field,
                                SolrQueryRequest request)
                         throws ParseException

  Adds a field command based on the specified field.

  Parameters:
    `field` - The fieldname to group by.
  Throws:
    `ParseException`

### addQueryCommand

    public void addQueryCommand(String groupByStr,
                                SolrQueryRequest request)
                         throws ParseException

  Throws:
    `ParseException`

### setSort

    public Grouping setSort(Sort sort)

### setGroupSort

    public Grouping setGroupSort(Sort groupSort)

### setLimitDefault

    public Grouping setLimitDefault(int limitDefault)

### setDocsPerGroupDefault

    public Grouping setDocsPerGroupDefault(int docsPerGroupDefault)

### setGroupOffsetDefault

    public Grouping setGroupOffsetDefault(int groupOffsetDefault)

### setDefaultFormat

    public Grouping setDefaultFormat(Grouping.Format defaultFormat)

### setDefaultTotalCount

    public Grouping setDefaultTotalCount(Grouping.TotalCount defaultTotalCount)

### setGetGroupedDocSet

    public Grouping setGetGroupedDocSet(boolean getGroupedDocSet)

### getCommands

    public List<Grouping.Command> getCommands()

### execute

    public void execute()
                 throws IOException

  Throws:
    `IOException`

### isSignalCacheWarning

    public boolean isSignalCacheWarning()

  Returns whether a cache warning should be send to the client. The value `true` is returned when the cache is emptied because the caching limits where met, otherwise `false` is returned.

  Returns:
    whether a cache warning should be send to the client

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD