Solr Join不返回任何结果



我使用Solr 8.10作为docker,具有自定义模式,包含以下行:

<uniqueKey>id</uniqueKey>
<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
<field name="relationship_name" type="keywordAnalyzer" indexed="true" stored="true" required="true" multiValued="false" />
<field name="entity_docRef1" type="string" indexed="true" stored="true" required="true" multiValued="false" />
<field name="entity_docRef2" type="string" indexed="true" stored="true" required="true" multiValued="false" />
<field name="created_at" type="date" indexed="true" stored="true" required="true" multiValued="false" />
<field name="modified_at" type="date" indexed="true" stored="true" required="true" multiValued="false" />
<field name="created_by" type="string" indexed="true" stored="true" required="true" multiValued="false" />
<field name="modified_by" type="string" indexed="true" stored="true" required="true" multiValued="false" />

<dynamicField name="___target*" type="string" indexed="true" stored="true" multiValued="false"/>
<dynamicField name="___source*" type="string" indexed="true" stored="true" multiValued="false"/>
<dynamicField name="___link*" type="string" indexed="true" stored="true" multiValued="false"/>

我使用postman

创建了以下数据
[
{
"id": "44",
"relationship_name": "Co-insured",
"entity_docRef1": "HomeInsurence/1",
"entity_docRef2": "BusinessPartner/Tomas",
"created_at": "2021-10-18T14:38:20.985Z",
"created_by": "admin",
"modified_at": "2021-10-18T14:38:20.985Z",
"modified_by": "admin",
"fulltext": "data",
"___target.name": "Tomas Bajus",
"___target.region": "Slovakia",
"___source.contract.company": "Generali",
"___source.contract.id": "Generali/1",
"___link.signed_at": "2021-10-18T14:38:20.985Z"
},
{
"id": "48",
"relationship_name": "PostalAddress",
"entity_docRef1": "BusinessPartner/Tomas",
"entity_docRef2": "PostalAddress/1",
"created_at": "2021-10-18T14:38:20.985Z",
"created_by": "admin",
"modified_at": "2021-10-18T14:38:20.985Z",
"modified_by": "admin",
"fulltext": "data",
"___source.name": "Tomas Bajus",
"___source.region": "Slovakia",
"___target.City": "Presov",
"___target.Street_name": "Hlavna 1",
"___target.zip": "08271"
}
]

创建的数据在Solr中使用管理控制台可见:

{
"responseHeader":{
"status":0,
"QTime":0,
"params":{
"q":"*:*",
"fl":"*",
"q.op":"OR",
"_":"1634718235445"}},
"response":{"numFound":2,"start":0,"numFoundExact":true,"docs":[
{
"id":"44",
"relationship_name":"Co-insured",
"entity_docRef1":"HomeInsurence/1",
"entity_docRef2":"BusinessPartner/Tomas",
"created_at":"2021-10-18T14:38:20.985Z",
"created_by":"admin",
"modified_at":"2021-10-18T14:38:20.985Z",
"modified_by":"admin",
"___target.name":"Tomas Bajus",
"___target.region":"Slovakia",
"___source.contract.company":"Generali",
"___source.contract.id":"Generali/1",
"___link.signed_at":"2021-10-18T14:38:20.985Z",
"_version_":1714126727193559040},
{
"id":"48",
"relationship_name":"PostalAddress",
"entity_docRef1":"BusinessPartner/Tomas",
"entity_docRef2":"PostalAddress/1",
"created_at":"2021-10-18T14:38:20.985Z",
"created_by":"admin",
"modified_at":"2021-10-18T14:38:20.985Z",
"modified_by":"admin",
"___source.name":"Tomas Bajus",
"___source.region":"Slovakia",
"___target.City":"Presov",
"___target.Street_name":"Hlavna 1",
"___target.zip":"08271",
"_version_":1714126727567900672}]
}}

我正在尝试执行以下join

{
"responseHeader":{
"status":0,
"QTime":1,
"params":{
"q":"{!join from=entity_docRef1 to=entity_docRef2}___target.zip: 08271",
"fl":"*",
"q.op":"OR",
"_":"1634718235445"}},
"response":{"numFound":0,"start":0,"numFoundExact":true,"docs":[]
}}

但是我没有回应。我的目的是通过在其他文档上过滤___target.zip来获得结果集中的文档44。

我做错了什么?为什么连接查询没有结果?我认为id必须在jointoto语句中指定,但Solr文档中没有指定这样的要求https://solr.apache.org/guide/8_10/other-parsers.html#join-query-parser

字段的名称,其中包含要在"to"中查找的值。字段。可以是单值或多值,但必须具有与"到"中表示的字段兼容的字段类型。字段。

必选参数。

字段的名称,其值将与"from"中的值进行检查。字段。可以是单值或多值,但字段类型必须与"from"兼容。字段。

必选参数。

我已经尝试了例子中的连接语句,这一个工作得很好,但连接请求看起来完全相同

谢谢你的帮助!

通过添加JoinParser来更新solrconfig.xml解决了这个问题

相关内容

  • 没有找到相关文章

最新更新