【问题标题】:solr group query to return results along with normal resultssolr 组查询以返回结果以及正常结果
【发布时间】: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 个匹配的结果??

【问题讨论】:

    标签: solr grouping


    【解决方案1】:

    这是一个工作示例组查询

    q=*%3A*&wt=json&rows=100000&fq=reported_dt:[2015-10-25T14:55:13.000Z%20TO%202015-12-04T08:38:08.000Z]&fl=reported_dt project_status_val&group=true&group.field=project_number&group.limit=100000
    

    我发现您的 QUERY 中没有数字组字段。

    【讨论】:

    • 我已经添加了结果集和确切的查询,组结果很好,只是我需要其他结果集和组集。有可能吗?
    猜你喜欢
    • 2015-11-01
    • 2019-01-16
    • 1970-01-01
    • 1970-01-01
    • 2016-02-08
    • 2017-06-15
    • 2022-10-13
    • 1970-01-01
    • 2019-07-19
    相关资源
    最近更新 更多