我们在Retrieve和Rank中有一个Solr集合,其中包含一个名为 document_sub_type 的字段。此字段在Solr架构中编制索引,但没有字段类型值(我理解,排名者要使用的字段必须具有字段类型值“Watson_text_en”;此字段没有)。我们希望在此 document_sub_type 元数据字段中过滤结果。
如果我将查询 电源系统客户端参考AND(document_sub_type:“客户参考*”或document_sub_type:“案例研究*”) 发送到 /选择R& R的端点,我只返回document_sub_type值为“Client Reference Book”或“Client Reference Brief”的文档,正如预期的那样。但是,如果我将相同的查询发送到 / fcselect 端点,则返回的文档的document_sub_type值可能显然包含任何值。
我承认我们的排名没有经过全面训练,但即使我们从查询中省略了排名,也会发生这种情况。
为什么/ fcselect会忽略查询的元数据部分?
以下是两个查询的完整回复正文:
来自/选择:
{
"responseHeader": {
"status": 0,
"QTime": 2,
"params": {
"q": "power systems client reference AND (document_sub_type:\"Client Reference*\" OR document_sub_type:\"Case Study*\")",
"fl": "document_sub_type",
"wt": "json"
}
},
"response": {
"numFound": 89,
"start": 0,
"docs": [
{
"document_sub_type": "Client Reference Book"
},
{
"document_sub_type": "Client Reference Brief"
},
{
"document_sub_type": "Client Reference Brief"
},
{
"document_sub_type": "Client Reference Brief"
},
{
"document_sub_type": "Client Reference Book"
},
{
"document_sub_type": "Client Reference Brief"
},
{
"document_sub_type": "Client Reference Brief"
},
{
"document_sub_type": "Client Reference Brief"
},
{
"document_sub_type": "Client Reference Brief"
},
{
"document_sub_type": "Client Reference Brief"
}
]
}
}
来自/ fcselect:
{
"responseHeader": {
"status": 0,
"QTime": 65,
"params": {
"q": "power systems client reference AND (document_sub_type:\"Client Reference*\" OR document_sub_type:\"Case Study*\")",
"ranker_id": "c852c8x19-rank-422",
"fl": "document_sub_type",
"wt": "json"
}
},
"response": {
"numFound": 39428,
"start": 0,
"maxScore": 10,
"docs": [
{
"document_sub_type": "Sales guidance"
},
{
"document_sub_type": "Other sales tool or Utility"
},
{
"document_sub_type": "Client Reference Book"
},
{
"document_sub_type": "Client Reference Brief"
},
{
"document_sub_type": "Client Reference Book"
},
{
"document_sub_type": "At a Glance"
},
{
"document_sub_type": "Brief or Template for Marketing"
},
{
"document_sub_type": "text/plain"
},
{
"document_sub_type": "Brief or Template for Marketing"
},
{
"document_sub_type": "QRG"
}
]
}
}
答案 0 :(得分:0)
/ fcselect端点不支持在查询参数本身中将术语与布尔运算符组合。对于此类操作,您应该能够使用筛选查询来获得预期结果。有关详细信息,请参阅此处的文档:https://www.ibm.com/watson/developercloud/doc/retrieve-rank/plugin_query_syntax.shtml#top