For the complete documentation index, see llms.txt. This page is also available as Markdown.

Add documents from the CLI

The shortest path from an empty project to searchable documents on a server install.

This document assumes that you have installed Datashare in server mode within Docker.

In server mode, Datashare has no web interface to add documents. Documents are added from the command line.

Here is the shortest command that scans a directory and indexes its files:

docker compose exec datashare /entrypoint.sh \
  stage run \
  --stages SCAN,INDEX \
  --defaultProject secret-project \
  --elasticsearchAddress http://elasticsearch:9200 \
  --dataDir /home/datashare/Datashare/

What is happening:

  • Datashare runs the SCAN and INDEX stages together, SCAN filling a queue with the files it finds and INDEX draining it.

  • Files are read from /home/datashare/Datashare/, which is a directory mounted from the host machine, so this is the path inside the container.

  • Extracted documents are written to the secret-project index in Elasticsearch.

Once the command exits, your documents are searchable.

Next steps

  • Indexing: the full guide to indexing on a server.

    • Scenarios: incremental updates, resuming, distributing across machines, mail archives.

    • Options: every command-line flag, environment variable and settings key.

    • Tuning: parallelism, OCR, memory and Elasticsearch.

    • Troubleshooting: what the errors mean.

  • Add entities from the CLI: extract people, organizations and locations from documents you have indexed.

Last updated