Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: How to use 'search' properly? (Read 4525 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to use 'search' properly?

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?

How to use 'search' properly?

Reply #1
Add "AND" between two words. "MPC AND AAC" is working fine

How to use 'search' properly?

Reply #2
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.
Microsoft Windows: We can't script here, this is bat country.

 

How to use 'search' properly?

Reply #3
Quote
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.
[a href="index.php?act=findpost&pid=229562"][{POST_SNAPBACK}][/a]


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.

How to use 'search' properly?

Reply #4
Perhaps a simple help page linked from search page would work better ?
Microsoft Windows: We can't script here, this is bat country.

How to use 'search' properly?

Reply #5
Quote
Perhaps a simple help page linked from search page would work better ?
[a href="index.php?act=findpost&pid=229568"][{POST_SNAPBACK}][/a]

Or how about a one-liner on the search error page stating that you need to use "AND" when searching for multiple terms.


How to use 'search' properly?

Reply #7
Quote
Wouldn't it be possible to modify the PHP so " " (blank) is replaced with " AND " on submit?
[a href="index.php?act=findpost&pid=229626"][{POST_SNAPBACK}][/a]


But if I search for "drive AND supported", it will search "drive AND AND AND supported" !

How to use 'search' properly?

Reply #8
Yes, good point... "drive OR supported" will also translate to "drive AND OR AND supported".

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.

How to use 'search' properly?

Reply #9
ereg() or pregmatch() could probably do what you're suggesting.

But I think a short explanation on the search page would probably be easier?
daefeatures.co.uk

How to use 'search' properly?

Reply #10
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