创建嵌套索引结构SOLR

时间:2018-08-10 07:18:44

标签: indexing solr lucene nested document

我想使用SOLR导入处理程序创建嵌套索引结构。我正在使用Solr -7.2,我已经创建了data-config.xml
https://issues.apache.org/jira/browse/SOLR-5147),

<document>
        <entity name="PARENT" query="select * from parent">
          <field column="id" />
          <field column="title" />
          <field column="type_s" />
          <entity child="true" name="CHILD" query="select * from child where 
           parent_id='${PARENT.id}'">
                <field column="id" />
                <field column="post" />
                    <field column="parent_id" />
          </entity>
    </entity>   
 </document>

但是由于以下查询,我没有得到嵌套的索引文档, http://xyzhost:8983/solr/myCollection/select?fl= ,[child%20parentFilter = title:%22test%22]&q = :* 我在这里想念什么?

导入的文档如下所示,

` "response":{"numFound":6,"start":0,"docs":[
  {
    "post":"dev1",
    "parent_id":"1",
    "id":"1",
    "_version_":1608402260456374272},
  {
    "post":"dev3",
    "parent_id":"1",
    "id":"3",
    "_version_":1608402260456374272},
  {
    "id":"1",
    "title":"test1",
    "_version_":1608402260456374272},
  {
    "post":"dev2",
    "parent_id":"2",
    "id":"2",
    "_version_":1608402260460568576},
  {
    "post":"dev4",
    "parent_id":"4",
    "id":"4",
    "_version_":1608402260460568576},
  {
    "id":"2",
    "title":"test2",
    "_version_":1608402260460568576}]

}}`

0 个答案:

没有答案