New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ElasticSearch 5.0? #454

Closed
aselder opened this Issue Oct 27, 2016 · 24 comments

Comments

Projects
None yet
@aselder

aselder commented Oct 27, 2016

I'm taking a guess that Chewy won't work with ES 5.0, based on the deprecation lists I saw in the ES5 doc.

Is there a timeframe for ES 5.0 support and is there anything I can do to help get it done?

@asabourin

This comment has been minimized.

Show comment
Hide comment
@asabourin

asabourin Oct 30, 2016

👍 to this, would love to see Chewy supporting ES 5!

asabourin commented Oct 30, 2016

👍 to this, would love to see Chewy supporting ES 5!

@pyromaniac

This comment has been minimized.

Show comment
Hide comment
@pyromaniac

pyromaniac Oct 31, 2016

Member

Hey! Thanks guys for your attention to this problem. The main issue is actually in query class, which will be incompatible because of those deprications. We've got plans on Query2 class implementation which will do basically the same as the first one but being compatible with modern ES. But we also want to improve query API to make it more convenient for usage. So have no idea when it will happen (we have other stuff to do you know), sorry for this.

So if you want to use Chewy with ES 5 - it probably will work, but you will have to use elasticsearch-ruby DSL to perform queries you need. Also, to make it work it makes sense to run the test suite on ES 5 and look what's broken except the Query and maybe try to fix it.

Member

pyromaniac commented Oct 31, 2016

Hey! Thanks guys for your attention to this problem. The main issue is actually in query class, which will be incompatible because of those deprications. We've got plans on Query2 class implementation which will do basically the same as the first one but being compatible with modern ES. But we also want to improve query API to make it more convenient for usage. So have no idea when it will happen (we have other stuff to do you know), sorry for this.

So if you want to use Chewy with ES 5 - it probably will work, but you will have to use elasticsearch-ruby DSL to perform queries you need. Also, to make it work it makes sense to run the test suite on ES 5 and look what's broken except the Query and maybe try to fix it.

@aselder

This comment has been minimized.

Show comment
Hide comment
@aselder

aselder Oct 31, 2016

I'll try and run the test suite against ES see if I can get a list of what breaks.

aselder commented Oct 31, 2016

I'll try and run the test suite against ES see if I can get a list of what breaks.

@dmitry

This comment has been minimized.

Show comment
Hide comment
@dmitry
Contributor

dmitry commented Oct 31, 2016

@olleolleolle

This comment has been minimized.

Show comment
Hide comment
@olleolleolle

olleolleolle Nov 1, 2016

Contributor

I blogged a little bit about how to stay on Elasticsearch 2.4 using Homebrew.

http://ollehost.dk/blog/2016/11/01/hold-elasticsearch-back-on-2-4-for-chewy-on-macos/

Contributor

olleolleolle commented Nov 1, 2016

I blogged a little bit about how to stay on Elasticsearch 2.4 using Homebrew.

http://ollehost.dk/blog/2016/11/01/hold-elasticsearch-back-on-2-4-for-chewy-on-macos/

@syntaxTerr0r

This comment has been minimized.

Show comment
Hide comment
@syntaxTerr0r

syntaxTerr0r Jan 13, 2017

Just implemented chewy against ES 5.1.1, everything works fine according to ES documentation.

syntaxTerr0r commented Jan 13, 2017

Just implemented chewy against ES 5.1.1, everything works fine according to ES documentation.

@pyromaniac

This comment has been minimized.

Show comment
Hide comment
@pyromaniac

pyromaniac Jan 14, 2017

Member

Nice, can you share recipes? Also, I'm working on the new DSL and complete ES 5.0 support currently.

Member

pyromaniac commented Jan 14, 2017

Nice, can you share recipes? Also, I'm working on the new DSL and complete ES 5.0 support currently.

@syntaxTerr0r

This comment has been minimized.

Show comment
Hide comment
@syntaxTerr0r

syntaxTerr0r Jan 17, 2017

According to README, I found more working features than broken features.

To me, features that do not work with ElasticSearch 5.1.1 are:

  • .filter and its DSL (returns no result or ES errors)
  • .only do not map the requested key(s) (full documents are returned instead)
  • .facets looks deprecated in ES 5.1.1
  • Sometimes, a default strategy is missing during ActiveJob/Sidekiq jobs' execution, I had to create a Sidekiq server middleware for this. (The active_job strategy is fine, it's about executing my own jobs that update data & ES indexes)

Things that I have not tested:

  • .witchcraft! feature
  • Crutches feature
  • Geo Point fields

Any advices will be appreciated ^0^
Hope it will help, thanks for Chewy y'all!

Here is my Search index, I suppose it can be optimized, but as I said, I'm a real newbie at ES.

