public class SearchGroupsResultTransformer extends java.lang.Object implements ShardResultTransformer<java.util.List<Command>,java.util.Map<java.lang.String,Pair<java.lang.Integer,java.util.Collection<org.apache.lucene.search.grouping.SearchGroup<java.lang.String>>>>>
SearchGroup
into a NamedList
structure and visa versa.Modifier and Type | Field and Description |
---|---|
private SolrIndexSearcher |
searcher |
Constructor and Description |
---|
SearchGroupsResultTransformer(SolrIndexSearcher searcher) |
Modifier and Type | Method and Description |
---|---|
private NamedList |
serializeSearchGroup(java.util.Collection<org.apache.lucene.search.grouping.SearchGroup<java.lang.String>> data,
org.apache.lucene.search.Sort groupSort) |
NamedList |
transform(java.util.List<Command> data)
Transforms data to a
NamedList structure for serialization purposes. |
java.util.Map<java.lang.String,Pair<java.lang.Integer,java.util.Collection<org.apache.lucene.search.grouping.SearchGroup<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 SolrIndexSearcher searcher
public SearchGroupsResultTransformer(SolrIndexSearcher searcher)
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,Pair<java.lang.Integer,java.util.Collection<org.apache.lucene.search.grouping.SearchGroup<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,Pair<java.lang.Integer,java.util.Collection<org.apache.lucene.search.grouping.SearchGroup<java.lang.String>>>> transformToNative(NamedList<NamedList> shardResponse, org.apache.lucene.search.Sort groupSort, org.apache.lucene.search.Sort sortWithinGroup, java.lang.String shard) throws java.io.IOException
transformToNative
in interface ShardResultTransformer<java.util.List<Command>,java.util.Map<java.lang.String,Pair<java.lang.Integer,java.util.Collection<org.apache.lucene.search.grouping.SearchGroup<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 fromjava.io.IOException
- If I/O related errors occur during transformingprivate NamedList serializeSearchGroup(java.util.Collection<org.apache.lucene.search.grouping.SearchGroup<java.lang.String>> data, org.apache.lucene.search.Sort groupSort)