在solr中我必须在我的数据库的'name'字段中获取uniqque值。
因为这个原因,我读到了关于分组和Iget the desored esult
{
"responseHeader":{
"status":0,
"QTime":16,
"params":{
"indent":"true",
"q":"name:И*",
"group.field":"name",
"group":"true",
"wt":"json"}},
"grouped":{
"name":{
"matches":2231,
"groups":[{
"groupValue":"ИВАН",
"doclist":{"numFound":1144,"start":0,"docs":[
{
"obshtina":"ПЛОВДИВ",
"phone":"032/670309",
"timestamp":"2013-03-04T08:43:53.553Z"}]
}},
{
"groupValue":"ИЛИЯ",
"doclist":{"numFound":177,"start":0,"docs":[
{
"obshtina":"БРЕЗОВО",
"phone":"(3191)2265",
..............................
我得到了第一个groupValue
var str = xmlhttp.responseText;
alert (str); //here everything is OK - i get the respone correctly
var rsp = JSON.parse(str);
//var rsp = JSON.parse(xmlhttp.responseText);
var srcAutoComp = new Array();
alert ("grouped:" + rsp.grouped.name.groups[0].groupValue);
但似乎无论我阅读了多少,我都无法在solr的响应中找到群组的数量,这样我就可以获得所有的goupvalues。
˚F