Recently to do a full-text search function, do not know this piece of thinking and technology how this piece?

Source: Internet
Author: User
Tags solr
Recently to do full-text search function, the user input box input keywords, you can search for the article matching the keyword.
Support for article content matching and article title matching. Do you want to ask if the implementation is complicated?
What are the better solutions?

Development language PHP, database MySQL

Reply content:

Recently to do full-text search function, the user input box input keywords, you can search for the article matching the keyword.
Support for article content matching and article title matching. Do you want to ask if the implementation is complicated?
What are the better solutions?

Development language PHP, database MySQL

To the Landlord a choice scheme: http://www.xunsearch.com/site/usercase
Also open source, but also provide business services, if time is ample, you can consider self-development, otherwise choose Open Source solution, and the community more active

Sphinx's Chinese word edition Coreseek.
http://www.coreseek.cn/

I think Elasticsearch is still good, Java is written is a search engine and is distributed can also do log search

    1. The database implementation is not scalable to a high level of scalability. The amount of data is large and performance degrades.

    2. There are many open source solutions, such as Lucene, and the need for simple writing comes quickly. You can also use Lucene-based SOLR (http://lucene.apache.org/solr/)

The most convenient, the extension of strong, the proposed use of Ali with the OpenSearch, simply 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. Performance of the best: Xunsearch Single Library supports up to 4 billion data, the retrieval time in 500 million web pages of approximately 1.5TB is not more than 1 seconds (non-cache).
2. Easy to use: The front end is a development kit written in the scripting language PHP. The API is simple and clear, the development is very difficult, provide all the Chinese sample code, documentation, auxiliary scripting tools and so on.
3. Rich features: In addition to supporting the basis of custom word segmentation, field retrieval, Boolean search, but also directly support the user urgently needed related search, pinyin search, search suggestions and other professional functions.
Xunsearch author is also a Chinese word scws (with pecl extension and pure PHP implementation as well as a complete Chinese dictionary) Mindy Practice Hightman.
http://www.xunsearch.com/scws/index.php
PHP-driven segmentfault.com in-site search is xunsearch.

Xunsearch Search suggestions and corrections (such as Pinyin search):
Http://www.xunsearch.com/doc/php/guide/search.fix

Or you can take advantage of MySQL Innodb/myisam built-in fulltext full-text indexed field type, with pecl Scws to file content and Title fields after word-breaking into a fulltext word-breaker field for example article_fc text,FULLTEXT (article_fc) , then user input with Pecl After SCWS participle, use the match against statement for full-text search:

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

The table that contains the Article_fc field can be separated from the article table in which the title body is located, and then the connected Article table is read out in the title text. You can even use SQLite to build a word-breaker table, the word-breaker contents are stored in SQLite, Reduce MySQL stress. Because SQLite also supports full-text indexing, and full-text indexing is a read operation, SQLite's reading performance is very good.

More simple and brutal is, neither rely on PHP scws participle, nor rely on MySQL (innodb/myisam)/sqlite/xunsearch full-text retrieval, directly prompts the user to separate keyword input, and then use SQL like for fuzzy query, A feasible and simple scenario with little data volume:

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

A project in Solr,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.