Provides a bare-bones HTTP client that doesn’t have any Elasticsearch-specific api methods, but knows how to discover and connect to multiple servers, rotate connections, and log things.
Provides a module that adds elasticsearch-specific methods such as
index to a generic HTTP client. Can be included in any class that implements method
perform_request which returns an object responding to
All it does is it takes an HTTP client from elasticsearch-transport and includes the
Elasticsearch::API module into it from elasticsearch-api, providing a more convenient client as a result.
Provides a tire-like syntax for defining queries. The resulting query object is useless on its own, but it supports
to_hash, and therefore can easily be fed into any HTTP client by encoding Hash as JSON. If you feed this object to the client from elasticsearch-transport, it will be automatically dumped as JSON using the default MultiJson serializer.
Elasticsearch::API with an extra method
watcher, which in turn provides methods specific for the Watcher plugin, such as
get_watch, and others.
Adds contributor-friendly features like terminal colorizers and formatters for Elasticsearch responses, cluster start/stop for testing, and profiling features for testing.
This gem contains various modules to be included into models. It does nothing without explicit includes.
This module is useless on its own. It adds
__elasticsearch__ method to a model at class and instance levels, which is supposed to isolate all elasticsearch functionality underneath it. However, the proxy object is actually empty, it has no methods, and it expects that all other modules will be manually included into it.
client to the model at both class and instance level. Default client comes from elasticsearch-transport.
document_type to the model at both class and instance level. Defaults are inferred from the model name.
Adds class methods
refresh_index! which can be used to define and manage field mappings. Index methods would implicitly use the previously defined mapping, as well as implicitly inferred index/document_type names. The module also adds instance methods
delete_document that depend on model having
id to work.
Adds class level
search method that accepts a to_hash-compatible object, delegates to the
search method on the client. By default the client is coming from elasticsearch-transport.
Adds an instance method
as_indexed_json to a model, which by default delegates to
as_json with option
module source/docs: elasticsearch-rails/elasticsearch-model/lib/elasticsearch/model/serializing.rb
Provides class-level method
import allowing batches of records to be efficiently imported into Elasticsearch. This module automatically adapts for ActiveRecord and Mongoid.
module source/docs: elasticsearch-rails/elasticsearch-model/lib/elasticsearch/model/importing.rb
When included, this module does 3 things.
__elasticsearch__proxy object, namely
module source/docs: elasticsearch-rails/elasticsearch-model/lib/elasticsearch/model.rb
Adds callbacks that sync model and Elasticsearch representation on create/update/delete. The callbacks are blocking, if the syncing must be asynchronous it’s suggested to implement your own callbacks, and not use this module. This module automatically adapts for ActiveRecord and Mongoid.
module source/docs: elasticsearch-rails/elasticsearch-model/lib/elasticsearch/model/callbacks.rb
Provides a way to build models backed by Elasticsearch database, similar to ActiveRecord models being backed by SQL database. Additionally, provides a way of using Repository pattern to the same effect.
Provides rake tasks for importing data from Rails models into Elasticsearch, as well as instrumentation for displaying search requests and their stats in logs. Includes special support for Lograge. Both rake tasks and instrumentation features must be manually required to function (no railtie support). Comes with multiple Rails application templates which allow the user to generate example applications locally, starting from a very simple integration, to a full-blown Elasticsearc-powered application, to demonstrate the gem capabilities and common usage patterns.