Help - Search - Members - Calendar
Full Version: How to use 'search' properly?
Hydrogenaudio Forums > Hydrogenaudio Forum > Site Related Discussion
Xenoide
Hi folks,

some strange things are going on with the search function of this forum.

Let's say, I want to find all topics, with titles starting with "AAC" and "MPC", so I enter

AAC MPC

in the search box and select "Search titles only".

But this returns me

QUOTE
sorry, an error occurred. If you are unsure on how to use a feature, or don't know why you got this error message, try looking through the help files for more information.

The error returned was:

Sorry, but we did not find any matches to display. Try again and broaden your search criteria. If you were searching for new posts since your last visit, it's possible that there are none to show.



however, this seems quite absurd, as I have seen quite a lot threads with those words in the title before, so that can't be right.

Any hints, how to do it right?
guruboolez
Add "AND" between two words. "MPC AND AAC" is working fine smile.gif
Peter
Use "AAC and MP3" instead.
Yes, you are not the only person who thinks this behavior is wrong. I guess google-like engines spoiled us.
Alternatively, googling for "site:www.hydrogenaudio.org <search phrase>" works too.
Dibrom
QUOTE(zZzZzZz @ Jul 27 2004, 04:45 PM)
Use "AAC and MP3" instead.
Yes, you are not the only person who thinks this behavior is wrong. I guess google-like engines spoiled us.
Alternatively, googling for "site:www.hydrogenaudio.org <search phrase>" works too.
*



Apparently the reason for this behavior is due to the way that mysql does searches internally. By default, it uses OR rather than AND for multiple arguments. There was a post about this from the ipb developer on the company boards awhile back, but I'm too busy/lazy to dig it up right now.

Apparently it is possible to change the default mysql behavior internally, but it involves some modifications that might end up breaking everything else that depends on the default ( and in this case undesirable ) behavior.

And from what I could gather, the mysql guys don't want to change it at this point because of everything that has been developed with the old method in mind..

I guess it wouldn't be all that hard to wrap the ipb searches to mysql AND searches, but for some reason this isn't done.
Peter
Perhaps a simple help page linked from search page would work better ?
idioteque
QUOTE(zZzZzZz @ Jul 27 2004, 08:03 PM)
Perhaps a simple help page linked from search page would work better ?
*

Or how about a one-liner on the search error page stating that you need to use "AND" when searching for multiple terms.
Sebastian Mares
Wouldn't it be possible to modify the PHP so " " (blank) is replaced with " AND " on submit?
Pio2001
QUOTE(Sebastian Mares @ Jul 28 2004, 08:09 AM)
Wouldn't it be possible to modify the PHP so " " (blank) is replaced with " AND " on submit?
*



But if I search for "drive AND supported", it will search "drive AND AND AND supported" !
Sebastian Mares
Yes, good point... "drive OR supported" will also translate to "drive AND OR AND supported". sad.gif

Anyways, I am sure you can do it. Check for space and if it isn't followed by the full word "AND", "OR", "NOT" or whatever, replace the space with "AND". However, I don't know PHP and therefore cannot say how difficult this is. sad.gif
evereux
ereg() or pregmatch() could probably do what you're suggesting.

But I think a short explanation on the search page would probably be easier?
Xenoide
oh, great.

Thank you a lot. Well, I'm used to phpBB and there it works a little bit different. But that's something you have to know I guess, maybe it would make sense to include a little hint on the search page to help dumb people like me and prevent them from opening useless threads like that wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.