class SearchIndex < Chewy::Index
  settings analysis: {
    analyzer: {
      lowercase: {
        tokenizer: 'lowercase',
        filter: %w(custom_ascii_folding)
      },
      ngram_analyzer: {
        tokenizer: 'ngram_tokenizer',
        filter: %w(lowercase custom_ascii_folding)
      }
    },
    tokenizer: {
      ngram_tokenizer: {
        type: 'ngram',
        min_gram: 3,
        max_gram: 4,
        token_chars: %w(letter digit)
      }
    },
    filter: {
      custom_ascii_folding: {
        type: 'asciifolding',
        preserve_original: true
      }
    }
  }

  define_type Address do
    field :label, analyzer: 'ngram_analyzer'
    field :address, analyzer: 'lowercase'
    field :first_name, analyzer: 'lowercase'
    field :last_name, analyzer: 'lowercase'
    field :company_name, analyzer: 'ngram_analyzer'
    field :kind, type: 'keyword'
    field :email, type: 'keyword'
    field :phone, type: 'keyword', value: ->(address) { address.unformatted_phone }
    field :postcode, type: 'keyword'
    field :city, type: 'keyword'
    field :country, type: 'keyword'
    field :created_at, type: 'date'
    field :updated_at, type: 'date'
  end

  define_type Carrier, delete_if: :deleted_at do
    field :id, type: 'keyword'
    field :short_id, type: 'keyword', value: ->(carrier) { carrier.short_id }
    field :zones, :enabled
    field :name, analyzer: 'ngram_analyzer'
    field :kind, type: 'keyword'
    field :email, type: 'keyword'
    field :phone, type: 'keyword', value: ->(carrier) { carrier.unformatted_phone }
    field :postcode, type: 'keyword'
    field :city, type: 'keyword'
    field :country, type: 'keyword'
    field :dispatch_method, type: 'keyword'
    field :siret_number, type: 'keyword'
    field :vat_number, type: 'keyword'
    field :created_at, type: 'date'
    field :updated_at, type: 'date'
  end

  define_type Company, delete_if: :deleted_at do
    field :id, type: 'keyword'
    field :short_id, type: 'keyword', value: ->(company) { company.short_id }
    field :enabled
    field :name, analyzer: 'ngram_analyzer'
    field :postcode, type: 'keyword'
    field :city, type: 'keyword'
    field :country, type: 'keyword'
    field :typology, type: 'keyword'
    field :siret_number, type: 'keyword'
    field :vat_number, type: 'keyword'
    field :created_at, type: 'date'
    field :updated_at, type: 'date'
  end

  define_type User do
    field :id, type: 'keyword'
    field :short_id, type: 'keyword', value: ->(user) { user.short_id }
    field :first_name, analyzer: 'lowercase'
    field :last_name, analyzer: 'lowercase'
    field :kind, type: 'keyword'
    field :email, type: 'keyword'
    field :phone, type: 'keyword', value: ->(user) { user.unformatted_phone }
    field :created_at, type: 'date'
    field :updated_at, type: 'date'
  end

  define_type Warehouse, delete_if: :deleted_at do
    field :zones, :enabled
    field :id, type: 'keyword'
    field :short_id, type: 'keyword', value: ->(warehouse) { warehouse.short_id }
    field :name, analyzer: 'ngram_analyzer'
    field :email, type: 'keyword'
    field :phone, type: 'keyword', value: ->(warehouse) { warehouse.unformatted_phone }
    field :postcode, type: 'keyword'
    field :city, type: 'keyword'
    field :country, type: 'keyword'
    field :created_at, type: 'date'
    field :updated_at, type: 'date'
  end

  define_type Mission.includes(:owner, :accepted_carrier, :places, :stages), delete_if: :deleted_at do
    field :id, type: 'keyword'
    field :external_id, type: 'keyword'
    field :short_id, type: 'keyword', value: ->(mission) { mission.short_id }
    field :status, type: 'keyword'
    field :priority, type: 'keyword'
    field :vehicle, type: 'keyword'

    field :places do
      field :comment, analyzer: 'lowercase'
      field :first_name, analyzer: 'lowercase'
      field :last_name, analyzer: 'lowercase'
      field :company_name, analyzer: 'lowercase'
      field :full_street_address, value: ->(place) { place.full_street_address }, analyzer: 'lowercase'
      field :email, type: 'keyword'
      field :phone, type: 'keyword', value: ->(place) { place.unformatted_phone }
      field :postcode, type: 'keyword'
      field :city, type: 'keyword'
      field :country, type: 'keyword'
    end
    field :stages do
      field :signatory, analyzer: 'ngram_analyzer'
    end
    field :owner do
      field :id, type: 'keyword'
      field :name, analyzer: 'ngram_analyzer'
    end
    field :carrier, value: ->(mission) { mission.accepted_carrier } do
      field :name, analyzer: 'ngram_analyzer'
    end
    field :price, type: 'float'
    field :discount, type: 'float'
    field :penalty, type: 'float'
    field :start_at, type: 'date'
    field :end_at, type: 'date'
    field :created_at, type: 'date'
    field :updated_at, type: 'date'
    field :activated_at, type: 'date'
    field :archived_at, type: 'date'
  end
end

And here is my Search tool class:

class Search
  INDEXABLE_MODELS = %w(Address Carrier Company User Warehouse).freeze
  EXPIRABLE_MODELS = %w(Mission).freeze

  class << self
    def for(model, keywords: nil, filters: nil, only: nil, order: { created_at: :desc }, page: 1, per_page: Kaminari.config.default_per_page)
      index = search_index(model.name)
      # "multi_match" query for keywords search
      index = index.query(multi_match: { query: keywords, fields: model::FINDS, operator: 'AND' }) if keywords.present?

      if filters.is_a?(Hash)
        # convert hash like { 'key1' => 'value1', 'sub/key2' => 'value2'} to
        # ElasticSearch term query [{ term: { 'key1' => 'value1' }}, { term: { 'sub.key2' => 'value2' }}]
        filters = filters.map { |k, v| [k.gsub('/', '.'), v] }.to_h.map { |term| { term: [term].to_h} }

        # Bool query for filters search
        index = index.query(bool: { must: filters })
      end

      index = index.order(order).per(per_page).page(page)

      if only.is_a?(Symbol)
        index.only(only).map(&only) # chewy .only method do not seems to work yet :(
      else
        index.load
      end
    end

    def rebuild_indexes!
      SearchIndex.purge!
      rebuild_permanent_indexes
      rebuild_expirable_indexes
      true
    end

    private

    def rebuild_permanent_indexes
      INDEXABLE_MODELS.each do |model|
        index = search_index(model)
        index.import
      end
    end

    def rebuild_expirable_indexes
      EXPIRABLE_MODELS.each do |model|
        index = search_index(model)
        index.import model.safe_constantize.where('created_at >= (?)', Settings.search.keep_during.to_i.days.ago)
      end
    end

    def search_index(model_name)
      "SearchIndex::#{model_name}".safe_constantize
    end
  end
end

My Sidekiq server middleware workaround:

class SidekiqChewyServerMiddleware
  def call(worker, job, queue)
    if defined?(::Chewy)
      Chewy.strategy(:atomic) do
        yield
      end
    else
      yield
    end
  end
end

# in config/initializers/sidekiq.rb
Sidekiq.configure_server do |config|
  config.server_middleware do |chain|
    chain.add SidekiqChewyServerMiddleware
  end
end

And here is my ES node stats after indexing:

