- Mastering PostgreSQL 12
- Hans Jürgen Sch?nig
- 107字
- 2021-08-20 10:00:33
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.
推薦閱讀
- Unreal Engine:Game Development from A to Z
- 網(wǎng)上沖浪
- 工業(yè)機器人技術(shù)及應(yīng)用
- Hadoop 2.x Administration Cookbook
- 蕩胸生層云:C語言開發(fā)修行實錄
- 程序設(shè)計語言與編譯
- 精通Excel VBA
- JavaScript典型應(yīng)用與最佳實踐
- PVCBOT機器人控制技術(shù)入門
- 激光選區(qū)熔化3D打印技術(shù)
- 在實戰(zhàn)中成長:C++開發(fā)之路
- 網(wǎng)絡(luò)脆弱性掃描產(chǎn)品原理及應(yīng)用
- 基于ARM9的小型機器人制作
- Mastering Ceph
- 會聲會影X4中文版從入門到精通