1 (edited by ssb 2004-02-29 14:01)

Topic: Search problems

I have some problems with searching function. I'm not sure if that's a bug but let me explain the situation.

1. Sometimes, searching returns no results although the specific word exist in many posts. For example searching for the word "many" returns none although other common words can be found just fine.

2. Opening a searching result post and hitting IE back (to return to results), makes punbb to search again. That cause a delay especially for complex search queries. I think a return to cached results page whould be much better.

Really hope punbb 1.2 will fix those issues smile

Thanks

Sakis is my name, ssb just a nick.

Re: Search problems

it doesn't search for short words, or for stopwords (really common words, they're defined in the language files called XX_stopwords.txt (where XX is the lang pack you're using)

in that file, you can find the word "many" ... thus that is ignored ...

3

Re: Search problems

You're right Frank, never noticed that file.
Anyway i think that should be explained in search results page. Easy to change that though smile

Thanks

Sakis is my name, ssb just a nick.

Re: Search problems

ssb wrote:

2. Opening a searching result post and hitting IE back (to return to results), makes punbb to search again. That cause a delay especially for complex search queries. I think a return to cached results page whould be much better.

This is already on my internal TODO list for PunBB 1.2 :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

5

Re: Search problems

Thanks Rickard

Sakis is my name, ssb just a nick.

Re: Search problems

As I was going to change this, I thought of something. It is sometimes nice to be able to "link to a search". Forwarding users to the cached search result directly prevents them from linking to the search.

Searches are cached for the searching user only (you can't see my searches). If you don't know what I mean, do a search, skip to page two and then paste that URL into a message, the link will only work for you and everyone else will get a "Bad request". Also, the search cache is emptied now and then and will definately be emptied the next time you visit the forums.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Search problems

Nevermind, I fixed it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

8

Re: Search problems

Nevermind, I fixed it

Great, are you going to release now those fixes or we should wait for v1.2?

Thanks

Sakis is my name, ssb just a nick.

Re: Search problems

I will probably wait for 1.2 for this change since it's somewhat of a new feature. If you want to do the change yourself though, here's how. Open up search.php and locate:

$db->query('UPDATE '.$db->prefix.'search_results SET id='.$search_id.', search_data=\''.$temp.'\' WHERE ident=\''.$ident.'\'') or error('Unable to update search results', __FILE__, __LINE__, $db->error());
if (!$db->affected_rows())
    $db->query('INSERT INTO '.$db->prefix.'search_results (id, ident, search_data) VALUES('.$search_id.', \''.$ident.'\', \''.$temp.'\')') or error('Unable to insert search results', __FILE__, __LINE__, $db->error());

after that, add

// Redirect the user to the cached result page
header('Location: search.php?search_id='.$search_id);
exit;

Voila!

"Programming is like sex: one mistake and you have to support it for the rest of your life."

10

Re: Search problems

Thanks Rickard smile

Sakis is my name, ssb just a nick.