Sketch application for integrating Elixir and Elasticsearch using the elasticsearch library.
Some of the features implemented here:
- a singe Genserver to take care of the ES index. We do not want to overload the cluster to get out of Java Heap Space
- a stream implementation to load all the documents to be sent to index
- a search DSL to do not expose the Elasticserach query syntax. It's easier to use and easier to upgrade to later versions of Elasticsearch in case changes are made.
Indexing can be done either by hot swap-ing the whole cluster:
ElixirElasticsearch.IndexerGenserver.hot_swap()
either by sending a list of documents to index:
ElixirElasticsearch.IndexerGenserver.index_restaurant("demorestaurant")
Searching can be done by calling the search wrapper module:
ElixirElasticsearch.SearchGateway.search(query)