duckduckgo / duckduckgo-help-pages

DuckDuckGo Help Pages
https://duckduckgo.github.io/duckduckgo-help-pages/
MIT License
212 stars 209 forks source link

Search exclusion does not work as expected #160

Open frikdt opened 1 year ago

frikdt commented 1 year ago

Quoting from the ddg search syntax help page

cats -dogs Fewer dogs in results

However, when using this pattern the exact opposite happens: The search results include more of the excluded term and not fewer. For example, I have just been running a search for

johan ackerman

and one for

johan ackerman -facebook

I'm adding the generated search urls in case it may be of any use: 1.https://duckduckgo.com/?q=johan+ackerman&t=newext&atb=v260-1&ia=web

  1. https://duckduckgo.com/?q=johan+ackerman+-facebook&t=newext&atb=v260-1&ia=web

In the first case the top 10 results contain only one result referencing facebook, and that result is in position 10 on the list; the second search, which I would have expected to contain no result referencing facebook, or one at most, actually contains three such results; and to make matters worse these are at or near the top of the result set in positions 1, 2, and 4, and the word facebook is even highlighted (bold) in each.

Search was done in Firefox 102.5.0esr (64-bit) on Debian GNU/Linux 11 (bullseye).

BoneTone commented 1 year ago

@frikdt you're actually not using the syntax correctly as described in the help page (which you linked). You're simply putting "-facebook" into your search string, when per the syntax help page what you should be using is "-site:facebook.com"

Just for some data, somewhat ironically as I went to test your searches, doing a ddg search with "johan ackerman -facebook" actually didn't provide me a single result from facebook. While searching with just "johan ackerman" as the string, facebook showed up in my results at positions: 9, 26, 27, & 29... I stopped looking after the first 30 results.

All that said, the point still stands that you should modify how you are constructing your search query string to follow the syntax as described in the help page. Also, as a side note, currently and depressingly, ddg doesn't support the syntax you were trying at all, for the exclusion of search "terms" rather than results on a site which you were trying to do, which is does support.

StarkRG commented 1 year ago

Yeah, it still isn't working as the help page suggests it should

Searching for the term "elemental" only shows results for a particular movie produced by Pixar and released by Disney, surely excluding the terms "disney" and "pixar" should remove nearly all results related to that movie, but it does not. image