Sphinx Search / MySQL find most common words

三世轮回 提交于 2019-12-06 10:21:52

问题


I have a sphinx search index and would like to find what are the most common words in my index. Ideally have a list of words ordered by frequency.

If it is not possible to do it using Sphinx, is there a way to query a mysql table's text fields to get the same stat?


回答1:


Yes. This is quite simple. Build them with indexer using the --buildstops and --buildfreqs flags.

indexer --config /path/to/sphinx.conf  indexName --buildfreqs --buildstops freq_wordlist.txt 100000

This example gives you the first 100000 word in your sphinx index ordered by its frequency




回答2:


Build them with indexer using the --buildstops and --buildfreqs flags.

Just be aware this does not build from the existing index, but runs against the data source as if indexing, and builds the word frequencies. It does not affect the index itself.

If you use delta indexes where you save the id of the last indexed document, this will read the last saved id and work from there.



来源:https://stackoverflow.com/questions/9226603/sphinx-search-mysql-find-most-common-words

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!