But sometimes I found that a few things can be searched !
![Question :?:](./images/smilies/icon_question.gif)
What should I do to make search works well always? Thank you very much!
I do input words longer than 3 characters otherwise it willgarvinhicking wrote:When does the search work and when not? You need to use words longer than 3 characters and pay attention to special characters.
There are a few threads on this forum about missing MySQL fulltext keys, maybe you search them up and see if your keys are correct. But then again, if your search works "sometimes", that can't be the case.
Need more input.
Regards,
Garvin
Code: Select all
The search function did not work as expected. Notice for the administrator of this blog: This may happen because of missing index keys in your database. On MySQL systems your database user account needs to be privileged to execute this query:
CREATE FULLTEXT INDEX entry_idx on serendipity_entries (title,body,extended)
The specific error returned by the database was:
SELECT
e.id,
e.author,
a.username,
a.email,
ec.categoryid,
e.timestamp,
e.comments,
e.title,
e.body,
e.extended,
e.trackbacks,
e.exflag
FROM
serendipity_entries e
LEFT JOIN serendipity_authors a
ON e.authorid = a.authorid
LEFT JOIN serendipity_entrycat ec
ON e.id = ec.entryid
WHERE
MATCH(title,body,extended) AGAINST('Test')
AND isdraft = 'false' AND timestamp <= 1105601476
GROUP BY e.id
ORDER BY timestamp DESC
LIMIT 15
/ Can't find FULLTEXT index matching the column list
Code: Select all
mysql>grant CREATE FULLTEXT INDEX entry_idx on serendipity_entries to seuser@localhost
Code: Select all
mysql -useuser -p se
mysql>CREATE FULLTEXT INDEX entry_idx on serendipity_entries (title,body,extended);
Code: Select all
emerge -pv mysql
dev-db/mysql-4.0.23 +berkdb -debug -innodb +perl +readline (-selinux) +ssl -static -tcpd 0 kB
Code: Select all
example
This is a example to be searched!
Here is the content.:D
Code: Select all
My new test for it.hehe
Code: Select all
if (strtolower($serendipity['dbType']) == 'postgres') {
$group = '';
$distinct = 'DISTINCT';
$find_part = "(title~'$term' OR body~'$term' OR extended~'$term')";
}
Code: Select all
if (strtolower($serendipity['dbType']) == 'postgres') {
$group = '';
$distinct = 'DISTINCT';
$find_part = "(title~*'$term' OR body~*'$term' OR extended~*'$term')";
}