php - 搜索记录的最佳搜索技术是什么

标签 php mysql text full-text-search

<分区>

我有10,000,000条记录,这将是搜索记录的最佳技术,目前我正在使用全文搜索但速度很慢,请建议。

最佳答案

没有万能的解决方案,但您可以尝试:

狮身人面像

How do you implement full-text search for that 10+ million row table, keep up with the load, and stay relevant? Sphinx is good at those kinds of riddles.

Sphinx is a full-text search engine, distributed under GPL version 2. Commercial license is also available for embedded use.

Generally, it's a standalone search engine, meant to provide fast, size-efficient and relevant fulltext search functions to other applications. Sphinx was specially designed to integrate well with SQL databases and scripting languages. Currently built-in data sources support fetching data either via direct connection to MySQL or PostgreSQL, or using XML pipe mechanism (a pipe to indexer in special XML-based format which Sphinx recognizes).

As for the name, Sphinx is an acronym which is officially decoded as SQL Phrase Index. Yes, I know about CMU's Sphinx project.

http://www.sphinxsearch.com/

Lucene PHP (Part of Zend Framework):

Zend_Search_Lucene is a general purpose text search engine written entirely in PHP 5. Since it stores its index on the filesystem and does not require a database server, it can add search capabilities to almost any PHP-driven website. Zend_Search_Lucene supports the following features:

  • Ranked searching - best results returned first
  • Many powerful query types: phrase queries, boolean queries, wildcard
    queries, proximity queries, range
    queries and many others.
  • Search by specific field (e.g., title, author, contents)

http://framework.zend.com/ http://framework.zend.com/manual/en/zend.search.lucene.overview.html

关于php - 搜索记录的最佳搜索技术是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3147266/

相关文章:

java - LEFT JOIN hql 中的子选择

php - 如何在 php 中动态组合图像和文本

php - 在 Laravel 5 单元测试中找不到特征

php - 谷歌云空间/图像部署错误,构建未完成

mysql - CakePHP 2.x 字段为空或 null

MySQL 相关子查询 : Subquery cant find table from outer query?

php - 点击时获取输入框名称

php - 带有 ssl 证书和密码的 Soap 服务 (PHP)

vba - 使用基于幻灯片标题的 bool 值从多个 powerpoint 文件中提取文本

regex - Notepad++:将多个换行符减少为单个