Count occurrences of a word in a row in MySQL

后端 未结 9 980
野趣味
野趣味 2020-12-19 08:41

I\'m making a search function for my website, which finds relevant results from a database. I\'m looking for a way to count occurrences of a word, but I need to ensure that

相关标签:
9条回答
  • 2020-12-19 09:35

    I have used the technique as described in the link below. The method uses length and replace functions of MySQL.

    Keyword Relevance

    0 讨论(0)
  • 2020-12-19 09:37

    If you want a search I would advise something like Sphinx or Lucene, I find Sphinx (as an independent full text indexer) to be a lot easier to set up and run. It runs fast, and generates the indexes very fast. Even if you were using MyISAM I would suggest using it, it has a lot more power than a full text index from MyISAM.

    It can also integrate (somewhat) with MySQL.

    0 讨论(0)
  • 2020-12-19 09:40

    It depends on what DBMS you are using, some allow writing UDFs that could do this.

    0 讨论(0)
提交回复
热议问题