SeaSearch configuration (Pro)¶
SeaSearch, a lightweight and efficient file indexer, is supported from Seafile 12 and is the default search engine from Seafile Pro 14.0.
For Seafile deploy from binary package
We currently only support Docker-based deployment for SeaSearch Server, so this document describes the configuration with the situation of using Docker to deploy Seafile server.
If your Seafile Server deploy from binary package, please refer here to start or stop Seafile Server.
For Seafile cluster
Theoretically, at least the backend node has to restart, if your Seafile server deploy in cluster mode, but we still suggest you configure and restart all node to make sure the consistency and synchronization in the cluster
Deploy SeaSearch service¶
SeaSearch service is currently mainly deployed via docker. We have integrated it into the relevant docker-compose file. You only need to download it to the same directory as seafile-server.yml:
wget https://manual.seafile.com/14.0/repo/docker/pro/seasearch.yml
Modify .env¶
The default .env file already contains the relevant SeaSearch variables. Pay special attention to the following variables, which affect the SeaSearch initialization process. For details about the SeaSearch variables in .env, please refer here. We use /opt/seasearch-data as the persistent directory of SeaSearch. By default, the SeaSearch administrator account is the same as the Seafile administrator account:
For Apple's Chips
Since Apple's chips (such as M2) do not support MKL, you need to set the relevant image to xxx-nomkl:latest, e.g.:
SEASEARCH_IMAGE=seafileltd/seasearch-nomkl:latest
COMPOSE_FILE='...,seasearch.yml' # ... means other docker-compose files
#SEASEARCH_IMAGE=seafileltd/seasearch-nomkl:1.0-latest # for Apple's Chip
SEASEARCH_IMAGE=seafileltd/seasearch:1.0-latest
SS_DATA_PATH=/opt/seasearch-data
INIT_SS_ADMIN_USER=<admin-username>
INIT_SS_ADMIN_PASSWORD=<admin-password>
# if you would like to use S3 for saving seasearch data
SS_STORAGE_TYPE=s3
S3_SS_BUCKET=...
S3_KEY_ID=<your-key-id>
S3_SECRET_KEY=<your-secret-key>
S3_USE_V4_SIGNATURE=true
S3_PATH_STYLE_REQUEST=false
S3_AWS_REGION=us-east-1
S3_HOST=
S3_USE_HTTPS=true
S3_SSE_C_KEY=
Disable Elasticsearch service¶
For a new Seafile Pro 14.0 deployment, no change is needed.
If you are switching an existing deployment from Elasticsearch to SeaSearch, remove elasticsearch.yml from the COMPOSE_FILE variable in .env. Elasticsearch is no longer needed after the switch.
Modify seafevents.conf¶
For the Seafile cluster
If you are using a Seafile cluster server, you need to ensure that the seafevents.conf configuration file on your backend node machine has made the following changes, but we still suggest you to make the same configurations in all node to make sure the consistency and synchronization in the cluster
-
Get your authorization token by base64 code consist of
INIT_SS_ADMIN_USERandINIT_SS_ADMIN_PASSWORDdefined in.envfirsly, which is used to authorize when calling the SeaSearch API:echo -n 'username:password' | base64 # example output YWRtaW46YWRtaW5fcGFzc3dvcmQ= -
Add the following section in seafevents to enable seafile backend service to access SeaSearch APIs
SeaSearch server deploy on a different machine with Seafile
If your SeaSearch server deploy on a different machine with Seafile, please replace
http://seasearch:4080to the url<scheme>://<address>:<port>of your SeaSearch server[SEASEARCH] enabled = true seasearch_url = http://seasearch:4080 seasearch_token = <your auth token> interval = 10m # if you would like to enable full-text indexing (i.e., search for document content), also set the option below to true (support from 13.0 Pro) index_office_pdf = true -
Disable the ElasticSearch, as you can set
enabled = falseinINDEX FILESsection:[INDEX FILES] enabled = false ...
Restart Seafile Server¶
docker compose down
docker compose up -d
After startup the SeaSearch service, you can check the following logs for Whether SeaSearch runs normally and Seafile is called successfully:
- container logs by command
docker logs -f seafile-seasearch /opt/seasearch-data/log/seafevents.log
After first time start SeaSearch Server
You can remove the initial admin account informations in .env (e.g., INIT_SS_ADMIN_USER, INIT_SS_ADMIN_PASSWORD), which are only used in the SeaSearch initialization progress (i.e., the first time to start services). But make sure you have recorded it somewhere else in case you forget the password.