Class: LogMagic::SearchkickExplainer::SettingsExplainerSection
- Inherits:
-
Object
- Object
- LogMagic::SearchkickExplainer::SettingsExplainerSection
- Includes:
- JSONUtils, TemplatingUtils
- Defined in:
- lib/log_magic/explainers/searchkick/settings_explainer.rb
Instance Attribute Summary collapse
-
#elasticsearch_url ⇒ Object
readonly
Returns the value of attribute elasticsearch_url.
Instance Method Summary collapse
- #enriche_query_json ⇒ Object
- #explanation ⇒ Object
- #index_settings ⇒ Object
-
#initialize(elasticsearch_url, query_explainer) ⇒ SettingsExplainerSection
constructor
A new instance of SettingsExplainerSection.
- #template_name ⇒ Object
Methods included from JSONUtils
#parse_json, #pretty_print_json, #query_hash
Methods included from TemplatingUtils
#enriche, #match_regex, #rendered_template, #template_dir, #template_path
Constructor Details
#initialize(elasticsearch_url, query_explainer) ⇒ SettingsExplainerSection
Returns a new instance of SettingsExplainerSection.
6 7 8 9 10 |
# File 'lib/log_magic/explainers/searchkick/settings_explainer.rb', line 6 def initialize(elasticsearch_url, query_explainer) @query_explainer = query_explainer @elasticsearch_url = elasticsearch_url enriche_query_json end |
Instance Attribute Details
#elasticsearch_url ⇒ Object (readonly)
Returns the value of attribute elasticsearch_url.
4 5 6 |
# File 'lib/log_magic/explainers/searchkick/settings_explainer.rb', line 4 def elasticsearch_url @elasticsearch_url end |
Instance Method Details
#enriche_query_json ⇒ Object
24 25 26 27 |
# File 'lib/log_magic/explainers/searchkick/settings_explainer.rb', line 24 def enriche_query_json explainer = ::LogMagic::SearchkickExplainer::CustomAnalyzerHover.new(@query_explainer, index_settings) explainer.enriche end |
#explanation ⇒ Object
16 17 18 |
# File 'lib/log_magic/explainers/searchkick/settings_explainer.rb', line 16 def explanation rendered_template end |
#index_settings ⇒ Object
12 13 14 |
# File 'lib/log_magic/explainers/searchkick/settings_explainer.rb', line 12 def index_settings @index_settings ||= `curl #{elasticsearch_url}/_settings` end |
#template_name ⇒ Object
20 21 22 |
# File 'lib/log_magic/explainers/searchkick/settings_explainer.rb', line 20 def template_name 'settings.haml' end |