Advanced search "negation"

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15585
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Advanced search "negation"

Post by ChrisGreaves »

Some frustration might be relieved in some members with the passing on of this tit-bit from phpBB:-
“You can't have a search term with only a negative parameter (Which the - is), so you will need to add something with the negative parameter, or leave the negative parameter out.”
This rule had previously escaped my notice.

If you are perusing a model railway phpBB site and are not interested in "steam" (or diesel if you are older), then a Simple search "-steam" will always return zero results.
If you have chosen "New Posts" from the QuickLinks menu and then Search Within These Results for "-steam", your new posts results will be unchanged(1).
If you choose "search" from the Quick Links menu, you will be in Advanced Search. Searching for "-steam -diesel" will return zero results.

phpBB has a restriction that insists on at least one positive search term. This appears to be a design decision in phpBB. I can not come up with a reason or logic for disallowing only a negative search term in a search of any database. Timing/resources - yes. I can understand a throttle on those searches which would necessitate a search of every term in every record in a database.

(1)leaving open the question of whether you were against steam in the newest messages in the found thread, or the first, or all, or any of the messages in that thread.

Cheers
Chris
There's nothing heavier than an empty water bottle