Jump to content

No results with fulltext search


mwouters

Recommended Posts

Hello,

I'm trying to create a search using fulltext search, but it does not return any values. I don't get an error when I execute following SQL, but nor a result:

[code]SELECT ID AS blogID, titel, tekst, MATCH (titel, tekst) AGAINST ('Belgacom') AS ranking FROM blog WHERE MATCH (titel, tekst) AGAINST ('Belgacom')[/code]

I did use a word with more than 5 letters as you can see, and the word does not return 100 times in the text (so it would be ignored).. so it should find a result..

I have MySQL 4.1.18 installed.

Can it have something to do with the charset?
If I do an export of my table structure I get this:


[code]CREATE TABLE `blog` (
  `ID` int(11) NOT NULL auto_increment,
  `datum` datetime NOT NULL default '0000-00-00 00:00:00',
  `titel` text collate latin1_general_ci NOT NULL,
  `auteur` int(11) NOT NULL default '0',
  `tekst` text collate latin1_general_ci NOT NULL,
  `foto1` text collate latin1_general_ci,
  `foto2` text collate latin1_general_ci,
  `foto3` text collate latin1_general_ci,
  UNIQUE KEY `ID` (`ID`),
  FULLTEXT KEY `titel` (`titel`,`tekst`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=5;[/code]

Thanks a lot for any help, I don't know what to do..

Mark.
Link to comment
https://forums.phpfreaks.com/topic/6573-no-results-with-fulltext-search/
Share on other sites

Have you tried using the die() function in PHP?

$sql = mysql_query("SELECT field1, field2 FROM table WHERE field1 = 'x' ORDER BY field1 ASC") or die(mysql_error());

Been using adodb for a while so my basic query may be off a bit - principle is still there = /

Archived

This topic is now archived and is closed to further replies.

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