Skip to content

Search with SeaSearch (Pro)

SeaSearch, a lightweight and efficient file indexer, is supported from Seafile 12 and is the default-enabled 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.

Default enabled in Docker-based deployment

If your Seafile server deployed from Docker, you don't need to do the following change, due to the SeaSearch has been enabled by default.

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=

Enable SeaSearch in Seafile

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

  1. Get your authorization token by base64 code consist of INIT_SS_ADMIN_USER and INIT_SS_ADMIN_PASSWORD defined in the .env for deploying SeaSearch firsly, which is used to authorize when calling the SeaSearch API:

    echo -n 'username:password' | base64
    
    # example output
    YWRtaW46YWRtaW5fcGFzc3dvcmQ=
    
  2. Modify the following section in the .env for deploying Seafile (seafile-env.yaml for K8S and my-value.yaml for Helm)

    SeaSearch server deploy on a different machine with Seafile

    If your SeaSearch server deploy on a different machine with Seafile, please replace http://seasearch:4080 to the url <scheme>://<address>:<port> of your SeaSearch server

    ## for searching
    ENABLE_SEARCH=true
    SEARCH_ENGINE=seasearch
    
    # Index document contents for full-text search. Set to false to disable it (supported since 13.0 Pro).
    ENABLE_FULL_TEXT_SEARCH=true
    
    ### for seasearch
    SEASEARCH_URL=http://seasearch:4080
    SEASEARCH_TOKEN=<Your seasearch token>
    
  3. (Optional) Advanced options in seafevents.conf for SeaSearch calling in Seafile:

    [SEASEARCH]
    # Index sync interval
    interval = 10m
    
    # This setting is overridden by ENABLE_FULL_TEXT_SEARCH when it is set in .env.
    enable_full_text_search=true
    

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.