Page 1 of 1

Bug or not? search-function not working

Posted: Tue Jun 20, 2006 8:07 pm
by Lumpy
Hi,

I've just installed Serendipity and added a few entries. Afterwards I just want to try to the search-function but unfortunately the only output is a error message.
Die Suche konnte nicht wie gewünscht ausgeführt werden. Hinweis für den Administrator dieses Blogs: Der Fehler kann durch fehlende Index-Schlüssel der Datenbank verursacht werden. Auf MySQL-Systemen muss der Datenbankbenutzer-Account in der Lage sein, Index-Schlüssel zu erstellen und folgende Abfrage auszuführen:

CREATE FULLTEXT INDEX entry_idx on serendipity_entries (title,body,extended)

Die genaue Fehlermeldung der Datenbank bei der Suche lautete:

SELECT
e.id,
e.authorid,
a.realname AS author,
a.email,
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
LEFT OUTER JOIN serendipity_entryproperties ep_no_frontpage
ON (e.id = ep_no_frontpage.entryid AND ep_no_frontpage.property = 'ep_no_frontpage')
LEFT OUTER JOIN serendipity_entryproperties ep_cache_extended
ON (e.id = ep_cache_extended.entryid AND ep_cache_extended.property = 'ep_cache_extended')
LEFT OUTER JOIN serendipity_entryproperties ep_cache_body
ON (e.id = ep_cache_body.entryid AND ep_cache_body.property = 'ep_cache_body')
LEFT OUTER JOIN serendipity_entryproperties ep_access
ON (e.id = ep_access.entryid AND ep_access.property = 'ep_access')
LEFT OUTER JOIN serendipity_entryproperties ep_access_groups
ON (e.id = ep_access_groups.entryid AND ep_access_groups.property = 'ep_access_groups')
LEFT JOIN serendipity_entryproperties ep_sticky
ON (e.id = ep_sticky.entryid AND ep_sticky.property = 'ep_is_sticky') LEFT JOIN serendipity_category c
ON ec.categoryid = c.categoryid LEFT JOIN serendipity_authorgroups AS acl_a
ON acl_a.authorid = 1
LEFT JOIN serendipity_access AS acl_acc
ON ( acl_acc.artifact_mode = 'read'
AND acl_acc.artifact_type = 'category'
AND acl_acc.artifact_id = c.categoryid
)
WHERE
(MATCH(title,body,extended) AGAINST('flat o2'))
AND isdraft = 'false' AND timestamp <= 1150826683 AND (ep_access.property IS NULL OR ep_access.value = 'member' OR ep_access.value = 'public' OR (ep_access.value = 'private' AND e.authorid = 1)) AND (ep_access_groups.property IS NULL OR (ep_access.value = 'member' AND (ep_access_groups.value LIKE '%;3;%'))) AND (ep_no_frontpage.property IS NULL OR ep_no_frontpage.value != 'true') AND (
c.categoryid IS NULL
OR ( acl_acc.groupid = acl_a.groupid OR acl_acc.groupid = 0)
OR ( acl_acc.artifact_id IS NULL

)
)
GROUP BY e.id
ORDER BY timestamp DESC
LIMIT 15

/ Can't find FULLTEXT index matching the column list
Is this a error in general and did I forget something to set up?

Best regards
Lumpy

Posted: Tue Jun 20, 2006 10:48 pm
by Lumpy
I did a little step forward. :lol:

I simply created the FULLTEXT INDEX entry_idx manually within phpmyadmin. Now the search-function is working but does not find any results in the entries.

Anybody who knows the reason? ;)


Best regards
Lumpy

EDIT:Again I did a little step forward. Having added a new entry I'm able to use the search function and also get the results expected. But there is still a little problem. If the option »Hide from article overview / frontpage« of the advanced options is ticked then it is also excluded from the search although I'm logged in as administrator.

Posted: Wed Jun 21, 2006 11:09 am
by garvinhicking
Hi!

The reason would be that your mysql user did not have "CREATE INDEX" privileges when you installed serendipity. :)

About the no frontpage bug: I just fixed this here: http://svn.berlios.de/viewcvs/serendipi ... erties.php

HTH,
Garvin

Posted: Wed Jun 21, 2006 11:18 am
by Lumpy
The reason would be that your mysql user did not have "CREATE INDEX" privileges when you installed serendipity. Smile
Are there any other index which should be created?
About the no frontpage bug: I just fixed this here:
...
Thanks for your quick reply. This fixed the problem.

Best regards
Lumpy

My PROBLEM is the same Problem - SUCHE not find any results

Posted: Fri Sep 29, 2006 12:32 am
by mot2001
Lumpy wrote:I did a little step forward. :lol:

I simply created the FULLTEXT INDEX entry_idx manually within phpmyadmin. Now the search-function is working but does not find any results in the entries.
You know the reason now?
It seems that Garvins Hack maybe is not the reason

Posted: Fri Sep 29, 2006 4:41 am
by judebert
SQL FULLTEXT search doesn't work unless you have a minimum amount of text. Do you have any entries?

In what way exactly is search failling for you?

Posted: Fri Sep 29, 2006 11:37 am
by ihra
Fulltext search requires about 20-50 entries with about 2k total of text to perform search correctly (I did some research while using geeklog/phpnuke long time ago, actual amounts could be changed). MySQL docs give pretty good discussion about subject.