Jump to content

FULLTEXT search boolean mode? options


asmith

Recommended Posts

Hi

 

A query such this :

SELECT * FROM table WHERE MATCH(title,description) AGAINST('$_POST[key]')

 

Almost finds everything.

I have some telephone number recorded on the site. like  032344546.  If i search for 32344546 (without 0 ), search finds nothing.

 

If I use boolean mode,  and search for  03234*  it finds the number.  But how can i tell it to find words that ends with the keyword ?

 

How can I search for 23445  (in the middle) and find 032344546 with fulltext method?? (and so the same thing with words)

Link to comment
Share on other sites

Anyone help?  The search in normal mode is not finding anything when they keywords is some characters in the middle of the word.

 

Why it can't find it?

 

I'm using this table structure :

 

CREATE TABLE `table_name` (
  `id` int( NOT NULL auto_increment,
  `title` varchar(200) default NULL,
  `description` text,
  `owner` varchar(50) default NULL,
  PRIMARY KEY  (`id`),
  FULLTEXT KEY `title` (`title`),
  FULLTEXT KEY `description` (`description`),
  FULLTEXT KEY `owner` (`owner`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=25259 ;

 

 

and this query :

SELECT * FROM table WHERE MATCH(description) AGAINST('$_POST[key]')

 

MySQL 5.0

 

 

 

Link to comment
Share on other sites

I don't want to use LIKE command as it won't show me my desired results.for several reasons, writing too much code...if i use a lot of words for the keywords it won't find anyting ... FULLTEXT search seems  perfect for the result i want.

 

I tried to use % in fulltext search, but that's not working too.

 

I search for "comp" , it finds nothing.  Which I want it to find computer.  but the search for computer finds lots of results.

I really want to use FULLTEXT search in normal mode, it seems it gives me the best results, but don't know how to solve such problem, been 2 days now, getting on my nerves :/

 

ATM this query is stlil giving the best results, including the problem i have with it :

 

SELECT * FROM table WHERE MATCH(description) AGAINST('$_POST[key]')

 

I want to find computer for the keywords like  "omputer" . but won't find anything :/

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.