I have recently made a full-text search function. I don't know how this idea and technology work?

Source: Internet
Author: User
Tags solr
You have recently completed the full-text search function. You can enter a keyword in the user input box to search for articles matching the keyword. Supports matching the content of an article and the title of an article. Is the implementation complicated? What are the better solutions? The development language is php, And the mysql database is recently used for full-text search. You can enter a keyword in the input box to search for articles matching the keyword.
Supports matching the content of an article and the title of an article. Is the implementation complicated?
What are the better solutions?

Development language php, database mysql

Reply content:

You have recently completed the full-text search function. You can enter a keyword in the user input box to search for articles matching the keyword.
Supports matching the content of an article and the title of an article. Is the implementation complicated?
What are the better solutions?

Development language php, database mysql

Give the landlord a choice of solutions: http://www.xunsearch.com/site/usercase
It is also open-source and provides commercial services. If you have plenty of time, you can consider independent development. Otherwise, you can choose an open-source solution that is active in the community.

Coreseek, a Chinese Word Segmentation version of sphsf.
Http://www.coreseek.cn/

I think elasticsearch is still good. java writes a search engine and is distributed. It can also be used for log search.

  1. Database implementation is not highly scalable. As the data volume increases, the performance will decrease.

  2. There are many open-source solutions, such as lucene, which can be easily written in simple words. You can also use lucene-based solr (http://lucene.apache.org/solr)

It is the most convenient and scalable. We recommend that you use Alibaba Cloud opensearch, which is too simple and convenient.

Open source Chinese search engine XunSearch:
Http://www.cloud-sun.com/view/product
Http://www.xunsearch.com/doc/php/guide/start.installation
1. Explosive Performance: XunSearch supports a maximum of 4 billion data records in a single database. The Retrieval time of approximately 0.5 billion TB of data on Web pages cannot exceed 1 second (non-Cache ).
2. ease of use: the front-end is a development toolkit written in the scripting language PHP. The API is simple and clear, and the development is extremely difficult. It provides sample code, documents, and auxiliary script tools in Chinese.
3. Rich functions: in addition to basic custom word segmentation, field search, and Boolean search, you can also directly support related search, pinyin search, and search recommendations that you need.
The author of XunSearch is also the Chinese word segmentation SCWS (which provides the PECL extension, pure PHP implementation, and a complete Chinese Dictionary.
Http://www.xunsearch.com/scws/index.php
XunSearch is used for intra-site search of PHP-driven segmentfault.com.

Suggestions and Error Correction for XunSearch (for example, pinyin search ):
Http://www.xunsearch.com/doc/php/guide/search.fix

Alternatively, you can use the FullText full-text index field type built in MySQL InnoDB/MyISAM to use pecl scws to split the file content and header fields and store a FullText word segmentation field, for examplearticle_fc text,FULLTEXT (article_fc)And then use the match against statement to perform full-text search after pecl scws is used for word splitting:

SELECT * FROM articles WHERE MATCH(article_fc) AGAINST('word1 word2');

The table in which the article_fc field is located can also be separated from the article table in which the title body is located. Connect to the article table to read the title body. you can even use SQLite to create a word segmentation table and store all the word segmentation content in SQLite to relieve MySQL pressure. because SQLite also supports full-text retrieval, and full-text retrieval is a read operation, SQLite's read performance is very good.

More simply and rudely, it does not rely on php scws word segmentation or MySQL (InnoDB/MyISAM)/SQLite/XunSearch full-text search, directly prompting users to separate keyword input, then use SQL LIKE for fuzzy query. If the data volume is small, it is a feasible and simple solution:

SELECT * FROM articles WHERE content LIKE '%word1%' OR content LIKE '%word2%';SELECT * FROM articles WHERE content REGEXP 'word1|word2';

Solr, a project of apache

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.