$ curl 'localhost:9200/_stats?pretty=1'
{
  "_shards" : {
    "total" : 10,
    "successful" : 5,
    "failed" : 0
  },
  "_all" : {
    "primaries" : {
      "docs" : {
        "count" : 138201,
        "deleted" : 18
      },
      "store" : {
        "size_in_bytes" : 196723104,
        "throttle_time_in_millis" : 0
      },
      "indexing" : {
        "index_total" : 138273,
        "index_time_in_millis" : 44104,
        "index_current" : 0,
        "index_failed" : 0,
        "delete_total" : 0,
        "delete_time_in_millis" : 0,
        "delete_current" : 0,
        "noop_update_total" : 0,
        "is_throttled" : false,
        "throttle_time_in_millis" : 0
      },
      "get" : {
        "total" : 0,
        "time_in_millis" : 0,
        "exists_total" : 0,
        "exists_time_in_millis" : 0,
        "missing_total" : 0,
        "missing_time_in_millis" : 0,
        "current" : 0
      },
      "search" : {
        "open_contexts" : 0,
        "query_total" : 310,
        "query_time_in_millis" : 1175,
        "query_current" : 0,
        "fetch_total" : 196,
        "fetch_time_in_millis" : 8514,
        "fetch_current" : 0,
        "scroll_total" : 0,
        "scroll_time_in_millis" : 0,
        "scroll_current" : 0,
        "suggest_total" : 0,
        "suggest_time_in_millis" : 0,
        "suggest_current" : 0
      },
      "merges" : {
        "current" : 0,
        "current_docs" : 0,
        "current_size_in_bytes" : 0,
        "total" : 83,
        "total_time_in_millis" : 49707,
        "total_docs" : 446803,
        "total_size_in_bytes" : 711248905,
        "total_stopped_time_in_millis" : 0,
        "total_throttled_time_in_millis" : 0,
        "total_auto_throttle_in_bytes" : 104857600
      },
      "refresh" : {
        "total" : 977,
        "total_time_in_millis" : 19756
      },
      "flush" : {
        "total" : 7,
        "total_time_in_millis" : 199
      },
      "warmer" : {
        "current" : 0,
        "total" : 979,
        "total_time_in_millis" : 339
      },
      "query_cache" : {
        "memory_size_in_bytes" : 0,
        "total_count" : 2393,
        "hit_count" : 0,
        "miss_count" : 2393,
        "cache_size" : 0,
        "cache_count" : 0,
        "evictions" : 0
      },
      "fielddata" : {
        "memory_size_in_bytes" : 0,
        "evictions" : 0
      },
      "completion" : {
        "size_in_bytes" : 0
      },
      "segments" : {
        "count" : 43,
        "memory_in_bytes" : 1191926,
        "terms_memory_in_bytes" : 854090,
        "stored_fields_memory_in_bytes" : 44768,
        "term_vectors_memory_in_bytes" : 0,
        "norms_memory_in_bytes" : 29120,
        "points_memory_in_bytes" : 21960,
        "doc_values_memory_in_bytes" : 241988,
        "index_writer_memory_in_bytes" : 0,
        "version_map_memory_in_bytes" : 0,
        "fixed_bit_set_memory_in_bytes" : 0,
        "max_unsafe_auto_id_timestamp" : -1,
        "file_sizes" : { }
      },
      "translog" : {
        "operations" : 27650,
        "size_in_bytes" : 37138433
      },
      "request_cache" : {
        "memory_size_in_bytes" : 0,
        "evictions" : 0,
        "hit_count" : 0,
        "miss_count" : 0
      },
      "recovery" : {
        "current_as_source" : 0,
        "current_as_target" : 0,
        "throttle_time_in_millis" : 0
      }
    },
    "total" : {
      "docs" : {
        "count" : 138201,
        "deleted" : 18
      },
      "store" : {
        "size_in_bytes" : 196723104,
        "throttle_time_in_millis" : 0
      },
      "indexing" : {
        "index_total" : 138273,
        "index_time_in_millis" : 44104,
        "index_current" : 0,
        "index_failed" : 0,
        "delete_total" : 0,
        "delete_time_in_millis" : 0,
        "delete_current" : 0,
        "noop_update_total" : 0,
        "is_throttled" : false,
        "throttle_time_in_millis" : 0
      },
      "get" : {
        "total" : 0,
        "time_in_millis" : 0,
        "exists_total" : 0,
        "exists_time_in_millis" : 0,
        "missing_total" : 0,
        "missing_time_in_millis" : 0,
        "current" : 0
      },
      "search" : {
        "open_contexts" : 0,
        "query_total" : 310,
        "query_time_in_millis" : 1175,
        "query_current" : 0,
        "fetch_total" : 196,
        "fetch_time_in_millis" : 8514,
        "fetch_current" : 0,
        "scroll_total" : 0,
        "scroll_time_in_millis" : 0,
        "scroll_current" : 0,
        "suggest_total" : 0,
        "suggest_time_in_millis" : 0,
        "suggest_current" : 0
      },
      "merges" : {
        "current" : 0,
        "current_docs" : 0,
        "current_size_in_bytes" : 0,
        "total" : 83,
        "total_time_in_millis" : 49707,
        "total_docs" : 446803,
        "total_size_in_bytes" : 711248905,
        "total_stopped_time_in_millis" : 0,
        "total_throttled_time_in_millis" : 0,
        "total_auto_throttle_in_bytes" : 104857600
      },
      "refresh" : {
        "total" : 977,
        "total_time_in_millis" : 19756
      },
      "flush" : {
        "total" : 7,
        "total_time_in_millis" : 199
      },
      "warmer" : {
        "current" : 0,
        "total" : 979,
        "total_time_in_millis" : 339
      },
      "query_cache" : {
        "memory_size_in_bytes" : 0,
        "total_count" : 2393,
        "hit_count" : 0,
        "miss_count" : 2393,
        "cache_size" : 0,
        "cache_count" : 0,
        "evictions" : 0
      },
      "fielddata" : {
        "memory_size_in_bytes" : 0,
        "evictions" : 0
      },
      "completion" : {
        "size_in_bytes" : 0
      },
      "segments" : {
        "count" : 43,
        "memory_in_bytes" : 1191926,
        "terms_memory_in_bytes" : 854090,
        "stored_fields_memory_in_bytes" : 44768,
        "term_vectors_memory_in_bytes" : 0,
        "norms_memory_in_bytes" : 29120,
        "points_memory_in_bytes" : 21960,
        "doc_values_memory_in_bytes" : 241988,
        "index_writer_memory_in_bytes" : 0,
        "version_map_memory_in_bytes" : 0,
        "fixed_bit_set_memory_in_bytes" : 0,
        "max_unsafe_auto_id_timestamp" : -1,
        "file_sizes" : { }
      },
      "translog" : {
        "operations" : 27650,
        "size_in_bytes" : 37138433
      },
      "request_cache" : {
        "memory_size_in_bytes" : 0,
        "evictions" : 0,
        "hit_count" : 0,
        "miss_count" : 0
      },
      "recovery" : {
        "current_as_source" : 0,
        "current_as_target" : 0,
        "throttle_time_in_millis" : 0
      }
    }
  },
  "indices" : {
    "production_search" : {
      "primaries" : {
        "docs" : {
          "count" : 138201,
          "deleted" : 18
        },
        "store" : {
          "size_in_bytes" : 196723104,
          "throttle_time_in_millis" : 0
        },
        "indexing" : {
          "index_total" : 138273,
          "index_time_in_millis" : 44104,
          "index_current" : 0,
          "index_failed" : 0,
          "delete_total" : 0,
          "delete_time_in_millis" : 0,
          "delete_current" : 0,
          "noop_update_total" : 0,
          "is_throttled" : false,
          "throttle_time_in_millis" : 0
        },
        "get" : {
          "total" : 0,
          "time_in_millis" : 0,
          "exists_total" : 0,
          "exists_time_in_millis" : 0,
          "missing_total" : 0,
          "missing_time_in_millis" : 0,
          "current" : 0
        },
        "search" : {
          "open_contexts" : 0,
          "query_total" : 310,
          "query_time_in_millis" : 1175,
          "query_current" : 0,
          "fetch_total" : 196,
          "fetch_time_in_millis" : 8514,
          "fetch_current" : 0,
          "scroll_total" : 0,
          "scroll_time_in_millis" : 0,
          "scroll_current" : 0,
          "suggest_total" : 0,
          "suggest_time_in_millis" : 0,
          "suggest_current" : 0
        },
        "merges" : {
          "current" : 0,
          "current_docs" : 0,
          "current_size_in_bytes" : 0,
          "total" : 83,
          "total_time_in_millis" : 49707,
          "total_docs" : 446803,
          "total_size_in_bytes" : 711248905,
          "total_stopped_time_in_millis" : 0,
          "total_throttled_time_in_millis" : 0,
          "total_auto_throttle_in_bytes" : 104857600
        },
        "refresh" : {
          "total" : 977,
          "total_time_in_millis" : 19756
        },
        "flush" : {
          "total" : 7,
          "total_time_in_millis" : 199
        },
        "warmer" : {
          "current" : 0,
          "total" : 979,
          "total_time_in_millis" : 339
        },
        "query_cache" : {
          "memory_size_in_bytes" : 0,
          "total_count" : 2393,
          "hit_count" : 0,
          "miss_count" : 2393,
          "cache_size" : 0,
          "cache_count" : 0,
          "evictions" : 0
        },
        "fielddata" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0
        },
        "completion" : {
          "size_in_bytes" : 0
        },
        "segments" : {
          "count" : 43,
          "memory_in_bytes" : 1191926,
          "terms_memory_in_bytes" : 854090,
          "stored_fields_memory_in_bytes" : 44768,
          "term_vectors_memory_in_bytes" : 0,
          "norms_memory_in_bytes" : 29120,
          "points_memory_in_bytes" : 21960,
          "doc_values_memory_in_bytes" : 241988,
          "index_writer_memory_in_bytes" : 0,
          "version_map_memory_in_bytes" : 0,
          "fixed_bit_set_memory_in_bytes" : 0,
          "max_unsafe_auto_id_timestamp" : -1,
          "file_sizes" : { }
        },
        "translog" : {
          "operations" : 27650,
          "size_in_bytes" : 37138433
        },
        "request_cache" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0,
          "hit_count" : 0,
          "miss_count" : 0
        },
        "recovery" : {
          "current_as_source" : 0,
          "current_as_target" : 0,
          "throttle_time_in_millis" : 0
        }
      },
      "total" : {
        "docs" : {
          "count" : 138201,
          "deleted" : 18
        },
        "store" : {
          "size_in_bytes" : 196723104,
          "throttle_time_in_millis" : 0
        },
        "indexing" : {
          "index_total" : 138273,
          "index_time_in_millis" : 44104,
          "index_current" : 0,
          "index_failed" : 0,
          "delete_total" : 0,
          "delete_time_in_millis" : 0,
          "delete_current" : 0,
          "noop_update_total" : 0,
          "is_throttled" : false,
          "throttle_time_in_millis" : 0
        },
        "get" : {
          "total" : 0,
          "time_in_millis" : 0,
          "exists_total" : 0,
          "exists_time_in_millis" : 0,
          "missing_total" : 0,
          "missing_time_in_millis" : 0,
          "current" : 0
        },
        "search" : {
          "open_contexts" : 0,
          "query_total" : 310,
          "query_time_in_millis" : 1175,
          "query_current" : 0,
          "fetch_total" : 196,
          "fetch_time_in_millis" : 8514,
          "fetch_current" : 0,
          "scroll_total" : 0,
          "scroll_time_in_millis" : 0,
          "scroll_current" : 0,
          "suggest_total" : 0,
          "suggest_time_in_millis" : 0,
          "suggest_current" : 0
        },
        "merges" : {
          "current" : 0,
          "current_docs" : 0,
          "current_size_in_bytes" : 0,
          "total" : 83,
          "total_time_in_millis" : 49707,
          "total_docs" : 446803,
          "total_size_in_bytes" : 711248905,
          "total_stopped_time_in_millis" : 0,
          "total_throttled_time_in_millis" : 0,
          "total_auto_throttle_in_bytes" : 104857600
        },
        "refresh" : {
          "total" : 977,
          "total_time_in_millis" : 19756
        },
        "flush" : {
          "total" : 7,
          "total_time_in_millis" : 199
        },
        "warmer" : {
          "current" : 0,
          "total" : 979,
          "total_time_in_millis" : 339
        },
        "query_cache" : {
          "memory_size_in_bytes" : 0,
          "total_count" : 2393,
          "hit_count" : 0,
          "miss_count" : 2393,
          "cache_size" : 0,
          "cache_count" : 0,
          "evictions" : 0
        },
        "fielddata" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0
        },
        "completion" : {
          "size_in_bytes" : 0
        },
        "segments" : {
          "count" : 43,
          "memory_in_bytes" : 1191926,
          "terms_memory_in_bytes" : 854090,
          "stored_fields_memory_in_bytes" : 44768,
          "term_vectors_memory_in_bytes" : 0,
          "norms_memory_in_bytes" : 29120,
          "points_memory_in_bytes" : 21960,
          "doc_values_memory_in_bytes" : 241988,
          "index_writer_memory_in_bytes" : 0,
          "version_map_memory_in_bytes" : 0,
          "fixed_bit_set_memory_in_bytes" : 0,
          "max_unsafe_auto_id_timestamp" : -1,
          "file_sizes" : { }
        },
        "translog" : {
          "operations" : 27650,
          "size_in_bytes" : 37138433
        },
        "request_cache" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0,
          "hit_count" : 0,
          "miss_count" : 0
        },
        "recovery" : {
          "current_as_source" : 0,
          "current_as_target" : 0,
          "throttle_time_in_millis" : 0
        }
      }
    }
  }
}

