简体   繁体   English

搜索引擎使用php,InnoDB Engine Mysql

[英]Search Engine using php , InnoDB Engine Mysql

SELECT firstname, lastname,comments 
FROMusers 
WHERE MATCH(firstname,lastname,comments) 
AGAINST('$searchterm')

I tried the above one as query for search engine ,but mysql says FULL-TEXT INDEXING is supported only on MYISAM ,Engine i am using is innoDB,Please tell me the best way of coloumn INDEX searching ON InnoDB Engine. 我尝试了上述方法作为搜索引擎的查询,但是mysql表示仅MYISAM支持FULL-TEXT INDEXING,我正在使用的引擎是innoDB,请告诉我在InnoDB Engine上索引INDEX的最佳方法。

Based on my knowledge, MySQL FTS has been available for InnoDB since version 5.6 ( http://dev.mysql.com/tech-resources/articles/whats-new-in-mysql-5.6.html ) 据我了解,自5.6版开始,MySQL FTS就已经可用于InnoDB( http://dev.mysql.com/tech-resources/articles/whats-new-in-mysql-5.6.html

You should take a look at MySQL Fulltex search document here http://dev.mysql.com/doc/refman/5.5/en/fulltext-search.html 您应该在这里查看MySQL Fulltex搜索文档http://dev.mysql.com/doc/refman/5.5/en/fulltext-search.html

Basically, I think you should understand what is 'index' and how MySQL do indexing. 基本上,我认为您应该了解什么是“索引”以及MySQL如何进行索引。 This article is very useful for helping understand the mechanism behind MySQL fulltext search http://dev.mysql.com/doc/internals/en/full-text-search.html 本文对于帮助理解MySQL全文搜索背后的机制非常有用。http: //dev.mysql.com/doc/internals/en/full-text-search.html

There are several important concepts in full-text search: 全文搜索有几个重要概念:

  1. Boolean mode 布尔模式
  2. Natural language mode 自然语言模式
  3. I also recommend you read about stopwords list in MySQL FTS. 我还建议您阅读有关MySQL FTS中的停用词列表的信息
  4. System variable likes ft_min_word_len is also important. ft_min_word_len这样的系统变量也很重要。

After understanding these things, I think you will know how to apply MySQL fulltext search properly. 了解这些内容之后,我想您将知道如何正确应用MySQL全文搜索。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM