MySQL Forums
Forum List  »  Full-Text Search

Problem with words contains '-' character
Posted by: Sajo Sajo
Date: March 12, 2008 04:36PM

Hi,

I have problem with full text search with words that contains '-' character like 'LD-3W' or 'HL-42N' etc.

I have these 4 rows:
Name
-----------
LD-3W
LD-3WW
LLD-3W
LLD-3WW

select * from table where match (Name) against ('LD-3W');
return 0 rows

select * from table where match (Name) against ('"LD-3W"');
return 0 rows

select * from table where match (Name) against ('"LD-3W"' IN BOOLEAN MODE);
return 0 rows

select * from table where match (Name) against ('+"LD-3W"' IN BOOLEAN MODE);
return 0 rows

select * from table where match (Name) against ('+"LD-3W"*' IN BOOLEAN MODE);
return 0 rows

select * from table where match (Name) against ('"LD-3W"*' IN BOOLEAN MODE);
return 0 rows

I need to return all rows where is LD-3W enywhere in the Name column. So for this example they are all 4 rows. Of course I can use Name like "%LD-3W%" in query but this is about thousand times slower. Doesn't matter in table with few rows but I have table with 2 milions rows and this search ends in 10-15 seconds depends on server load.

Some ideas how to solve this?



Edited 1 time(s). Last edit at 03/12/2008 04:38PM by Sajo Sajo.

Options: ReplyQuote


Subject
Views
Written By
Posted
Problem with words contains '-' character
7360
March 12, 2008 04:36PM


Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.