使用innoDb实现搜索功能的最佳方法 [英] Best way to implement search functionality using innoDb

查看:107
本文介绍了使用innoDb实现搜索功能的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果索引在大型产品表中使用innodb,我需要实现类似全文搜索的功能,MyISAM由于缺少事务和关系支持而不是选项。



我可以通过几种方法来实现这一点,插件,存储过程,带键的搜索表以及以MyIsam格式复制的索引。



过去你是如何实现这一点的,这是最好的方式(包括我没有提到过的),为什么?

这个插件听起来很贵,存储过程听起来很慢,而搜索表听起来像是和管理员的噩梦。



喜欢听你的意见。

解决方案

一种可能性可能是使用外部的(独立于数据库)全文引擎,例如 Lucene (如果您使用PHP,您可能还想看看 Zend_Search_Lucene



使用此类引擎的优势在于全文搜索真是他们的工作;他们应该做得很好(并且对于用户倾向于输入的内容是聪明的)。

缺点是你必须有另一个引擎;这意味着更多的工作,更多的配置和更多的开发,因为你不能让他们插入你的数据库。


I need to implement something like a full text search on a couple if index's in a large products table, using innodb, MyISAM is not an option due to its lack of transactions and relationship support.

I can think of a couple of ways of doing this, plugin, stored procedure, search table with keys and copied index's in MyIsam format.

How have you acheived this in the past, which is the best way (including any I have not mentioned) and why?

The plugin sounds expensive, the stored procedure sounds slow, and the search table sounds like and admin nightmare.

Love to hear your views.

解决方案

A possibility might be to use an external (independant of the Database) full-text engine, like, for instance, Lucene (if you are using PHP, you might also want to take a look at Zend_Search_Lucene)

There are plenty of those (some free, some costly, some open source, and some proprietary) ; but they'll generally allow you to go farther than what MySQL full-text allows -- and it won't be integrated inside the database (which might be good : you can index documents, for instance -- or bad : you can't join those results with one of your SQL query results that easily)

The advantage of using such an engine is that full-text search is really their job ; and they're supposed to do it well (and be "intelligent" about what users tend to input).

Drawback is you must have another engine ; which means more work, more configuration, and more development, as you can't just have them "plugged-in" in you DB.

这篇关于使用innoDb实现搜索功能的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