官术网_书友最值得收藏!

Gathering word statistics

A full-text search can handle a lot of data. To give end users more insight into their texts, PostgreSQL offers the pg_stat function, which returns a list of words:

SELECT * FROM  ts_stat('SELECT to_tsvector(''english'', comment) 
FROM pg_available_extensions')
ORDER BY 2 DESC
LIMIT 3;
word | ndoc | nentry
----------+------+--------
function | 10 | 10
data | 10 | 10
type | 7 | 7
(3 rows)

The word column contains the stemmed words; ndoc tells us about the number of documents a certain word occurs in. nentry indicates how often a word was found altogether.

主站蜘蛛池模板: 会理县| 新河县| 南和县| 贵定县| 墨竹工卡县| 黄梅县| 武夷山市| 东海县| 迁安市| 虞城县| 明水县| 佛山市| 越西县| 北川| 郑州市| 称多县| 鸡东县| 双流县| 泰宁县| 剑阁县| 星座| 福鼎市| 沙洋县| 洪雅县| 甘泉县| 托克托县| 霞浦县| 赤壁市| 宁南县| 石渠县| 大兴区| 镶黄旗| 永吉县| 万盛区| 浠水县| 厦门市| 三穗县| 顺平县| 松桃| 万山特区| 耒阳市|