Jump to content

Fulltext Prepend Asterisk


asmith

Recommended Posts

Hello,

 

This is kinda driving me crazy. My search key words doesn't seem to return the result I want. I have this name that ends with a name like this:

something_mykeyword

 

So I use FULLTEXT for

MATCH(name_column) AGAINST ('mykeyword')

 

and it doesn't find the row. The manual says that * in boolean mode must just append. In this case I need it to be like this:

MATCH(name_column) AGAINST ('*mykeyword' in BOOLEAN MODE)

 

Let's say the record doesn't end and mykeyword is in the middle of a bigger word:

somebiggermykeywordlying around

 

How do you find it with FULLTEXT?

 

Thanks for your time

Mysql 5.5

Link to comment
Share on other sites

I see. I guess I could add 'OR name_column LIKE '%mykeyword%' add the end of the statement so that if fulltext failed, it searches with LIKE. But still this makes the query bit heavier and MySQL is not really good at searching large data. I have sphinx setup for another table though, ultimately I'll add this table too. :/

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.