Search code examples
mysqltextsimilarity

Is there a Trigram functionality like pg_trgm (PostgreSQL) for MySQL?


I created a fuzzy search in C# for a PostgreSQL database using the similarity() function from the pg_trgm module. Now I want to port this search to a MySQL database, but MySQL has no similar trigram functionality.

Is there a way to import the pg-trgm module from PostgreSQL in MySQL or is there a similar implementation of Trigrams for MySQL?

Unfortunately I was not able to find any satisfying implementation yet.

I am reluctant to use a external search engine like Solr due to the effort of installation, maintenance and becoming acquainted with the syntax and configuration.


Solution

  • I know this question is old, but I got here Google searching for this and there is a bit of new information I also found.

    As of Mysql 5.7.6, there is built in support for using nGram in full text searches.

    Mysql team article regarding ngram searches