Is there an easy way to alter the searching to search ONLY for keywords? it appears as though now it searches through the content and titles as well.
Perhaps just altering the index?
Bill
Another search question
Moderator: Thorsten
Hi Bill,
you have to change the table structure and the function of the search engine. Do you use phpMyAdmin, then this is very easy to realize.
bye
Thorsten
you have to change the table structure and the function of the search engine. Do you use phpMyAdmin, then this is very easy to realize.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Hi Bill,
just execute these queries:
Then edit the function searchEngine() in the file functions.php. Change this part:
to this:
I have not tested it! But it should work...
bye
Thorsten
just execute these queries:
Code: Select all
ALTER TABLE <prefix>faqdata DROP INDEX keywords
Code: Select all
ALTER TABLE <prefix>faqdata ADD INDEX keywords ('keywords'(1))
Code: Select all
if (mysql_check("4.0.1") == FALSE) {
// Search with MySQL 3.23.23+
$query = "SELECT id, lang, rubrik, thema, content FROM ".$sqltblpre."faqdata WHERE MATCH (thema,content,keywords) AGAINST ('".$begriff."') AND active = 'yes'";
}
else {
// Search with MySQL 4.0.1+
$query = "SELECT id, lang, rubrik, thema, content FROM ".$sqltblpre."faqdata WHERE MATCH (thema,content,keywords) AGAINST ('".str_replace(" ", "* ", trim($begriff))."*' IN BOOLEAN MODE) AND active = 'yes'";
}
Code: Select all
if (mysql_check("4.0.1") == FALSE) {
// Search with MySQL 3.23.23+
$query = "SELECT id, lang, rubrik, thema, content FROM ".$sqltblpre."faqdata WHERE MATCH (keywords) AGAINST ('".$begriff."') AND active = 'yes'";
}
else {
// Search with MySQL 4.0.1+
$query = "SELECT id, lang, rubrik, thema, content FROM ".$sqltblpre."faqdata WHERE MATCH (keywords) AGAINST ('".str_replace(" ", "* ", trim($begriff))."*' IN BOOLEAN MODE) AND active = 'yes'";
}
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Alright, I have made these changes. Seems like it is not finding the keywords properly. I have tried searching for many items and no articles are being returned.
If I look at the phpmyadmin "structure" page, it says that the keywords indexd has a cardnality of 24. I think that it should be higher than that.
Perhaps we are not entering the keywords properly??
If I look at the phpmyadmin "structure" page, it says that the keywords indexd has a cardnality of 24. I think that it should be higher than that.
Perhaps we are not entering the keywords properly??
Hi,
does this query
work in the SQL console in phpMyAdmin?
bye
Thorsten
does this query
Code: Select all
SELECT id, lang, rubrik, thema, content FROM faqdata WHERE MATCH (keywords) AGAINST ('<your search>') AND active = 'yes'
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist