- 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
推薦閱讀
- R Machine Learning By Example
- Windows程序設計與架構
- 精通特征工程
- Docker on Amazon Web Services
- Excel 2007常見技法與行業應用實例精講
- Mastering GitLab 12
- R Data Analysis Projects
- Cloud Security Automation
- 生物3D打印:從醫療輔具制造到細胞打印
- ZigBee無線通信技術應用開發
- Machine Learning with Spark(Second Edition)
- 漢字錄入技能訓練
- 算法設計與分析
- PowerPoint 2010幻燈片制作高手速成
- Machine Learning in Java