• <i id='RvQhr'><tr id='RvQhr'><dt id='RvQhr'><q id='RvQhr'><span id='RvQhr'><b id='RvQhr'><form id='RvQhr'><ins id='RvQhr'></ins><ul id='RvQhr'></ul><sub id='RvQhr'></sub></form><legend id='RvQhr'></legend><bdo id='RvQhr'><pre id='RvQhr'><center id='RvQhr'></center></pre></bdo></b><th id='RvQhr'></th></span></q></dt></tr></i><div id='RvQhr'><tfoot id='RvQhr'></tfoot><dl id='RvQhr'><fieldset id='RvQhr'></fieldset></dl></div>
      <bdo id='RvQhr'></bdo><ul id='RvQhr'></ul>

    <small id='RvQhr'></small><noframes id='RvQhr'>

      <legend id='RvQhr'><style id='RvQhr'><dir id='RvQhr'><q id='RvQhr'></q></dir></style></legend>

        <tfoot id='RvQhr'></tfoot>
      1. 在 MySQL 全文搜索中处理拼写错误的最佳方法

        Best way to deal with misspellings in a MySQL fulltext search(在 MySQL 全文搜索中处理拼写错误的最佳方法)
                <tbody id='2L0Iz'></tbody>
              <tfoot id='2L0Iz'></tfoot>
            • <legend id='2L0Iz'><style id='2L0Iz'><dir id='2L0Iz'><q id='2L0Iz'></q></dir></style></legend>
                <bdo id='2L0Iz'></bdo><ul id='2L0Iz'></ul>

                1. <i id='2L0Iz'><tr id='2L0Iz'><dt id='2L0Iz'><q id='2L0Iz'><span id='2L0Iz'><b id='2L0Iz'><form id='2L0Iz'><ins id='2L0Iz'></ins><ul id='2L0Iz'></ul><sub id='2L0Iz'></sub></form><legend id='2L0Iz'></legend><bdo id='2L0Iz'><pre id='2L0Iz'><center id='2L0Iz'></center></pre></bdo></b><th id='2L0Iz'></th></span></q></dt></tr></i><div id='2L0Iz'><tfoot id='2L0Iz'></tfoot><dl id='2L0Iz'><fieldset id='2L0Iz'></fieldset></dl></div>

                  <small id='2L0Iz'></small><noframes id='2L0Iz'>

                  本文介绍了在 MySQL 全文搜索中处理拼写错误的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 mysql 数据库中有大约 2000 行.

                  I have about 2000 rows in a mysql database.

                  每行最多 300 个字符,包含一两个句子.

                  Each row is a max of 300 characters and contains a sentence or two.

                  我使用 mysql 内置的全文搜索来搜索这些行.

                  I use mysql's built in fulltext search to search these rows.

                  如果可能,我想添加一个功能,以便更正拼写错误和意外拼写错误.

                  I would like to add a feature so that typos and accidental mispellings are corrected, if possible.

                  例如,如果有人在搜索框中输入right shlder",则在执行搜索时,这将等同于右肩".

                  For example, if someone types "right shlder" into the searchbox, this would equate to "right shoulder" when performing the search.

                  您对添加此类功能的最简单方法有何建议?是否值得添加某种外部搜索引擎,例如 lucene?(对于这么小的数据集,这似乎有点过头了.)或者有没有更简单的方法?

                  What are your suggestions on the simplest way to add this kind of functionality? Is it worth adding an external search engine of some kind, like lucene? (It seems like for such a small dataset, this is overkill.) Or is there a simpler way?

                  推荐答案

                  我认为你应该使用 SOUNDS LIKESOUNDEX()

                  I think you should use SOUNDS LIKE or SOUNDEX()

                  由于您的数据集非常小,一种解决方案可能是创建一个新表来存储每个文本字段中包含的单个单词或 soundex 值,并在该表上使用 SOUNDS LIKE.

                  As your data set is so small, one solution may be to create a new table to store the individual words or soundex values contained in each text field and use SOUNDS LIKE on that table.

                  例如:

                  SELECT * FROM table where id IN 
                  (
                      SELECT refid FROM tableofwords 
                      WHERE column SOUNDS LIKE 'right' OR column SOUNDS LIKE 'shlder'
                  )
                  

                  参见:http://dev.mysql.com/doc/refman/5.0/zh/string-functions.html

                  我相信用通配符搜索字符串是不可能的:(

                  I belive it is not possible to wild card seach the string :(

                  这篇关于在 MySQL 全文搜索中处理拼写错误的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                      • <legend id='sriS8'><style id='sriS8'><dir id='sriS8'><q id='sriS8'></q></dir></style></legend>
                      • <tfoot id='sriS8'></tfoot>
                          <tbody id='sriS8'></tbody>
                      • <i id='sriS8'><tr id='sriS8'><dt id='sriS8'><q id='sriS8'><span id='sriS8'><b id='sriS8'><form id='sriS8'><ins id='sriS8'></ins><ul id='sriS8'></ul><sub id='sriS8'></sub></form><legend id='sriS8'></legend><bdo id='sriS8'><pre id='sriS8'><center id='sriS8'></center></pre></bdo></b><th id='sriS8'></th></span></q></dt></tr></i><div id='sriS8'><tfoot id='sriS8'></tfoot><dl id='sriS8'><fieldset id='sriS8'></fieldset></dl></div>

                          • <bdo id='sriS8'></bdo><ul id='sriS8'></ul>

                            <small id='sriS8'></small><noframes id='sriS8'>