Configuration
This class is also aliased as Elastics::Conf
.
You can configure the elastics gems by changing their configuration settings. You can set them directly in any part of your code or the console like:
Elastics::Configuration.logger.debug_result = true
or setting them inside a Elastics::Configuration.configure
block:
Elastics::Configuration.configure do |conf|
conf.http_client.base_uri = 'http://localhost:9222'
conf.http_client.options = {:timeout => 10}
conf.variables[:index] = 'my_index'
...
end
If you use the rails integration, you usually do so in an initializer, usually generated by the elastics:setup
generator (see elastics-rails).
Settings
result_extenders
|
An array of extender modules. Each gem pushes its default:
You usually push your own extenders to the |
ansi
|
Boolean. If |
logger
|
The Elastics logger. Default |
logger.debug_variables
|
Boolean. If |
logger.debug_request
|
Boolean. If |
logger.debug_result
|
Boolean. If |
logger.curl_format
|
Boolean. If |
logger.log_to_rails_logger
|
Boolean. If |
logger.log_to_stdout
|
Boolean. Option added by |
elastics_models
|
An array of model classes (or model class names) that your app will index. This is the only required configuration setting if you use the |
elastics_active_models
|
An array of ActiveModel classes (or model class names) that your app defines. This is the only required configuration setting if you use the |
elastics_dir
|
The path where Elastics searches for source files. Default |
config_file
|
A YAML file usually containing the custom index mapping. Default |
http_client
|
The HTTP client instance. Default an object of class
|
http_client.base_uri
|
The base uri of the elasticsearch server used for all the requests. Default |
http_client.options
|
Hash of options passed to the |
http_client.raise_proc
|
A proc that should return whether or not to raise an error, depending on the response. It is used for example to decide whether a 404 response code should raise an error or should just be ignored. Default |
variables
|
The
(see Variables) |
app_id
|
An unique string used to identify your app. Default: |
optimize_indexing
|
Boolean. Option added by |
redis
|
The redis client object. Default: |
on_stop_indexing
|
A proc that should ensure to stop/suspend all the actions that would produce any change in the indices being live-reindexed. Used by the live-reindex feature and overridden by the |