我正在使用Solr 7.6。我正在按其子文档字段对父文档进行排序。在此,父文档按子文档的“计数”字段的总和排序。如果所有父文档都具有子文档,它会给出正确的结果,但是如果父文档没有子文档,则失败。
文档结构:
{
"source_ln": "hi",
"source_text": "पूर्व में बंगाल की खाड़ी है तथा पश्चिम में अरब सागर हैं|",
"target_ln": "en",
"target_text": "In the east is the Bay of Bengal and the Arabian Sea in the west.",
"organizations": [
"3"
],
"type": "segment",
"id": "257c051c-ca53-4d32-968b-ea20f420f3c7",
"_version_": 1627977518610907100,
"_childDocuments_": [
{
"id": "1",
"type": "tag",
"count": 2,
"_version_": 1627977518610907100
},
{
"id": "1",
"type": "tag",
"count": 2,
"organization_id": "3",
"_version_": 1627977518610907100
}
]
}
排序排序查询:
sort={!parent which=type:segment score=total v="+type:tag +{!func}count"} desc
那么,我们应该在哪个字段上使用“ sortMissingLast”参数?