白话Elasticsearch61-进阶篇之基于Term Vectors深入探查数据的情况
文章目錄
- 概述
- 官網(wǎng)
- Term information
- Term statistics
- Field statistics
- Terms filtering
- Behaviour
- 示例
- 總結(jié)
概述
繼續(xù)跟中華石杉老師學習ES,第61篇
課程地址: https://www.roncoo.com/view/55
官網(wǎng)
Term Vectors: 戳這里
概括來說:Term Vectors就是 獲取document中的某個field內(nèi)的各個term的統(tǒng)計信息
Term information
主要包含以下幾個信息: term frequency in the field, term positions, start and end offsets, term payloads
Term statistics
設置term_statistics=true 后將返回:
- total term frequency, 一個term在所有document中出現(xiàn)的頻率;
- document frequency,有多少document包含這個term
Field statistics
- document count: 有多少document包含這個field;
- sum of document frequency:一個field中所有term的df之和;
- sum of total term frequency:一個field中的所有term的tf之和
Terms filtering
GET /my_index/my_type/_termvectors {"doc" : {"fullname" : "Leo Li","text" : "hello test test test"},"fields" : ["text"],"offsets" : true,"payloads" : true,"positions" : true,"term_statistics" : true,"field_statistics" : true,"filter" : {"max_num_terms" : 3,"min_term_freq" : 1,"min_doc_freq" : 1} }這個就是說,根據(jù)term統(tǒng)計信息,過濾出你想要看到的term vector統(tǒng)計結(jié)果
也挺有用的,比如你探查數(shù)據(jù)把,可以過濾掉一些出現(xiàn)頻率過低的term,就不考慮了 .
Behaviour
term statistics和field statistics并不精準,被刪除了的doc不會被考慮.
示例
總結(jié)
其實Term Vectors很少用,用的時候,一般來說,就是你需要對一些數(shù)據(jù)做探查的時候。比如說,你想要看到某個term,某個詞條比如“xxxx”,這個詞條,在多少個document中出現(xiàn)了。或者說某個field 比如 film_desc(電影的說明信息),有多少個doc包含了這個說明信息。
總結(jié)
以上是生活随笔為你收集整理的白话Elasticsearch61-进阶篇之基于Term Vectors深入探查数据的情况的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 白话Elasticsearch60-数据
- 下一篇: 白话Elasticsearch62-进阶