Spotlight with Elasticsearch Backend

From SambaWiki
Revision as of 09:12, 19 March 2020 by Slowfranklin (talk | contribs) (Created page with "= Introduction = Using [https://www.elastic.co/products/elasticsearch Elasticsearch] as search engine, is the recommended setup for any deployment. = Installation = You hav...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

Using Elasticsearch as search engine, is the recommended setup for any deployment.

Installation

You have to install the following components:

Configuration

Elasticsearch

Elasticsearch doesn't need any specific configuration to work with Samba, once it's installed and up and running, you're ready to index your filesystems with fscrawler.

fscrawler

Please consult the fscrawler documentation to learn how to index your filesystems.

Samba

You have to set a few global options to tell Samba how to connect to Elasticsearch and you have to enable Spotlight on a per share basis.

   [global]
   spotlight backend = elasticsearch
   elasticsearch:address = localhost
   elasticsearch:port = 9200
   [share]
   ...
   spotlight = yes

See the smb.conf manpage for detailed explanation of all available parameters.

Testing

There's a handy commandline tool that works as Spotlight client: mdfind. See the manpage of mdfind for usage details.