Problem with QuickSearch function

Found a bug? Tell us!!
Post Reply
ChrisBianchi
Posts: 3
Joined: Wed Feb 09, 2005 6:46 pm
Location: Columbus, Ohio
Contact:

Problem with QuickSearch function

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problem with QuickSearch function

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Re: Problem with QuickSearch function

Post 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?
ChrisBianchi
Posts: 3
Joined: Wed Feb 09, 2005 6:46 pm
Location: Columbus, Ohio
Contact:

Post by ChrisBianchi »

Woohoo! I'm not sure what happened. This morning the queries started to return results. Whatever. At least it's working :)
Post Reply