Solr中的嵌套json对象

时间:2019-06-14 08:58:47

标签: solr nested

我已经尝试过http://yonik.com/solr-nested-objects/中的指南,但是在尝试返回带有父ID的子文档时,它对我不起作用。

我正在使用最新版本的Solr,在我的情况下为Solr 8.1.0。

使用以下代码与父母一起返回book1的注释。

q = cat_s: (fantasy OR sci - fi) & fl = id, [child parentFilter = type_s: book]

错误消息如下:

{  
   "responseHeader":{  
      "status":400,
      "QTime":70,
      "params":{  
         "q":"cat_s:(fantasy OR sci-fi)",
         "fl":"id,[child parentFilter=type_s:book]",
         "_":"1560502563083"
      }
   },
   "error":{  
      "metadata":[  
         "error-class",
         "org.apache.solr.common.SolrException",
         "root-error-class",
         "org.apache.solr.common.SolrException"
      ],
      "msg":"Parent filter should not be sent when the schema is nested",
      "code":400
   }
}  

1 个答案:

答案 0 :(得分:0)

为了解决这个问题,我必须通过注释掉该行来编辑 managed-schema.xml --> 像这样