gpt4 book ai didi

Solr 搜索中的 Solr 字段别名不起作用

转载 作者:行者123 更新时间:2023-12-04 05:43:00 25 4
gpt4 key购买 nike

以下链接说我们可以使用字段别名,如 id,price:crazy_price_field 等。我正在尝试使用它,但这不起作用。
http://wiki.apache.org/solr/CommonQueryParameters#Field_alias
https://issues.apache.org/jira/browse/SOLR-1205

我的查询:

http://localhost:8080/solr/ee_core/select?indent=on&version=2.2&q=\*%3A\*&fq=%2BinstanceId_index_store%3A217&start=0&rows=10&fl=description_index_store%2Cscore&qt=&wt=json

fl=description_index_store,score 使用字段名称给出正确的结果 description_index_store 评分
{
"responseHeader": {
"status": 0,"QTime": 1,
"params": {
"explainOther": "","fl": "description_index_store,score",
"indent": "on","start": "0","q": "*:*","hl.fl": "","qt": "",
"wt": "json","fq": "+instanceId_index_store:217","rows": "3",
"version": "2.2"
}
},
"response": {
"numFound": 128,"start": 0,"maxScore": 1,
"docs": [
{
"description_index_store": "Apple MacBook - Intel Core 2 Duo",
"score": 1
},
{
"description_index_store": "Apple MacBook - Intel Core 2 Duo",
"score": 1
},
{
"description_index_store": "HP Envy - 17.3\" - Intel Core i7",
"score": 1
}
]
}
}

但是当我尝试使用 别名 喜欢 fl=description:description_index_store,score 在同一个查询中,它不返回该字段。
{
"responseHeader": {
"status": 0,"QTime": 0,
"params": {
"explainOther": "","fl": "description:description_index_store,score",
"indent": "on","start": "0","q": "*:*","hl.fl": "","qt": "",
"wt": "json","fq": "+instanceId_index_store:217","rows": "3",
"version": "2.2"
}
},
"response": {
"numFound": 128,"start": 0,"maxScore": 1,
"docs": [
{
"score": 1
},
{
"score": 1
},
{
"score": 1
}
]
}
}

最佳答案

您指的是已添加到 Solr 4.0 版本但尚未发布的功能。其实在fl section内该 wiki 页面有一个感叹号,它告诉您以下内容(仍在 fl 部分中)仅适用于 Solr 4.0。

SOLR-1205 issue已在 SOLR-2444: Update fl syntax to support: pseudo fields, AS, transformers, and wildcards 中与其他改进一起解决,它将与 Solr 4.0 一起发布。您可能想看看 Solr 4.0 roadmap找出什么时候应该发布。

关于Solr 搜索中的 Solr 字段别名不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11029612/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com