Drop image results that come back without a thumbnail URL - #2495
Draft
felladrin wants to merge 1 commit into
Draft
Drop image results that come back without a thumbnail URL#2495felladrin wants to merge 1 commit into
felladrin wants to merge 1 commit into
Conversation
SearXNG often returns image and video results with no thumbnail_src or thumbnail. Before the /thumbnail endpoint, those results were dropped as a side effect of the server-side thumbnail fetch failing. Now the fetch happens in the browser, so they survived to the grid and rendered as host-name text tiles: 3 to 6 of every 10-20 results across sampled queries. processGraphicalResult now returns null for them, so filterNullResults drops them the way the other unusable results are dropped. The client's host-name fallback stays for the case it was written for: a thumbnail URL that is there but fails to load.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently, the image grid shows host-name text tiles instead of pictures, for a large share of the results. SearXNG often returns image and video results with no
thumbnail_src(or nothumbnail, for the videos category), and until #2489 those results were dropped as a side effect: the server fetched every thumbnail itself, the fetch of an empty URL threw, and the result was filtered out. Now the browser loads each tile from/thumbnail, so nothing drops them anymore and they reach the carousel with an empty thumbnail, where the client renders the host name as a fallback.Sampled on the dev container, before the fix:
guitar tutorial6 of 15,cat6 of 20,cooking pasta5 of 20,mountain landscape4 of 18,javascript tutorial3 of 16. After the fix, all five queries return zero results without a thumbnail. (Ongolden retriever puppiesthe grid went from ayoutube.complaceholder in the second tile to 17 results that are all images.)processGraphicalResultnow returnsnullfor those, sofilterNullResultsdrops them the same way it drops a text result without a snippet. The now-unreachabletry/catcharound the tuple went away with it (it was there for the thumbnail fetch that moved to/thumbnail).The client's host-name fallback tile stays as it is. It still covers the case it was written for: a thumbnail URL that is there but fails to load (a dead host, a 403, a non-raster type), plus cached history entries from before this change.
How to test
docker compose updocker compose exec development-server npm run test(new case inserver/webSearchService.test.ts: "drops image results that carry no thumbnail URL")http://localhost:7860/?q=guitar%20tutorialand check the image carousel. Every tile is a picture, with no gray boxes readingyoutube.comor similar.docker compose exec development-server npm run lint