How can I make elastic search as light weight as possible?

I am trying to use elastic search in an electron desktop app that needs to index maybe 15mb of documents and search them. However since this would be running on a local user's computer I was wondering how can I make elastic as light weight as needed? I can change the JVM memory settings but I'm not really sure what the implications of that are.

Another question is how can I identify exactly which files from the elastic download zip are needed and delete the ones that are not.

Finally is it possible to use something like javapackager (https://docs.oracle.com/javase/9/tools/javapackager.htm#JSWOR719) to package only the parts of the JVM that are needed to run elastic?

Hi @surlysmiles ,

If your needs are only store few mb of data and use the less memory and resources elasticsearch is not the best solution.
But if you really want the same search than elastic you can use directly lucene or any fork in your favorite language.

http://clucene.sourceforge.net/
http://lucenenet.apache.org

Thanks for replying! I've looked at these options actually and am still investigating - but the difficulty I think comes in interacting with a pure java library through node - which is what I would need to do if using electron. The architecture for using elastic make implementation much simpler as the API would simply be HTTP requests to a local server. If I used lucene then I think I would have to write my own layer to manage communication.

Another reason I was thinking of elastic search was we are already providing search for our corpus through a web site that would unify the maintainability of our search implementation.

But do you think it's viable for elastic to be a local search agent for the average desktop? It would be used maybe for a few queries a minute on a very small corpus compared to most of elastic search's use cases so my current ideas were that I could:

  1. set JVM settings to run with 256mb
  2. remove all unused plugins and docs
  3. ship with a JRE

And this would make the total download size and memory usage proportional to this use case.

Does this make sense? Or would you still recommend going with something else.

Hi @surlysmiles

For me this reason is not good, if you run a truck company, it not make sense to always drive truck to unify your transport experience... maybe this example is not good but it's better to adapt the tools to the solution that you build. And it's also an anti-pattern something like this: https://en.wikipedia.org/wiki/Database-as-IPC

You can check about the atom project that use electron and have a search system, maybe asking there can be more efficient. There's certainly some battery included that allow you to have a good search experience with adapted tool for electron.

If you really want to use elastic you can also check about some discussion on installing elastic on raspberry pie, it can help you for the configuration to make it run with limited memory (point 1).

Here:


Also need to think that elastic need time to start but maybe with few data it can be fast.
And maybe use the OSS version can be better as there's less battery included so it may use less resources (need to try).