syntaxTerr0r commented Jan 17, 2017

According to README, I found more working features than broken features.

To me, features that do not work with ElasticSearch 5.1.1 are:

  • .filter and its DSL (returns no result or ES errors)
  • .only do not map the requested key(s) (full documents are returned instead)
  • .facets looks deprecated in ES 5.1.1
  • Sometimes, a default strategy is missing during ActiveJob/Sidekiq jobs' execution, I had to create a Sidekiq server middleware for this. (The active_job strategy is fine, it's about executing my own jobs that update data & ES indexes)

Things that I have not tested:

  • .witchcraft! feature
  • Crutches feature
  • Geo Point fields

Any advices will be appreciated ^0^
Hope it will help, thanks for Chewy y'all!

Here is my Search index, I suppose it can be optimized, but as I said, I'm a real newbie at ES.

class SearchIndex < Chewy::Index
  settings analysis: {
    analyzer: {
      lowercase: {
        tokenizer: 'lowercase',
        filter: %w(custom_ascii_folding)
      },
      ngram_analyzer: {
        tokenizer: 'ngram_tokenizer',
        filter: %w(lowercase custom_ascii_folding)
      }
    },
    tokenizer: {
      ngram_tokenizer: {
        type: 'ngram',
        min_gram: 3,
        max_gram: 4,
        token_chars: %w(letter digit)
      }
    },
    filter: {
      custom_ascii_folding: {
        type: 'asciifolding',
        preserve_original: true
      }
    }
  }

  define_type Address do
    field :label, analyzer: 'ngram_analyzer'
    field :address, analyzer: 'lowercase'
    field :first_name, analyzer: 'lowercase'
    field :last_name, analyzer: 'lowercase'
    field :company_name, analyzer: 'ngram_analyzer'
    field :kind, type: 'keyword'
    field :email, type: 'keyword'
    field :phone, type: 'keyword', value: ->(address) { address.unformatted_phone }
    field :postcode, type: 'keyword'
    field :city, type: 'keyword'
    field :country, type: 'keyword'
    field :created_at, type: 'date'
    field :updated_at, type: 'date'
  end

  define_type Carrier, delete_if: :deleted_at do
    field :id, type: 'keyword'
    field :short_id, type: 'keyword', value: ->(carrier) { carrier.short_id }
    field :zones, :enabled
    field :name, analyzer: 'ngram_analyzer'
    field :kind, type: 'keyword'
    field :email, type: 'keyword'
    field :phone, type: 'keyword', value: ->(carrier) { carrier.unformatted_phone }
    field :postcode, type: 'keyword'
    field :city, type: 'keyword'
    field :country, type: 'keyword'
    field :dispatch_method, type: 'keyword'
    field :siret_number, type: 'keyword'
    field :vat_number, type: 'keyword'
    field :created_at, type: 'date'
    field :updated_at, type: 'date'
  end

  define_type Company, delete_if: :deleted_at do
    field :id, type: 'keyword'
    field :short_id, type: 'keyword', value: ->(company) { company.short_id }
    field :enabled
    field :name, analyzer: 'ngram_analyzer'
    field :postcode, type: 'keyword'
    field :city, type: 'keyword'
    field :country, type: 'keyword'
    field :typology, type: 'keyword'
    field :siret_number, type: 'keyword'
    field :vat_number, type: 'keyword'
    field :created_at, type: 'date'
    field :updated_at, type: 'date'
  end

  define_type User do
    field :id, type: 'keyword'
    field :short_id, type: 'keyword', value: ->(user) { user.short_id }
    field :first_name, analyzer: 'lowercase'
    field :last_name, analyzer: 'lowercase'
    field :kind, type: 'keyword'
    field :email, type: 'keyword'
    field :phone, type: 'keyword', value: ->(user) { user.unformatted_phone }
    field :created_at, type: 'date'
    field :updated_at, type: 'date'
  end

  define_type Warehouse, delete_if: :deleted_at do
    field :zones, :enabled
    field :id, type: 'keyword'
    field :short_id, type: 'keyword', value: ->(warehouse) { warehouse.short_id }
    field :name, analyzer: 'ngram_analyzer'
    field :email, type: 'keyword'
    field :phone, type: 'keyword', value: ->(warehouse) { warehouse.unformatted_phone }
    field :postcode, type: 'keyword'
    field :city, type: 'keyword'
    field :country, type: 'keyword'
    field :created_at, type: 'date'
    field :updated_at, type: 'date'
  end

  define_type Mission.includes(:owner, :accepted_carrier, :places, :stages), delete_if: :deleted_at do
    field :id, type: 'keyword'
    field :external_id, type: 'keyword'
    field :short_id, type: 'keyword', value: ->(mission) { mission.short_id }
    field :status, type: 'keyword'
    field :priority, type: 'keyword'
    field :vehicle, type: 'keyword'

    field :places do
      field :comment, analyzer: 'lowercase'
      field :first_name, analyzer: 'lowercase'
      field :last_name, analyzer: 'lowercase'
      field :company_name, analyzer: 'lowercase'
      field :full_street_address, value: ->(place) { place.full_street_address }, analyzer: 'lowercase'
      field :email, type: 'keyword'
      field :phone, type: 'keyword', value: ->(place) { place.unformatted_phone }
      field :postcode, type: 'keyword'
      field :city, type: 'keyword'
      field :country, type: 'keyword'
    end
    field :stages do
      field :signatory, analyzer: 'ngram_analyzer'
    end
    field :owner do
      field :id, type: 'keyword'
      field :name, analyzer: 'ngram_analyzer'
    end
    field :carrier, value: ->(mission) { mission.accepted_carrier } do
      field :name, analyzer: 'ngram_analyzer'
    end
    field :price, type: 'float'
    field :discount, type: 'float'
    field :penalty, type: 'float'
    field :start_at, type: 'date'
    field :end_at, type: 'date'
    field :created_at, type: 'date'
    field :updated_at, type: 'date'
    field :activated_at, type: 'date'
    field :archived_at, type: 'date'
  end
