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

  • Mastering PostgreSQL 9.6
  • Hans Jurgen Schonig
  • 98字
  • 2021-07-09 19:57:23

Gathering word statistics

Full-text search can handle a lot of data. To give end users more insights 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 word, ndoc tells us about the number of documents a certain word occurs. nentry indicates how often a word was found all together

主站蜘蛛池模板: 琼中| 永安市| 轮台县| 鄄城县| 嘉禾县| 白城市| 台南市| 安达市| 鱼台县| 布尔津县| 淄博市| 广宁县| 亚东县| 游戏| 庄河市| 枣阳市| 茶陵县| 宁强县| 新津县| 兴海县| 华池县| 东乡族自治县| 同江市| 徐州市| 达拉特旗| 梨树县| 福州市| 崇礼县| 睢宁县| 铁岭县| 渑池县| 东山县| 鄄城县| 鱼台县| 昌江| 竹山县| 伊春市| 平武县| 孟州市| 珲春市| 镇巴县|