j.smith1981 Posted September 7, 2011 Share Posted September 7, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/246616-interesting-examples-of-fulltext-searching-from-mysql/ Share on other sites More sharing options...
thehippy Posted September 7, 2011 Share Posted September 7, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/246616-interesting-examples-of-fulltext-searching-from-mysql/#findComment-1266554 Share on other sites More sharing options...
j.smith1981 Posted September 9, 2011 Author Share Posted September 9, 2011 Oh nice one will definately give those a look! Thank you so much, Jeremy. Quote Link to comment https://forums.phpfreaks.com/topic/246616-interesting-examples-of-fulltext-searching-from-mysql/#findComment-1267376 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.