1、term vector介绍
获取document中的某个field内的各个term的统计信息
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中出现的频率; 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之和
GET /twitter/tweet/1/_termvectors
GET /twitter/tweet/1/_termvectors?fields=text
term statistics和field statistics并不精准,不会被考虑有的doc可能被删除了
其实很少用,用的时候,一般来说,就是你需要对一些数据做探查的时候。比如说,你想要看到某个term,某个词条,大话西游,这个词条,在多少个document中出现了。或者说某个field,film_desc,电影的说明信息,有多少个doc包含了这个说明信息。
2、index-time term vector实验
掌握,如何采集term vector信息,然后如何看懂term vector信息,你能掌握利用term vector进行数据探查
term vector,涉及了很多的term和field相关的统计信息,有两种方式可以采集到这个统计信息
(1)index-time,你在mapping里配置一下,然后建立索引的时候,就直接给你生成这些term和field的统计信息了