Module: Lycra

Includes:
Canfig::Module
Defined in:
lib/lycra.rb,
lib/lycra/types.rb,
lib/lycra/engine.rb,
lib/lycra/errors.rb,
lib/lycra/import.rb,
lib/lycra/search.rb,
lib/lycra/version.rb,
lib/lycra/document.rb,
lib/lycra/multidoc.rb,
lib/lycra/decorator.rb,
lib/lycra/attributes.rb,
lib/lycra/serializer.rb,
lib/lycra/inheritance.rb,
lib/lycra/search/sort.rb,
lib/lycra/search/query.rb,
lib/lycra/document/model.rb,
lib/lycra/document/proxy.rb,
lib/lycra/search/filters.rb,
lib/lycra/search/scoping.rb,
lib/lycra/decorator/model.rb,
lib/lycra/serializer/model.rb,
lib/lycra/document/registry.rb,
lib/lycra/search/enumerable.rb,
lib/lycra/search/pagination.rb,
lib/lycra/search/aggregations.rb,
lib/lycra/attributes/attribute.rb,
lib/lycra/attributes/collection.rb

Defined Under Namespace

Modules: Attributes, Decorator, Document, Inheritance, Search, Serializer, Types, Version Classes: AbstractClassError, AttributeError, DocumentNotFoundError, Engine, Import, MissingSubjectError, Multidoc, UndefinedIndexError

Class Method Summary collapse

Class Method Details

.clientObject



45
46
47
48
49
50
51
52
53
# File 'lib/lycra.rb', line 45

def self.client
  @client ||= ::Elasticsearch::Client.new(
    host: configuration.elasticsearch_url,
    log: configuration.log,
    logger: configuration.logger,
    trace: configuration.trace,
    tracer: configuration.tracer
  )
end

.search(query_or_payload, models = [], options = {}) ⇒ Object



55
56
57
58
59
# File 'lib/lycra.rb', line 55

def self.search(query_or_payload, models=[], options={})
  models = Multidoc.new(models)
  request = Elasticsearch::Model::Searching::SearchRequest.new(models, query_or_payload, options)
  Elasticsearch::Model::Response::Response.new(models, request)
end