【发布时间】:2015-10-29 12:36:55
【问题描述】:
我正在尝试 solr 中的组查询
http://localhost:8983/solr/venue/select?q=allText%3A%22holiday+inn%22&rows=100&wt=json&indent=true&group=true&group.query=title:(holiday%20inn)&group.limit=10
这给了我“假日旅馆”在标题中匹配的结果,allText 字段是一个复制字段,其中包含字段标题、位置和描述的值
我尝试的是设置
group.main=true
但是在这样做之后,它给了我所有没有分组的记录。 我想要的是分组的所有记录
提前致谢
我在建议之后使用的查询是
http://localhost:8983/solr/venue/select?wt=json&indent=true&q=*%3A*&wt=json&rows=100000&fq=title:%22holiday%20inn%22&fl=title&group=true&group.field=title&group.limit=100000
这给了我结果
"responseHeader":{
"status":0,
"QTime":30,
"params":{
"q":"allText:(holiday inn)",
"indent":"true",
"fl":"title",
"group.limit":"100000",
"fq":"title:\"holiday inn\"",
"rows":"100000",
"wt":["json",
"json"],
"group.field":"title",
"group":"true"}},
"grouped":{
"title":{
"matches":1,
"groups":[{
"groupValue":"holiday",
"doclist":{"numFound":1,"start":0,"docs":[
{
"id":209,
"title":"Holiday Inn"}]
}}]}}]
除了正确的分组结果,我还能得到 q=allText:(holiday inn) 的结果,没有分组会给出 25 个匹配的结果??
【问题讨论】: