gpt4 book ai didi

elasticsearch - 没有从 elasticsearch 获得术语向量结果?

转载 作者:行者123 更新时间:2023-11-29 02:56:51 25 4
gpt4 key购买 nike

enter image description here

我正在关注 https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html但是无法获得预期的结果。我哪里做错了?

文档的格式是:

PUT integrity
{
"mappings": {
"body": {
"properties": {
"label": {
"type": "keyword",
"index": "not_analyzed",
"store": true
},
"body": {
"type": "text",
"store": true
}
}
}
}
}

最佳答案

_all 字段的默认映射不包括存储术语向量:

    "_all": {
"full_name": "_all",
"mapping": {
"_all": {
"enabled": true,
"store": false,
"store_term_vectors": false,
"store_term_vector_offsets": false,
"store_term_vector_positions": false,
"store_term_vector_payloads": false,
"norms": true,
"analyzer": "default",
"similarity": "BM25"
}
}
}

而且,_all 字段似乎有点特殊,而 Elasticsearch 没有 compute the vectors on the fly .

_all 的唯一选择是在其上启用术语向量:

PUT integrity
{
"mappings": {
"body": {
"_all": {
"term_vector": "with_positions_offsets"
},
"properties": {
"label": {
"type": "keyword",
"index": "not_analyzed",
"store": true
},
"body": {
"type": "text",
"store": true
}
}
}
}
}

关于elasticsearch - 没有从 elasticsearch 获得术语向量结果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40770000/

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