Note that there are some explanatory texts on larger screens.

plurals
  1. POFlex Matching Many Database Records (Quicksilver-like or Launchy-like matching)
    text
    copied!<p>Assume I have a database table with many names. I'd like to "flex match" against these names. I'm not sure if "flex match" is the proper term to use, but let's go with that for now. There have been <a href="https://stackoverflow.com/questions/369755/how-do-i-do-a-fuzzy-match-of-company-names-in-mysql-with-php-for-auto-complete">similar</a> <a href="https://stackoverflow.com/questions/309479/how-to-find-best-fuzzy-match-for-a-string-in-a-large-string-database">discussions</a> on "fuzzy matching," but I'm not really interested in phonetic matching. I'm interested in what I'd call ordered-subset-matching.</p> <p>I would like it to work akin to QuickSilver (OSX) or Launchy (Windows). Here are a few examples of matches for a given search string:</p> <p><em>mit</em> ⇒ <strong>M</strong>assachusetts <strong>I</strong>nstitute of <strong>T</strong>echnology<br> <em>ffox</em> ⇒ <strong>F</strong>ire<strong>fox</strong><br> <em>osx</em> ⇒ Mac <strong>OS X</strong><br> <em>ms</em> ⇒ <strong>M</strong>icro<strong>s</strong>oft Corporation</p> <p>My end goal is to have a web page with an auto-completing text field that's data driven from the server. </p> <p>I'm confident I'll get adequate results on the client side by combining features from <a href="http://ejohn.org/blog/jquery-livesearch/" rel="nofollow noreferrer">jQuery LiveUpdate</a> and/or <a href="http://github.com/dcparker/jquery_plugins/tree/master/quickselect" rel="nofollow noreferrer">jQuery QuickSelect</a>.</p> <p>Where I need help is in how to best handle the flex match on the server side against a large table. I have some ideas in how to build my own custom index using the Quicksilver <a href="http://code.google.com/p/blacktree-alchemy/source/browse/trunk/Crucible/Code/NSString_BLTRExtensions.m" rel="nofollow noreferrer">scoring</a> <a href="http://orderedlist.com/demos/quicksilverjs/javascripts/quicksilver.js" rel="nofollow noreferrer">algorithm</a> and maybe some permutation index logic, but I'd rather not re-invent the wheel if something else if readily available.</p> <p><strong>In summary:</strong> <em>What is the best way to gain a fast flex match against a database table with many rows?</em></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload