Page 1 of 1

Problem with QuickSearch function

Posted: Wed Feb 09, 2005 7:01 pm
by ChrisBianchi
I just installed Serendipity 0.7.1 on my server running Fedora Core 3, Apache 2.0.52, and MySQL 4.1.9.

Initially, I was having the previously reported problem with the search ('no results to print' error due to lack of index). After creating the index, that error no longer occurs.

Now, I simply get 'No Entries Found for Query...' regardless of what I enter. For example 'No Entries Found for Query Introduction' despite the fact that I have an entry actually titled 'Introduction'. I also have an entry with several instances of the word 'democracy' and that also results in 'No Entries Found...'

I attempted to abbreviate the search query as follows:
SELECT id FROM serendipity_entries WHERE MATCH(title,body,extended) AGAINST('democracy')
I am returned the empty set. However, the following query works fine:
SELECT id FROM serendipity_entries WHERE title LIKE '%democracy%' OR body LIKE '%democracy%' OR extended LIKE '%democracy%'
Any suggestions? At this point, I'm prepared to re-write the query in the source simply to accomodate this.

BTW: I noticed that the query depends on the timestamp. What is the relevance of this? Either the post is a draft or it's not. I can understand not querying drafts but queries where the timestamp may be incorrect? Or is there some provision in Serendipity that I haven't found yet to schedule a future post that you do not currently wish to search?

Thanks

Re: Problem with QuickSearch function

Posted: Thu Feb 10, 2005 10:29 am
by garvinhicking
If you rewrite the SQL like this, you will screw up performance significantly. Fulltext search can only be used with the MATCH method. If you use a LIKE method, performance will drop about 500-1000% and will not be usable as soon as you have several hundred entries.

Have you made sure that your MySQL table has the fulltext indices set? Maybe there's a MySQL option to trigger the results?

MySQL does also not show results if your entries are very short - is that the case?

The timestamp is needed because entries in the future are not shown by default. There's a setting in Serendipity 0.8 which enables you to configure this behavior. It's typical for blogs to not show dates in the future, that's why this is the default.

Regards,
Garvin

Re: Problem with QuickSearch function

Posted: Thu Feb 10, 2005 5:45 pm
by Guest
garvinhicking wrote: Have you made sure that your MySQL table has the fulltext indices set? Maybe there's a MySQL option to trigger the results?
I read the previous posts and did set the fulltext indices. This cleaned up the initial problem. I'm still getting no results in any search queries.
garvinhicking wrote: MySQL does also not show results if your entries are very short - is that the case?
The entries are not, by my standards, short. Most of them amount to a full printed page.
garvinhicking wrote: The timestamp is needed because entries in the future are not shown by default. There's a setting in Serendipity 0.8 which enables you to configure this behavior. It's typical for blogs to not show dates in the future, that's why this is the default.
Cool. I just wasn't aware of this feature.

Still having a problem with no results. Anyone have any suggestions?

Posted: Thu Feb 10, 2005 5:48 pm
by ChrisBianchi
Woohoo! I'm not sure what happened. This morning the queries started to return results. Whatever. At least it's working :)