end

And here is my Search tool class:

class Search
  INDEXABLE_MODELS = %w(Address Carrier Company User Warehouse).freeze
  EXPIRABLE_MODELS = %w(Mission).freeze

  class << self
    def for(model, keywords: nil, filters: nil, only: nil, order: { created_at: :desc }, page: 1, per_page: Kaminari.config.default_per_page)
      index = search_index(model.name)
      # "multi_match" query for keywords search
      index = index.query(multi_match: { query: keywords, fields: model::FINDS, operator: 'AND' }) if keywords.present?

      if filters.is_a?(Hash)
        # convert hash like { 'key1' => 'value1', 'sub/key2' => 'value2'} to
        # ElasticSearch term query [{ term: { 'key1' => 'value1' }}, { term: { 'sub.key2' => 'value2' }}]
        filters = filters.map { |k, v| [k.gsub('/', '.'), v] }.to_h.map { |term| { term: [term].to_h} }

        # Bool query for filters search
        index = index.query(bool: { must: filters })
      end

      index = index.order(order).per(per_page).page(page)

      if only.is_a?(Symbol)
        index.only(only).map(&only) # chewy .only method do not seems to work yet :(
      else
        index.load
      end
    end

    def rebuild_indexes!
      SearchIndex.purge!
      rebuild_permanent_indexes
      rebuild_expirable_indexes
      true
    end

    private

    def rebuild_permanent_indexes
      INDEXABLE_MODELS.each do |model|
        index = search_index(model)
        index.import
      end
    end

    def rebuild_expirable_indexes
      EXPIRABLE_MODELS.each do |model|
        index = search_index(model)
        index.import model.safe_constantize.where('created_at >= (?)', Settings.search.keep_during.to_i.days.ago)
      end
    end

    def search_index(model_name)
      "SearchIndex::#{model_name}".safe_constantize
    end
  end
end

My Sidekiq server middleware workaround:

class SidekiqChewyServerMiddleware
  def call(worker, job, queue)
    if defined?(::Chewy)
      Chewy.strategy(:atomic) do
        yield
      end
    else
      yield
    end
  end
end

# in config/initializers/sidekiq.rb
Sidekiq.configure_server do |config|
  config.server_middleware do |chain|
    chain.add SidekiqChewyServerMiddleware
  end
