- 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
推薦閱讀
- Word 2000、Excel 2000、PowerPoint 2000上機指導與練習
- Mastering Proxmox(Third Edition)
- ABB工業機器人編程全集
- Mastering Matplotlib 2.x
- 軟件架構設計
- Getting Started with MariaDB
- HBase Design Patterns
- CorelDRAW X4中文版平面設計50例
- Windows環境下32位匯編語言程序設計
- R Machine Learning Projects
- Ansible 2 Cloud Automation Cookbook
- Linux Shell Scripting Cookbook(Third Edition)
- 軟測之魂
- ROS Robotics By Example(Second Edition)
- 網絡規劃與設計