Search APIs are too expensive, how do I build a free search engine myself?

AI Answers6mos agorelease Sharenet.ai
1.1K 0
Trae

Build your own private search engine SearXNG

Preparation. Make sure you have Docker and Docker Compose installed on your machine.

Step 1: Create the instance catalog

First, create a directory to hold the SearXNG configuration files:

mkdir searxng

Step 2: Run the SearXNG Docker Container

Use the following command to pull the Docker image of SearXNG and run the container:

docker run \ --rm -d -p 8081:8080 \ -v "${PWD}/searxng:/etc/searxng" \ -e "BASE_URL=http://localhost:8081/" \ -e "INSTANCE_NAME=searxng" \ searxng/searxng

Step 3: Enable JSON Format Output

SearXNG does not output results in JSON format by default.

  1. Go to the container's configuration file directory:cd /root/searxng
  2. Open it with your favorite text editor settings.yml Documentation.
  3. locate formats section, add json::
formats: - json # 添加 json 格式
  1. Restart the Docker container to make the changes take effect:
docker restart

Step 4: Configure SearXNG in Open Web UI

Now you can add SearXNG as a custom search engine in Open Web UI.

  • Searxng query URL. http://<SearXNG_IP>:8081

commander-in-chief (military) <SearXNG_IP> Replace with the IP address of the SearXNG instance.

  • Intranet access. Use the IP address of the container.
  • Extranet access. Use the public IP address of your server.

Done!

Note that the port can be replaced with the one you want to prevent whitelining.

© Copyright notes
AiPPT

Related posts

No comments

none
No comments...