end

And here is my ES node stats after indexing:

$ curl 'localhost:9200/_stats?pretty=1'
{
  "_shards" : {
    "total" : 10,
    "successful" : 5,
    "failed" : 0
  },
  "_all" : {
    "primaries" : {
      "docs" : {
        "count" : 138201,
        "deleted" : 18
      },
      "store" : {
        "size_in_bytes" : 196723104,
        "throttle_time_in_millis" : 0
      },
      "indexing" : {
        "index_total" : 138273,
        "index_time_in_millis" : 44104,
        "index_current" : 0,
        "index_failed" : 0,
        "delete_total" : 0,
        "delete_time_in_millis" : 0,
        "delete_current" : 0,
        "noop_update_total" : 0,
        "is_throttled" : false,
        "throttle_time_in_millis" : 0
      },
      "get" : {
        "total" : 0,
        "time_in_millis" : 0,
        "exists_total" : 0,
        "exists_time_in_millis" : 0,
        "missing_total" : 0,
        "missing_time_in_millis" : 0,
        "current" : 0
      },
      "search" : {
        "open_contexts" : 0,
        "query_total" : 310,
        "query_time_in_millis" : 1175,
        "query_current" : 0,
        "fetch_total" : 196,
        "fetch_time_in_millis" : 8514,
        "fetch_current" : 0,
        "scroll_total" : 0,
        "scroll_time_in_millis" : 0,
        "scroll_current" : 0,
        "suggest_total" : 0,
        "suggest_time_in_millis" : 0,
        "suggest_current" : 0
      },
      "merges" : {
        "current" : 0,
        "current_docs" : 0,
        "current_size_in_bytes" : 0,
        "total" : 83,
        "total_time_in_millis" : 49707,
        "total_docs" : 446803,
        "total_size_in_bytes" : 711248905,
        "total_stopped_time_in_millis" : 0,
        "total_throttled_time_in_millis" : 0,
        "total_auto_throttle_in_bytes" : 104857600
      },
      "refresh" : {
        "total" : 977,
        "total_time_in_millis" : 19756
      },
      "flush" : {
        "total" : 7,
        "total_time_in_millis" : 199
      },
      "warmer" : {
        "current" : 0,
        "total" : 979,
        "total_time_in_millis" : 339
      },
      "query_cache" : {
        "memory_size_in_bytes" : 0,
        "total_count" : 2393,
        "hit_count" : 0,
        "miss_count" : 2393,
        "cache_size" : 0,
        "cache_count" : 0,
        "evictions" : 0
      },
      "fielddata" : {
        "memory_size_in_bytes" : 0,
        "evictions" : 0
      },
      "completion" : {
        "size_in_bytes" : 0
      },
      "segments" : {
        "count" : 43,
        "memory_in_bytes" : 1191926,
        "terms_memory_in_bytes" : 854090,
        "stored_fields_memory_in_bytes" : 44768,
        "term_vectors_memory_in_bytes" : 0,
        "norms_memory_in_bytes" : 29120,
        "points_memory_in_bytes" : 21960,
        "doc_values_memory_in_bytes" : 241988,
        "index_writer_memory_in_bytes" : 0,
        "version_map_memory_in_bytes" : 0,
        "fixed_bit_set_memory_in_bytes" : 0,
        "max_unsafe_auto_id_timestamp" : -1,
        "file_sizes" : { }
      },
      "translog" : {
        "operations" : 27650,
        "size_in_bytes" : 37138433
      },
      "request_cache" : {
        "memory_size_in_bytes" : 0,
        "evictions" : 0,
        "hit_count" : 0,
        "miss_count" : 0
      },
      "recovery" : {
        "current_as_source" : 0,
        "current_as_target" : 0,
        "throttle_time_in_millis" : 0
      }
    },
    "total" : {
      "docs" : {
        "count" : 138201,
        "deleted" : 18
      },
      "store" : {
        "size_in_bytes" : 196723104,
        "throttle_time_in_millis" : 0
      },
      "indexing" : {
        "index_total" : 138273,
        "index_time_in_millis" : 44104,
        "index_current" : 0,
        "index_failed" : 0,
        "delete_total" : 0,
        "delete_time_in_millis" : 0,
        "delete_current" : 0,
        "noop_update_total" : 0,
        "is_throttled" : false,
        "throttle_time_in_millis" : 0
      },
      "get" : {
        "total" : 0,
        "time_in_millis" : 0,
        "exists_total" : 0,
        "exists_time_in_millis" : 0,
        "missing_total" : 0,
        "missing_time_in_millis" : 0,
        "current" : 0
      },
      "search" : {
        "open_contexts" : 0,
        "query_total" : 310,
        "query_time_in_millis" : 1175,
        "query_current" : 0,
        "fetch_total" : 196,
        "fetch_time_in_millis" : 8514,
        "fetch_current" : 0,
        "scroll_total" : 0,
        "scroll_time_in_millis" : 0,
        "scroll_current" : 0,
        "suggest_total" : 0,
        "suggest_time_in_millis" : 0,
        "suggest_current" : 0
      },
      "merges" : {
        "current" : 0,
        "current_docs" : 0,
        "current_size_in_bytes" : 0,
        "total" : 83,
        "total_time_in_millis" : 49707,
        "total_docs" : 446803,
        "total_size_in_bytes" : 711248905,
        "total_stopped_time_in_millis" : 0,
        "total_throttled_time_in_millis" : 0,
        "total_auto_throttle_in_bytes" : 104857600
      },
      "refresh" : {
        "total" : 977,
        "total_time_in_millis" : 19756
      },
      "flush" : {
        "total" : 7,
        "total_time_in_millis" : 199
      },
      "warmer" : {
        "current" : 0,
        "total" : 979,
        "total_time_in_millis" : 339
      },
      "query_cache" : {
        "memory_size_in_bytes" : 0,
        "total_count" : 2393,
        "hit_count" : 0,
        "miss_count" : 2393,
        "cache_size" : 0,
        "cache_count" : 0,
        "evictions" : 0
      },
      "fielddata" : {
        "memory_size_in_bytes" : 0,
        "evictions" : 0
      },
      "completion" : {
        "size_in_bytes" : 0
      },
      "segments" : {
        "count" : 43,
        "memory_in_bytes" : 1191926,
        "terms_memory_in_bytes" : 854090,
        "stored_fields_memory_in_bytes" : 44768,
        "term_vectors_memory_in_bytes" : 0,
        "norms_memory_in_bytes" : 29120,
        "points_memory_in_bytes" : 21960,
        "doc_values_memory_in_bytes" : 241988,
        "index_writer_memory_in_bytes" : 0,
        "version_map_memory_in_bytes" : 0,
        "fixed_bit_set_memory_in_bytes" : 0,
        "max_unsafe_auto_id_timestamp" : -1,
        "file_sizes" : { }
      },
      "translog" : {
        "operations" : 27650,
        "size_in_bytes" : 37138433
      },
      "request_cache" : {
        "memory_size_in_bytes" : 0,
        "evictions" : 0,
        "hit_count" : 0,
        "miss_count" : 0
      },
      "recovery" : {
        "current_as_source" : 0,
        "current_as_target" : 0,
        "throttle_time_in_millis" : 0
      }
    }
  },
  "indices" : {
    "production_search" : {
      "primaries" : {
        "docs" : {
          "count" : 138201,
          "deleted" : 18
        },
        "store" : {
          "size_in_bytes" : 196723104,
          "throttle_time_in_millis" : 0
        },
        "indexing" : {
          "index_total" : 138273,
          "index_time_in_millis" : 44104,
          "index_current" : 0,
          "index_failed" : 0,
          "delete_total" : 0,
          "delete_time_in_millis" : 0,
          "delete_current" : 0,
          "noop_update_total" : 0,
          "is_throttled" : false,
          "throttle_time_in_millis" : 0
        },
        "get" : {
          "total" : 0,
          "time_in_millis" : 0,
          "exists_total" : 0,
          "exists_time_in_millis" : 0,
          "missing_total" : 0,
          "missing_time_in_millis" : 0,
          "current" : 0
        },
        "search" : {
          "open_contexts" : 0,
          "query_total" : 310,
          "query_time_in_millis" : 1175,
          "query_current" : 0,
          "fetch_total" : 196,
          "fetch_time_in_millis" : 8514,
          "fetch_current" : 0,
          "scroll_total" : 0,
          "scroll_time_in_millis" : 0,
          "scroll_current" : 0,
          "suggest_total" : 0,
          "suggest_time_in_millis" : 0,
          "suggest_current" : 0
        },
        "merges" : {
          "current" : 0,
          "current_docs" : 0,
          "current_size_in_bytes" : 0,
          "total" : 83,
          "total_time_in_millis" : 49707,
          "total_docs" : 446803,
          "total_size_in_bytes" : 711248905,
          "total_stopped_time_in_millis" : 0,
          "total_throttled_time_in_millis" : 0,
          "total_auto_throttle_in_bytes" : 104857600
        },
        "refresh" : {
          "total" : 977,
          "total_time_in_millis" : 19756
        },
        "flush" : {
          "total" : 7,
          "total_time_in_millis" : 199
        },
        "warmer" : {
          "current" : 0,
          "total" : 979,
          "total_time_in_millis" : 339
        },
        "query_cache" : {
          "memory_size_in_bytes" : 0,
          "total_count" : 2393,
          "hit_count" : 0,
          "miss_count" : 2393,
          "cache_size" : 0,
          "cache_count" : 0,
          "evictions" : 0
        },
        "fielddata" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0
        },
        "completion" : {
          "size_in_bytes" : 0
        },
        "segments" : {
          "count" : 43,
          "memory_in_bytes" : 1191926,
          "terms_memory_in_bytes" : 854090,
          "stored_fields_memory_in_bytes" : 44768,
          "term_vectors_memory_in_bytes" : 0,
          "norms_memory_in_bytes" : 29120,
          "points_memory_in_bytes" : 21960,
          "doc_values_memory_in_bytes" : 241988,
          "index_writer_memory_in_bytes" : 0,
          "version_map_memory_in_bytes" : 0,
          "fixed_bit_set_memory_in_bytes" : 0,
          "max_unsafe_auto_id_timestamp" : -1,
          "file_sizes" : { }
        },
        "translog" : {
          "operations" : 27650,
          "size_in_bytes" : 37138433
        },
        "request_cache" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0,
          "hit_count" : 0,
          "miss_count" : 0
        },
        "recovery" : {
          "current_as_source" : 0,
          "current_as_target" : 0,
          "throttle_time_in_millis" : 0
        }
      },
      "total" : {
        "docs" : {
          "count" : 138201,
          "deleted" : 18
        },
        "store" : {
          "size_in_bytes" : 196723104,
          "throttle_time_in_millis" : 0
        },
        "indexing" : {
          "index_total" : 138273,
          "index_time_in_millis" : 44104,
          "index_current" : 0,
          "index_failed" : 0,
          "delete_total" : 0,
          "delete_time_in_millis" : 0,
          "delete_current" : 0,
          "noop_update_total" : 0,
          "is_throttled" : false,
          "throttle_time_in_millis" : 0
        },
        "get" : {
          "total" : 0,
          "time_in_millis" : 0,
          "exists_total" : 0,
          "exists_time_in_millis" : 0,
          "missing_total" : 0,
          "missing_time_in_millis" : 0,
          "current" : 0
        },
        "search" : {
          "open_contexts" : 0,
          "query_total" : 310,
          "query_time_in_millis" : 1175,
          "query_current" : 0,
          "fetch_total" : 196,
          "fetch_time_in_millis" : 8514,
          "fetch_current" : 0,
          "scroll_total" : 0,
          "scroll_time_in_millis" : 0,
          "scroll_current" : 0,
          "suggest_total" : 0,
          "suggest_time_in_millis" : 0,
          "suggest_current" : 0
        },
        "merges" : {
          "current" : 0,
          "current_docs" : 0,
          "current_size_in_bytes" : 0,
          "total" : 83,
          "total_time_in_millis" : 49707,
          "total_docs" : 446803,
          "total_size_in_bytes" : 711248905,
          "total_stopped_time_in_millis" : 0,
          "total_throttled_time_in_millis" : 0,
          "total_auto_throttle_in_bytes" : 104857600
        },
        "refresh" : {
          "total" : 977,
          "total_time_in_millis" : 19756
        },
        "flush" : {
          "total" : 7,
          "total_time_in_millis" : 199
        },
        "warmer" : {
          "current" : 0,
          "total" : 979,
          "total_time_in_millis" : 339
        },
        "query_cache" : {
          "memory_size_in_bytes" : 0,
          "total_count" : 2393,
          "hit_count" : 0,
          "miss_count" : 2393,
          "cache_size" : 0,
          "cache_count" : 0,
          "evictions" : 0
        },
        "fielddata" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0
        },
        "completion" : {
          "size_in_bytes" : 0
        },
        "segments" : {
          "count" : 43,
          "memory_in_bytes" : 1191926,
          "terms_memory_in_bytes" : 854090,
          "stored_fields_memory_in_bytes" : 44768,
          "term_vectors_memory_in_bytes" : 0,
          "norms_memory_in_bytes" : 29120,
          "points_memory_in_bytes" : 21960,
          "doc_values_memory_in_bytes" : 241988,
          "index_writer_memory_in_bytes" : 0,
          "version_map_memory_in_bytes" : 0,
          "fixed_bit_set_memory_in_bytes" : 0,
          "max_unsafe_auto_id_timestamp" : -1,
          "file_sizes" : { }
        },
        "translog" : {
          "operations" : 27650,
          "size_in_bytes" : 37138433
        },
        "request_cache" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0,
          "hit_count" : 0,
          "miss_count" : 0
        },
        "recovery" : {
          "current_as_source" : 0,
          "current_as_target" : 0,
          "throttle_time_in_millis" : 0
        }
      }
    }
  }
}
@pyromaniac

