Class TopGroupsResultTransformer
- java.lang.Object
-
- org.apache.solr.search.grouping.distributed.shardresultserializer.TopGroupsResultTransformer
-
- All Implemented Interfaces:
ShardResultTransformer<List<Command<?>>,Map<String,?>>
public class TopGroupsResultTransformer extends Object implements ShardResultTransformer<List<Command<?>>,Map<String,?>>
Implementation for transformingTopGroups
andTopDocs
into aNamedList
structure and vice versa.
-
-
Constructor Summary
Constructors Constructor Description TopGroupsResultTransformer(ResponseBuilder rb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.solr.common.util.NamedList<Object>
serializeTopDocs(QueryCommandResult result)
protected org.apache.solr.common.util.NamedList<Object>
serializeTopGroups(org.apache.lucene.search.grouping.TopGroups<org.apache.lucene.util.BytesRef> data, SchemaField groupField)
org.apache.solr.common.util.NamedList<org.apache.solr.common.util.NamedList<Object>>
transform(List<Command<?>> data)
Transforms data to aNamedList
structure for serialization purposes.Map<String,?>
transformToNative(org.apache.solr.common.util.NamedList<org.apache.solr.common.util.NamedList<?>> shardResponse, org.apache.lucene.search.Sort groupSort, org.apache.lucene.search.Sort withinGroupSort, String shard)
Transforms the specified shard response into native structures.protected org.apache.lucene.search.ScoreDoc[]
transformToNativeShardDoc(List<org.apache.solr.common.util.NamedList<Object>> documents, org.apache.lucene.search.Sort groupSort, String shard, IndexSchema schema)
-
-
-
Constructor Detail
-
TopGroupsResultTransformer
public TopGroupsResultTransformer(ResponseBuilder rb)
-
-
Method Detail
-
transform
public org.apache.solr.common.util.NamedList<org.apache.solr.common.util.NamedList<Object>> transform(List<Command<?>> data) throws IOException
Description copied from interface:ShardResultTransformer
Transforms data to aNamedList
structure for serialization purposes.- Specified by:
transform
in interfaceShardResultTransformer<List<Command<?>>,Map<String,?>>
- Parameters:
data
- The data to be transformed- Returns:
NamedList
structure- Throws:
IOException
- If I/O related errors occur during transforming
-
transformToNative
public Map<String,?> transformToNative(org.apache.solr.common.util.NamedList<org.apache.solr.common.util.NamedList<?>> shardResponse, org.apache.lucene.search.Sort groupSort, org.apache.lucene.search.Sort withinGroupSort, String shard)
Description copied from interface:ShardResultTransformer
Transforms the specified shard response into native structures.- Specified by:
transformToNative
in interfaceShardResultTransformer<List<Command<?>>,Map<String,?>>
- Parameters:
shardResponse
- The shard response containing data in aNamedList
structuregroupSort
- The group sortwithinGroupSort
- The sort inside a groupshard
- The shard address where the response originated from- Returns:
- native structure of the data
-
transformToNativeShardDoc
protected org.apache.lucene.search.ScoreDoc[] transformToNativeShardDoc(List<org.apache.solr.common.util.NamedList<Object>> documents, org.apache.lucene.search.Sort groupSort, String shard, IndexSchema schema)
-
serializeTopGroups
protected org.apache.solr.common.util.NamedList<Object> serializeTopGroups(org.apache.lucene.search.grouping.TopGroups<org.apache.lucene.util.BytesRef> data, SchemaField groupField) throws IOException
- Throws:
IOException
-
serializeTopDocs
protected org.apache.solr.common.util.NamedList<Object> serializeTopDocs(QueryCommandResult result) throws IOException
- Throws:
IOException
-
-