Module: Supple

Extended by:
Bonfig
Defined in:
lib/supple.rb,
lib/supple/index.rb,
lib/supple/model.rb,
lib/supple/railtie.rb,
lib/supple/version.rb,
lib/supple/defaults.rb,
lib/supple/model/dsl.rb

Defined Under Namespace

Modules: DSL, Model, WithClient Classes: Config, Importer, Index, IndexConfig, ModelClient, Railtie

Constant Summary collapse

VERSION =

supple version

'0.1.0'
SETTINGS =
{
  number_of_shards: 1,
  number_of_replicas: 0,
  analysis: {
    analyzer: {
      word_start_ngram: {
        type: "custom",
        tokenizer: "word_start_ngram_tokenizer",
        filter: ["lowercase", "asciifolding"]
      },
      words: {
        type: "custom",
        tokenizer: "keyword",
        filter: ["lowercase", "asciifolding"]
      }
    },
    tokenizer: {
      word_start_ngram_tokenizer: {
        type: "edgeNGram",
        min_gram: 1,
        max_gram: 50,
        token_chars: ["letter"]
      }
    }
  }
}

Class Method Summary collapse

Class Method Details

.clientObject


30
31
32
# File 'lib/supple.rb', line 30

def self.client
  @client ||= Elasticsearch::Client.new(adapter: :patron)
end

.modelsObject


24
25
26
27
28
# File 'lib/supple.rb', line 24

def self.models
  ActiveRecord::Base.descendants.select do |m|
    m.included_modules.include?(Supple::Model)
  end
end