Jump to content

Interesting examples of FULLTEXT searching from MySQL


j.smith1981

Recommended Posts

I am interested in making a really good FULLTEXT searching capability within a system I am trying to develop for work.

 

I have a list of products I think from memory around 2,300 approx products on our ecommerce.

 

The problem is, it only matches on certain fields but I have seen a few examples (I think even Google do this) where they highlight what has actually been matched to make it easier to comprehend what's actually been matched against what the user has inputted or queried on rather.

 

Is there any good tutorials on how to do this even adding in did you mean examples?

 

Just thought I would go out and ask rather than going around on the web, I mean I just can't for the life of me find any real tutorials on this subject, just guides on FULLTEXT searching but not about query match showing etc.

 

Any help is not massively more hugely appreciated!

 

I look forward to any replies,

Jeremy.

Link to comment
Share on other sites

Fuzzy searching is a bit tricky.  You're pretty much left comparing the query input against your index based on whatever you favorite algorithm may be (such as Levenshtein Distance).  OR you can attempt to spellcheck the input before searching.

SOUNDEX()

Levenshtein distance

 

As for highlight matching, you're going to have to grab the segment of text with the query text from the database, then regex in some presentation highlighting for the user.

 

A nice summary of how google's did you mean algorithm works

 

Another approach would be to setup your own index and search server.  Lucene provides highlighting, fuzzy searching and lots of other goodies.

Lucene and Solr

Sphinx

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.