列出由Innodb全文索引的单词 [英] List words indexed by Innodb fulltext

查看:137
本文介绍了列出由Innodb全文索引的单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Mysql(Innodb)中,我创建了一个FULL-TEXT索引。



是否有一个查询可用于检索包含在完整文本中的所有单词列表-text index?



我的想法是使用一个文本字段来保存标记列表的json转储。



比我可以使用全文查询来检索匹配标签的行(它有效)。



剩下的问题是检索索引标签列表来实现建议和自动完成标记输入字段。

解决方案

设置 innodb_ft_aux_table mysql服务器变量在运行时到包含全文索引的innodb表。这会导致 INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE 被填充。此表包含一个列,其中包含从列的文本中提取的


这是FULLTEXT的一部分


您可以使用select查询来创建此表中的单词列表。但是,这个设置只是为了测试/调试的目的而推荐的,所以我不会真正在实际的环境中使用它。



这种方法的另一个问题是单词被索引和停用词列表。如果标签短于最小字长,则不会被编入索引。如果标签名称在停用词列表中,它将不会被编入索引。



老实说,我宁愿创建一个单独的表格,在其中维护标签列表和将使用它作为自动完成的源。


In Mysql (Innodb) I have created a FULL-TEXT index.

Is there a query I can use to retrieve a list of all words contained in the full-text index?

My idea is to use a text field that hold a json dump of a list of TAGS.

Than I can use full-text query to retrieve rows matching tags (it works).

The problem left is to retrieve a list of indexed tags to implement a suggestion and auto completion tag input field.

解决方案

Set innodb_ft_aux_table mysql server variable at runtime to your innodb table containing the fulltext index. This will cause the INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE to be populated. This table contains a word column containing

word extracted from the text of the columns that are part of a FULLTEXT

You can use select query to ge the list of words from this table. However, this setting is recommended for testing / debugging purposes only, so I would not really use it in a live environmnet.

Another catch with this approach is the minimum length of words being indexed and the stopword list. If a tag is shorter than the minimum word length, it is not going to be indexed. If the tag name is on the stopword list, it will not be indexed.

To be honest, I would rather create a separate table where you maintain the list of tags and would use that as a source for the auto complete.

这篇关于列出由Innodb全文索引的单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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