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 transformingTopGroupsandTopDocsinto aNamedListstructure 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 aNamedListstructure 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:ShardResultTransformerTransforms data to aNamedListstructure for serialization purposes.- Specified by:
transformin interfaceShardResultTransformer<List<Command<?>>,Map<String,?>>- Parameters:
data- The data to be transformed- Returns:
NamedListstructure- 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:ShardResultTransformerTransforms the specified shard response into native structures.- Specified by:
transformToNativein interfaceShardResultTransformer<List<Command<?>>,Map<String,?>>- Parameters:
shardResponse- The shard response containing data in aNamedListstructuregroupSort- 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
-
-