Hi,
Just to clarify what I'm trying to accomplish. I'm trying to translate the
http solr query into using RiakSearchRequest/RiakFluentSearch.
I've gotten this far but I cannot figure out how to do grouping in solr
using .net:
using (var cluster = RiakCluster.FromConfig("riakConfig"))
{
List<string> fields = new List<string>();
List<string> dates = new List<string>();
fields.Add("DateOnly_s");
IRiakClient client = cluster.CreateClient();
var search = new RiakSearchRequest
{
Start = 0,
Rows = 50000,
ReturnFields = fields,
Query = new RiakFluentSearch("cdkcdrbucketindex",
"TransmissionStateName_s")
.Search("DELIVERED")
.Build()
};
var rslt = client.Search(search);
RiakSearchResult sr = rslt.Value;
foreach (RiakSearchResultDocument doc in sr.Documents)
{
dates.Add(doc.Fields[0].Value.ToString());
}
var grouped = dates
.GroupBy(s => s)
.Select(group => new { Date = group.Key, Count =
group.Count() });
foreach( var t in grouped)
{
t.Date.ToString();
t.Count.ToString();
}
grouped.Count();
}
Does it make sense to aggregate the data into a bucket which models the
desired result set instead of trying to do the aggregation using
RiakSearchRequest/RiakFluentSearch?
Thanks,
Dennis
From: Dennis Nicolay [mailto:[email protected]]
Sent: Tuesday, November 24, 2015 8:05 AM
To: [email protected]
Subject: Solr Results Grouping using RiakSearchRequest
Hi,
Is there a way to use RiakSearchRequest to accomplish the following http
solr query?
http://10.3.3.190:8091/solr/cdkcdrbucketindex/select?wt=json
<http://10.3.3.190:8091/solr/cdkcdrbucketindex/select?wt=json&indent=true&fl
=DateOnly_s&q=TransmissionStateName_s:DELIVERED&group=true&group.field=DateO
nly_s&rows=10000000>
&indent=true&fl=DateOnly_s&q=TransmissionStateName_s:DELIVERED&group=true&gr
oup.field=DateOnly_s&rows=10000000
Thanks,
Dennis
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com