LuckySearch::Client
Inherits Habitat::SettingsHelpers < Habitat::TempConfig < Reference < Object
borrowed from Neuroplastic - thank you Place Labs
Constants
HABITAT_SETTINGS = [{decl: uri : URI | ::Nil = (Client.env_with_deprecation("ELASTIC_URI", "ES_URI")).try(&->URI.parse(String)), example: nil, validation: nil}, {decl: host : String = (Client.env_with_deprecation("ELASTIC_HOST", "ES_HOST")) || "127.0.0.1", example: nil, validation: nil}, {decl: port : Int32 = (Client.env_with_deprecation("ELASTIC_PORT", "ES_PORT")).try(&.to_i) || 9200, example: nil, validation: nil}, {decl: tls : Bool = (Client.env_with_deprecation("ELASTIC_TLS", "ES_TLS")) == "true", example: nil, validation: nil}, {decl: pooled : Bool = (Client.env_with_deprecation("ELASTIC_POOLED", "ES_POOLED")) == "true", example: nil, validation: nil}, {decl: pool_size : Int32 = (Client.env_with_deprecation("ELASTIC_CONN_POOL", "ES_CONN_POOL")).try(&.to_i) || NUM_INDICES, example: nil, validation: nil}, {decl: idle_pool_size : Int32 = (Client.env_with_deprecation("ELASTIC_IDLE_POOL", "ES_IDLE_POOL")).try(&.to_i) || (NUM_INDICES // 4), example: nil, validation: nil}, {decl: pool_timeout : Float64 = (Client.env_with_deprecation("ELASTIC_CONN_POOL_TIMEOUT", "ES_CONN_POOL_TIMEOUT")).try(&.to_f64) || 5.0, example: nil, validation: nil}] of Nil
NUM_INDICES = 10
Class methods
configure
Sourcesettings
SourceInstance methods
count(arguments = {} of Symbol => String)
Sourcecreate(index, body)
Sourcecreate_index(index, body)
Sourcedelete(index, id)
Sourcedelete_index(index)
Sourceempty_indices(indices : Array(String) | Nil = nil)
Sourceexists?(index, id) : Bool
Sourceget(index, id)
Sourceindex_exists?(index) : Bool
Sourceperform_request(method, path, params = nil, body = nil) : JSON::Any
Sourceperform_request_bool(method, path, params = nil, body = nil) : Bool
Sourcerefresh(index)
Sourcesearch(arguments = {} of Symbol => String) : JSON::Any
Sourcesettings
Sourceupdate(index, id, body)
Source