在Solr应用程序中获取groupValue时遇到一些问题。我想在jquery自动完成标签中显示solr groupValue。但我不知道这是怎么回事。这是我的查询回复
{
"responseHeader":{
"status":0,
"QTime":2201,
"params":{
"q":"strSO:*",
"indent":"true",
"start":"0",
"rows":"2147483647",
"wt":"json",
"group.field":"strSO",
"group":"true"}},
"grouped":{
"strSO":{
"matches":112559,
"groups":[{
"groupValue":"EV11777-01",
"doclist":{"numFound":53,"start":0,"docs":[
{
"id":"385",
"NameAdded":["LOKMAN ERTU?RUL KO�"],
"DateAdded":"2017-05-29T00:00:00Z",
"strSO_ngram":"EV11777-01",
"PackName":["06 Delivery Documents - MiniPack"],
"PackName_ngram":"06 Delivery Documents - MiniPack",
"DocName":["EV12333-04 ACCESSORY AND EBU CHECK LIST"],
"DocType":["GEN"],
"DocType_ngram":"GEN",
"extType":["pdf"],
"FileName":["EV12333-04 ACCESSORY AND EBU CHECK LIST.pdf"],
"FilePath":["Y:\\Engine_Follow\\V2500-A5\\Released Engines\\IAE-CMC\\IAE Lease\\EV12333-04 IAE-FHA LEP\\06_Delivery_Documents\\1- MINIPACK\\EV12333-04 ACCESSORY AND EBU CHECK LIST.pdf"],
"_version_":1627079763904430080,
"strSO":"EV11777-01"}]
}},
我的jquery在这里
<script>
$(function() {
var URL_PREFIX = "http://localhost:8983/solr/archiveCore/select?group=true&group.field=strSO&rows=2147483647&q=strSO:";
var URL_SUFFIX = "&wt=json"; // facet.field=strSO&facet=on&rows=0";
$("#searchBoxstrSO").autocomplete({
source : function(request, response) {
var URL = URL_PREFIX + $("#searchBoxstrSO").val() + URL_SUFFIX;
$.ajax({
url : URL,
success : function(data) {
var docs = JSON.stringify(data.grouped.strSO.groups[groupValue]);
var jsonData = JSON.parse(docs);
response($.map(jsonData, function(value) {
return {
label : value
}
}));
},
dataType : 'jsonp',
jsonp : 'json.wrf'
});
},
minLength : 0
})
});
$(function() {
var URL_PREFIX = "http://localhost:8983/solr/archiveCore/select?group=true&group.field=strSO&rows=2147483647&q=strSO:";
var URL_MIDDLE = "OR strSO_ngram:";
var URL_SUFFIX = "&wt=json"; // &facet.field=strSO&facet=on&rows=0"; // &facet.field=strSO&facet=on&rows=0 added
$("#ngramBoxstrSO").autocomplete(
{
source : function(request, response) {
var searchString = "\"" + $("#ngramBoxstrSO").val() + "\"";
var URL = URL_PREFIX + searchString + URL_MIDDLE
+ searchString + URL_SUFFIX;
$.ajax({
url : URL,
success : function(data) {
var docs = JSON.stringify(data.grouped.strSO.groups[groupValue]);;
var jsonData = JSON.parse(docs);
response($.map(jsonData, function(value) {
return {
label : value
}
}));
},
dataType : 'jsonp',
jsonp : 'json.wrf'
});
},
minLength : 0
})
});
</script>
如何访问查询响应的groupValue或doclist的文档。有什么想法吗? jQuery或Solr中有问题吗?