Unix Technical Forum

how to match any character or part of a word in a fulltext search

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 ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 09:17 AM
omeldoid@gmail.com
 
Posts: n/a
Default how to match any character or part of a word in a fulltext search

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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 09:17 AM
Tigger
 
Posts: n/a
Default Re: how to match any character or part of a word in a fulltext search

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.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 09:17 AM
omeldoid@gmail.com
 
Posts: n/a
Default Re: how to match any character or part of a word in a fulltext search

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:47 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com