ruby - Does MySQL have a text search that seems to work like Google's? -
i'm making website backend uses mysql , ruby gem sinatra.
my mysql table has longtext column fulltext index.
i've written mysql query that's this:
select plot mytable match(plot) against('time travel robot') the first result:
man on moon biographical movie on late comedian andy kaufman. kaufman, along role on taxi (1978), famous being self-declared intergender wrestling champion of world. after beating women time , time again, jerry lawler (who plays himself in movie), professional wrestler, got tired of seeing of , decided challenge kaufman match. in of matches 2 had, lawler prevailed piledriver, move spiking opponent head-first mat. 1 of famous moments in feud in 80s when kaufman threw coffee on lawler on late night david letterman (1982), got fisticuffs lawler, , proceeded sue nbc.
even though movie, has nothing time traveling or robots.
i don't know google's search algorithm, know if mysql has search function ranks results based on how close inputted words are.
in case, i'd relevant results have words "time," "travel" , "robot" close possible.
and nice if dream function variations on words, "travelling" or "robots."
how of possible mysql? or ruby?
or should go different?
google searching performing indexing on large n-gram data using solr(lucene). see
using mysql ruby can surely on large data not fast , effective. small data, happy see result.
a database index data structure improves speed of data retrieval operations on database table @ cost of additional writes , storage space maintain index data structure. see indexing
there various data structure techniques used indexing purpose. can apply on mysql ruby. basic idea check tutorial
so if have large data set, thta performing indexing technique on data, when search on indexed data query time travel robot automatically show related result.
Comments
Post a Comment