【问题标题】:How to return term scores in elasticsearch?如何在弹性搜索中返回术语分数?
【发布时间】:2016-07-22 03:56:32
【问题描述】:

如何在 elasticsearch 中获取索引文档的词向量?

也就是说,一旦我将多个文档上传到我的 elasticsearch 索引,我想取回已评分的术语向量,以便我可以查看哪些术语对于给定文档的索引过度,因此文档显示最多有影响的术语。

这可能吗?

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    您可以使用 Term Vectors API 实现这一点:https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html

    假设您已经索引了多个文档。然后可以使用以下 API 调用获取术语向量:

    curl -XGET 'http://localhost:9200/twitter/tweet/<id>/_termvectors?pretty=true'
    

    只需将 替换为您要为其创建查询的文档的 ID。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-11-18
      • 1970-01-01
      • 1970-01-01
      • 2015-09-16
      • 2021-07-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多