This comment has been minimized.

Show comment
Hide comment
@pyromaniac

pyromaniac Jan 17, 2017

Member

Well, yeah, default strategy is not defined for jobs. You have to wrap every job with the strategy you need.

Crutches and witchcraft should definitely work.
Probably, the only thing that needs to be updated is a query DSL. I'm working on it currently, however now sure when I'll finish.

Member

pyromaniac commented Jan 17, 2017

Well, yeah, default strategy is not defined for jobs. You have to wrap every job with the strategy you need.

Crutches and witchcraft should definitely work.
Probably, the only thing that needs to be updated is a query DSL. I'm working on it currently, however now sure when I'll finish.

@benone

This comment has been minimized.

Show comment
Hide comment
@benone

benone Jan 24, 2017

Also delete_by_query works without plugin (new request method in elasticsearch-api 5.0.1).

benone commented Jan 24, 2017

Also delete_by_query works without plugin (new request method in elasticsearch-api 5.0.1).

@pyromaniac

This comment has been minimized.

Show comment
Hide comment
@pyromaniac

pyromaniac Jan 24, 2017

Member

That's perfect lol

Member

pyromaniac commented Jan 24, 2017

That's perfect lol

@mitani

This comment has been minimized.

Show comment
Hide comment
@mitani

mitani Feb 7, 2017

