Page 1 of 2
How to search on static pages?
Posted: Thu Jul 27, 2006 9:36 pm
by urmelchen
I don't know whats wrong, but
my site search doesn't search static pages. If i understand
this article correct, the search should work if (min) version 3.30 of the static page plugin is installed. I did have actualy installed version 3.35 of the static page plugin and all i can see on the results page, if i do make a search for an certainly on a static page used word is
Found 0 static pages: ... and nothing else.
Can you please help me out and tell me whats wrong?
Posted: Fri Jul 28, 2006 12:22 am
by stm999999999
I can tell you, that sadly I can confirm the bug.
Neither the normal search nor the javascript quicksearch works. Static pages V 3.35
Posted: Fri Jul 28, 2006 7:40 am
by urmelchen
I'm happy to hear its a bug. So maybe it get fixed i a short time

Can you tell me where to submit bugs for Serendipity? Just post it in the bugs forum? So can a mod please move this thread to the bugs forum?
Posted: Fri Jul 28, 2006 1:30 pm
by garvinhicking
Hi!
Can you guys please check if your serendipity_staticpage table has a Fulltext Index on your tables?
It works here as intended, with the fulltext indices in place...
Best regards,
Garvin
Posted: Fri Jul 28, 2006 4:43 pm
by stm999999999
Code: Select all
Name Typ Kardinalität Feld
PRIMARY PRIMARY 1 id
staticentry_idx FULLTEXT keine headline und content
Posted: Fri Jul 28, 2006 5:01 pm
by garvinhicking
Hi!
Hm, that looks about right.
Could you edit your staticpage plugin, there's this code:
Code: Select all
$querystring = "SELECT $distinct s.*, a.realname
FROM {$serendipity['dbPrefix']}staticpages AS s
LEFT OUTER JOIN {$serendipity['dbPrefix']}authors AS a
ON a.authorid = s.authorid
WHERE $find_part
AND s.publishstatus = 1
AND s.pass = ''
$group
ORDER BY timestamp DESC";
Please add a
after that (or maybe even a die($querystring) if you don'T get output) and then check what the SQL looks like, and if it returns rows in phpMyAdmin?
Best regards,
Garvin
Posted: Fri Jul 28, 2006 5:36 pm
by stm999999999
the sql:
Code: Select all
SELECT s.*, a.realname FROM serendipity_stm_staticpages AS s LEFT OUTER JOIN serendipity_stm_authors AS a ON a.authorid = s.authorid WHERE MATCH(headline,content) AGAINST('Inhaltlich') AND s.publishstatus = 1 AND s.pass = '' GROUP BY id ORDER BY timestamp DESC
und das Ergebnis and the result:
Code: Select all
MySQL lieferte ein leeres Resultat zurück (d.h. null Zeilen). (die Abfrage dauerte 0.0012 sek)
SQL-Befehl:
SELECT s. * , a.realname
FROM serendipity_stm_staticpages AS s
LEFT OUTER JOIN serendipity_stm_authors AS a ON a.authorid = s.authorid
WHERE MATCH (
headline, content
)
AGAINST (
'Inhaltlich'
)
AND s.publishstatus =1
AND s.pass = ''
GROUP BY id
ORDER BY timestamp DESC
LIMIT 0 , 30
What did it make wiht authorid!?
Posted: Fri Jul 28, 2006 6:40 pm
by garvinhicking
Hi!
How many staticpages do you have? IF you only have 1 or 2 entries, MySQL fulltext search will not find anything:
http://dev.mysql.com/doc/refman/5.0/en/ ... uning.html
Regards,
Garvin
Posted: Fri Jul 28, 2006 6:55 pm
by stm999999999
Äh, I have exactly and without any error in counting: ONE! ;->
Posted: Fri Jul 28, 2006 6:58 pm
by garvinhicking
*g*. Then, as sad as it is: But due to the mysql search facility, this will not work with just one page. I don't know what the actual threshold is, but the search should AFAIR work when having at least 3 or 4 database rows.
Regards,
Garvin
Posted: Sun Jul 30, 2006 10:22 pm
by urmelchen
Ah okay, sounds wired. I actualy have 4 (non hidden) static pages and at least 1 hidden page. How many (hidden) pages i have to create. to get the search function to work?
I've added 3 more (hidden) pages, and search doesn't work at all.
Posted: Mon Jul 31, 2006 2:09 pm
by garvinhicking
Hi urmelchen!
Well, you are another person, so my solution to stm999 might or might not apply to you
Did you try the same things like stm999? What does the SQL tell you?
Best regards,
Garvin
Posted: Tue Aug 01, 2006 8:14 pm
by urmelchen
Since my server admin didn't answer right now, i've played a little bit around. Now it seems to work ... after i was trying a case sensitive search. But read on:
First thing i idiscoverd is, that the search on static pages is case sensitiv. Take a look at
my site and search (f.e.) for "Gotha". You will find one hit. If you search for "gotha" you will don't find anything. Bug or feature? Maybe case sensitiv should be turned off by default?
Second: Search for the phrase mentioned above and you will see that the search result contains pictures and links from the static page. This will actualy destroy the result page. Maybe you can fix this?
Posted: Tue Aug 01, 2006 8:15 pm
by garvinhicking
Hi!
Which MySQL version are you using? Actually the mysql fulltext search should alaways be case insensitive! I am quite surprised by this result!
Second: Search for the phrase mentioned above and you will see that the search result contains pictures and links from the static page. This will actualy destroy the result page. Maybe you can fix this?
You should be able to adjust the search results via the .tpl file?
Best regards,
Garvin
Posted: Wed Aug 02, 2006 11:21 pm
by urmelchen
garvinhicking wrote:Hi!
Which MySQL version are you using? Actually the mysql fulltext search should alaways be case insensitive! I am quite surprised by this result!
But you can confirm this? I wrote an mail to the server admin, in hope he will reply (asap).
Second: Search for the phrase mentioned above and you will see that the search result contains pictures and links from the static page. This will actualy destroy the result page. Maybe you can fix this?
You should be able to adjust the search results via the .tpl file?
Where is the file located at? I'am right, that i need to have ftp-access to the server, to modify this file?