In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how Ubuntu mysql uses SphinxSE to call Sphinx and the application of Chinese word segmentation. I hope you will get something after reading this article. Let's discuss it together.
1. Using SphinxSE to call Sphinx in Ubuntu mysql
First, create an index special table:
CREATETABLE`sphinx` (`id`int (11) NOTNULL, `weight`int (11) NOTNULL, `query`varchar (255) NOTNULL, `CATALOGID`INTNOTNULL, `EDITUSERID`INTNOTNULL, `HITS`INTNULL, `ADDTIME`INTNOTnull, KEY `Query` (`Query`)) ENGINE=SPHINXDEFAULTCHARSET=utf8CONNECTION='sphinx://localhost:3312/test1'
Test1: the name of the index. After you can find the special indexing table in sphinx.conf, we can use it in Ubuntu mysql, for example, enter it in Ubuntu mysql
SELECTdoc.*FROMdocumentsdocJOINsphinxON (doc.id=sphinx.id) WHEREquery='doc;mode=any'
After running, the result record will show the syntax of the record lines used including the doc string about query, as well as the configuration of sphinx. You can refer to: http://www.sphinxsearch.com/doc.html here is a very detailed introduction, here we only do a brief introduction, hope to play a valuable effect.
2. The application of Ubuntu mysql Chinese word segmentation.
Before applying, let's install apache2 and phpmyadmin so that we can input Chinese for testing.
Apt-getinstallapache2 apt-getinstallphpmyadmin
Visit: http://192.168.2.249/phpmyadmin/ has a familiar interface, ok, installed successfully.
Then we need to change the mysql.default_ tmp/mysql.sock value in / etc/php5/apache2/php.ini to / tmp/mysql.sock so that we can access Ubuntu mysql through the root user (password empty) on http://192.168.2.249/phpmyadmin/.
Generate and use the participle dictionary mmseg-u/root/mmseg-0.7.3/data/unigram.txt will generate the unigram.txt.lib file to copy the file under / usr/local/sphinx/, name it uni.libcpunigram.txt.lib/usr/local/sphinx/uni.lib, modify the sphinx.conf (/ usr/local/sphinx/etc/sphinx.conf) configuration file and add it to the index.
Charset_type=zh_cn.utf-8 charset_dictpath=/usr/local/sphinx/
The configuration then rebuilds the index through / usr/local/sphinx/bin/indexer--config/usr/local/sphinx/etc/sphinx.conf-all (if searchd has been run again, kill it before running. In the next section, we will describe how to load the index while searchd is running). After success, enable index snooping / usr/local/sphinx/bin/searchd--config/usr/local/sphinx/etc/sphinx.conf so that you can test it in phpmyadmin.
SELECTdoc.*FROMdocumentsdocJOINsphinxON (doc.id=sphinx.id) WHEREquery=' Jacky Cheung; after reading this article, I believe you have a certain understanding of "how Ubuntu mysql uses SphinxSE to call Sphinx and the application of Chinese word segmentation". If you want to know more about it, welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.