【问题标题】:How to get the word frequency of full-text search in elasticsearchelasticsearch中如何获取全文搜索的词频
【发布时间】:2022-01-24 06:20:36
【问题描述】:

我有几个这样的文件:

    text: "hello, I am your friend"
    text: "hello, hello"
    text: "everybody said: hello hello"

在全文搜索中,我想统计搜索词出现的次数, 例如,搜索“hello”将返回 5 个结果。 我尝试使用聚合搜索,返回的结果是文档数。

如何构造这样的查询? 谢谢。

【问题讨论】:

    标签: elasticsearch full-text-search


    【解决方案1】:

    您可以使用explain API,但您必须一一提供匹配的文档。查找带有"description":"freq, occurrences of term within document"的字段

    【讨论】:

    • 谢谢你的回复,我试试看:)
    猜你喜欢
    • 1970-01-01
    • 2016-03-19
    • 2016-08-11
    • 2017-06-02
    • 1970-01-01
    • 2014-11-04
    • 2020-03-10
    • 2012-02-10
    • 2017-03-16
    相关资源
    最近更新 更多