This revision is from 2024/06/24 16:19. You can Restore it.
SearXNG installs itself on /usr/local/searxng/searxng-src, with the main source code in searxng-src directory.
Interesting files are...
webapp.py in /usr/local/searxng/searxng-src/searx/webapp.py : def search()
__init__.py in /usr/local/searxng/searxng-src/searx/search/__init__.py : class Search
A cache implentation here...
making a directory in the searx folder named cache
make a sub-folder for every possible character in the cache directory, for instance a to z and 0 to 9
the cache files are named by and are indentical to the search term
check if the filename exists when a search is performed
if there is a match read in the local file instead and defer the search
send the keywords to cache maintainers so they can update the cache. They can then crawl the search engines and build a more comprehensive cache over time.
the user updates their cache
Another implementaiton is a searx caching search engine, where the search term goes to a caching proxy rather than directly to search engines.
Benefits: Why do this?
Imagine a man in the middle that knows your search term before you and performed the search prior and then returned had the result ready. The result is the same, except it would very much faster. That is what a cache could do, it could also allow for a more comprehensive search. I could perform searches across all the search engines, compile and store that data on disk and when I searched the same term again, the result would be optimized.
Moreover, this turns searXNG into a full search engine built from caching results, searches are against a local file, so it speeds up searching significantly and offline searching is possible if the cache gets big enough.
Searx is privacy focused search engine, so disclosure to end user that however anonymous, caching requires keywords/search term sharing. That is how the cache is built.