Bundling elasticsearch into an offline Electronjs application


We've been trying to bundle Elasticsearch into an offline Electron application without success.

Our goal is to provide offline full-text search functionality in an Electron app. We've used Elasticsearch extensively to build Nodejs API endpoints using elasticsearch.js and we love it! So wanted to port that code into the Electron app, which has a Nodejs API as part of the main process.

The approach we have been using is via bash script to try and download/configure Elasticsearch at runtime after the app initiates via the Electron process.

Some of the obstacles for us:

  • Downloading the correct binary version in a cross-platform way ( do we have curl/wget/a powershell tool ?)
  • Generating certificates for Elasticsearch (we need user input in some steps?)
  • Setting configurations like ports, users, mem usage, java settings, etc.
  • Gracefully handling crashes/restarts/memory from Electron

For our next attempt, we plan to try using Ansible for automating the setup and configuration of Elasticsearch. This step would hopefully include all the above...downloading the appropriate binaries and setting up configurations like ports, users, memory usage, and Java settings. Our aim here is to ensure a consistent setup across different platforms.

We haven't been able to find much documentation on this...or any :slight_smile: ...does anyone have any experience in this or can point me to docs?

Interested too if someone has a better approach in general for achieving offline search in a desktop application? Our queries are medium complex, we use proximity queries (Intervals) and Booleans, matching phrases to phrases…

Any help is greatly appreciated! We are stuck and need to either figure out a way to do this or pivot to trying a whole new search platform which we really do not want to do.

Thanks in advance! Joel.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.