public class TopGroupsResultTransformer extends java.lang.Object implements ShardResultTransformer<java.util.List<Command>,java.util.Map<java.lang.String,?>>
Modifier and Type | Field and Description |
---|---|
private ResponseBuilder |
rb |
Constructor and Description |
---|
TopGroupsResultTransformer(ResponseBuilder rb) |
Modifier and Type | Method and Description |
---|---|
private org.apache.lucene.document.Document |
retrieveDocument(SchemaField uniqueField,
int doc) |
protected NamedList |
serializeTopDocs(QueryCommandResult result) |
protected NamedList |
serializeTopGroups(org.apache.lucene.search.grouping.TopGroups<java.lang.String> data,
SchemaField groupField) |
NamedList |
transform(java.util.List<Command> data)
Transforms data to a
NamedList structure for serialization purposes. |
java.util.Map<java.lang.String,?> |
transformToNative(NamedList<NamedList> shardResponse,
org.apache.lucene.search.Sort groupSort,
org.apache.lucene.search.Sort sortWithinGroup,
java.lang.String shard)
Transforms the specified shard response into native structures.
|
private final ResponseBuilder rb
public TopGroupsResultTransformer(ResponseBuilder rb)
public NamedList transform(java.util.List<Command> data) throws java.io.IOException
NamedList
structure for serialization purposes.transform
in interface ShardResultTransformer<java.util.List<Command>,java.util.Map<java.lang.String,?>>
data
- The data to be transformedNamedList
structurejava.io.IOException
- If I/O related errors occur during transformingpublic java.util.Map<java.lang.String,?> transformToNative(NamedList<NamedList> shardResponse, org.apache.lucene.search.Sort groupSort, org.apache.lucene.search.Sort sortWithinGroup, java.lang.String shard)
transformToNative
in interface ShardResultTransformer<java.util.List<Command>,java.util.Map<java.lang.String,?>>
shardResponse
- The shard response containing data in a NamedList
structuregroupSort
- The group sortsortWithinGroup
- The sort inside a groupshard
- The shard address where the response originated fromprotected NamedList serializeTopGroups(org.apache.lucene.search.grouping.TopGroups<java.lang.String> data, SchemaField groupField) throws java.io.IOException
java.io.IOException
protected NamedList serializeTopDocs(QueryCommandResult result) throws java.io.IOException
java.io.IOException
private org.apache.lucene.document.Document retrieveDocument(SchemaField uniqueField, int doc) throws java.io.IOException
java.io.IOException