There are more issues around parent child indexes since "scan" was deprecated so fetch_indexed_objects fails. Also filtered is gone so we've had to make changes to compose, criteria, and query. Pyromaniac if you already have a branch under the way can you push it up. We are working on a fork off of master right now.

mitani commented Feb 7, 2017

There are more issues around parent child indexes since "scan" was deprecated so fetch_indexed_objects fails. Also filtered is gone so we've had to make changes to compose, criteria, and query. Pyromaniac if you already have a branch under the way can you push it up. We are working on a fork off of master right now.

@pyromaniac

This comment has been minimized.

Show comment
Hide comment
@pyromaniac

pyromaniac Feb 7, 2017

Member

Sorry, but everything I have at the moment is #465, didn't have a chance to start working on it well

Member

pyromaniac commented Feb 7, 2017

Sorry, but everything I have at the moment is #465, didn't have a chance to start working on it well

@nbulaj

This comment has been minimized.

Show comment
Hide comment
@nbulaj

nbulaj Mar 21, 2017

Hi @pyromaniac . Can you share the status of the ES 5.0 support by the Chewy?

nbulaj commented Mar 21, 2017

Hi @pyromaniac . Can you share the status of the ES 5.0 support by the Chewy?

@pyromaniac

This comment has been minimized.

Show comment
Hide comment
@pyromaniac

pyromaniac Mar 21, 2017

Member

Working on it at the moment

Member

pyromaniac commented Mar 21, 2017

Working on it at the moment

@aselder

This comment has been minimized.

Show comment
Hide comment
@aselder

aselder Mar 24, 2017

@pyromaniac Be sure to let us know if there's anything we can do to help.

aselder commented Mar 24, 2017

@pyromaniac Be sure to let us know if there's anything we can do to help.

@pyromaniac

This comment has been minimized.

Show comment
Hide comment
@pyromaniac

pyromaniac Jun 5, 2017

Member

ES 5 support is merged to master, it might take some to release it, but you guys can try it out already. Who is brave enough?

Member

pyromaniac commented Jun 5, 2017

ES 5 support is merged to master, it might take some to release it, but you guys can try it out already. Who is brave enough?

@guillehorno

This comment has been minimized.

Show comment
Hide comment
@guillehorno

guillehorno Jun 5, 2017

Great work! Thanks so much!

Anything in particular that you would like us to help test before releasing it?

guillehorno commented Jun 5, 2017

Great work! Thanks so much!

Anything in particular that you would like us to help test before releasing it?

@pyromaniac

This comment has been minimized.

Show comment
Hide comment
@pyromaniac

pyromaniac Jun 5, 2017

Member

Well, nope, just want to know how do you like new approaches and so on. And how conveniend is the DSL in general.
I'm going to do some additional changes there anyway, I'm still considering some stuff though.
Like, I don't like records/documents notation after all, thinking about using objects, so it will be wrappers (Chewy::Type) - objects (source objects) pair.

Member

pyromaniac commented Jun 5, 2017

Well, nope, just want to know how do you like new approaches and so on. And how conveniend is the DSL in general.
I'm going to do some additional changes there anyway, I'm still considering some stuff though.
Like, I don't like records/documents notation after all, thinking about using objects, so it will be wrappers (Chewy::Type) - objects (source objects) pair.

@prikha

This comment has been minimized.

Show comment
Hide comment
@prikha

prikha Jun 13, 2017

@pyromaniac migrating some chewy-related code to ES5 right now. Things found by far:

  • .load()
pry(main)> RegionsIndex.limit(1).load.first.class # expect Region(ActiveRecord) but
=> RegionsIndex::Region 
  • .only(:id)
pry(main)> RegionsIndex.limit(1).only(:id).map(&:id) # expect [123]
NameError: uninitialized constant Chewy::Search::Parameters::Id
  • multi-index query logic moved from Chewy::Query to Chewy::Search::Request

prikha commented Jun 13, 2017

@pyromaniac migrating some chewy-related code to ES5 right now. Things found by far:

  • .load()
pry(main)> RegionsIndex.limit(1).load.first.class # expect Region(ActiveRecord) but
=> RegionsIndex::Region 
  • .only(:id)
pry(main)> RegionsIndex.limit(1).only(:id).map(&:id) # expect [123]
NameError: uninitialized constant Chewy::Search::Parameters::Id
  • multi-index query logic moved from Chewy::Query to Chewy::Search::Request
@prikha

This comment has been minimized.

Show comment
Hide comment
@prikha

prikha Jun 13, 2017

Can you point the right direction on load and only ? was intentional change or am i missing something?

prikha commented Jun 13, 2017

Can you point the right direction on load and only ? was intentional change or am i missing something?

@pyromaniac

This comment has been minimized.

Show comment
Hide comment
@prikha

This comment has been minimized.

Show comment
Hide comment
@prikha

prikha Jun 13, 2017

A-HA, thanks!

prikha commented Jun 13, 2017

A-HA, thanks!

@pyromaniac

This comment has been minimized.

Show comment
Hide comment
@pyromaniac

pyromaniac Jul 31, 2017

Member

Even released

Member

pyromaniac commented Jul 31, 2017

Even released

@pyromaniac pyromaniac closed this Jul 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment