This is a discussion on how to match any character or part of a word in a fulltext search within the MySQL forums, part of the Database Server Software category; --> hello, i'm experimenting with fulltext searches and came across a problem. my table is in unicode and includes names ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| hello, i'm experimenting with fulltext searches and came across a problem. my table is in unicode and includes names from different languages. is it possible to to implement a fulltext search that would allow me to find rows with an entry including characters i may not know or at least may not know how to type? what i have in mind is something similar to "... where name like 'honor_'", or parts of words (to include different cases), like 'kritik%', that matches 'kritika', 'kritike', 'kritiki' and so on. because of this i am seriously considering using a search technique without the fulltext index. thanks. |
| |||
| Try using the BOOLEAN MODE. http://dev.mysql.com/doc/refman/5.0/...t-boolean.html This has the ability to do partial words by ending the word with a star (*) e.g. 'honor*' you can't do wild character matches though, and its not keen on special characters. I got round this by having a search field with all the words processed by stripping out all characters it doesn't like. I then search against that field with search words processed in the same way. Tigger omeldoid@gmail.com wrote: > hello, > > i'm experimenting with fulltext searches and came across a problem. > > my table is in unicode and includes names from different languages. is > it possible to to implement a fulltext search that would allow me to > find rows with an entry including characters i may not know or at least > may not know how to type? what i have in mind is something similar to > "... where name like 'honor_'", or parts of words (to include different > cases), like 'kritik%', that matches 'kritika', 'kritike', 'kritiki' > and so on. > > because of this i am seriously considering using a search technique > without the fulltext index. > > thanks. |
| ||||
| Tigger wrote: > Try using the BOOLEAN MODE. > http://dev.mysql.com/doc/refman/5.0/...t-boolean.html > This has the ability to do partial words by ending the word with a star thanks for this, i must have missed it. > you can't do wild character matches though, and its not keen on special > characters. that's a pitty. but special characters aren't ignored (at least not in my version). this makes it impossible to find words that have any such character anywhere but at the very end. another solution i've come across was to put the most important of those characters onto a web page right next to the search form. i found it useful but you cannot have the entire unicode set pasted there ... i reverted to `where ... like ... ' as my tables will never grow to millions of rows. still, i didn't want to use poor code. andrej |