Questions tagged [chewy-gem]

Chewy is an ODM and wrapper for the official Elasticsearch client, sponsored by Toptal.

Chewy is an ODM and wrapper for the official Elasticsearch client, sponsored by Toptal. https://github.com/toptal/chewy

51 questions
4
votes
2 answers

Elasticsearch query not returning correct data

I am using the Chewy gem to integrate Elasticsearch into my Rails project. I set up the index for a model called (Listing) and my search interface where I use the Chewy es dsl. listings_index.rb class ListingsIndex < Chewy::Index settings…
Cyzanfar
  • 6,997
  • 9
  • 43
  • 81
3
votes
1 answer

Nested sorting not working as expected ElasticSearch

Requirement sort product with custom_field_values matching custom_field_id Mapping { "mapping": { "product": { "properties": { "user_id": { "type": "integer" } "custom_field_values": { …
3
votes
1 answer

Rspec - bypass strategy on Chewy

Chewy documentation recommend set up the :bypass strategy for tests, with: RSpec.configure do |config| config.before(:suite) do Chewy.strategy(:bypass) end end But I get a: undefined method `strategy' for Chewy:Module (NoMethodError) Here…
Édipo Féderle
  • 4,169
  • 5
  • 31
  • 35
2
votes
2 answers

ElasticSearch: Error while upgrading Chewy/ElasticSearch version

I have been using the gem chewy in my rails app, to create index and search in ElasticSearch. Previously, I was using elastic search version 5.6, now I would like to upgrade it to 7.7. When I try to create an index I am getting the below error. The…
Surya
  • 2,429
  • 1
  • 21
  • 42
2
votes
1 answer

elasticsearch reindex documents reduce free space

steps: - elasticsearch 2.3 - create documents in ES => ~ 1 GB of disk is used - update same documents in ES => ~ 2 GB of disk is used Why it happens? Is it due to versioning? Is it possible to avoid doubling disk usage? Currently we use…
gayavat
  • 18,910
  • 11
  • 45
  • 55
2
votes
1 answer

How to find the corresponding ES query for a Chewy query?

I use use chewy in my rails app to query ElasticSearch. Autocomplete is my ElasticSearch Index. AutocompleteIndex.suggest( suggest: { text: cleanup_query('query'), completion: { field: 'search_suggest', …
Surya
  • 2,429
  • 1
  • 21
  • 42
2
votes
0 answers

Chewy gem deserializes Elasticsearch date types to string

When retrieving results from ES using Chewy, the date-typed results are returned as Ruby strings. My index is defined just like: class OrdersIndex < Chewy::Index define_type Order do field :id, type: "keyword" field :created_at, type:…
vinibrsl
  • 6,563
  • 4
  • 31
  • 44
2
votes
0 answers

ElasticSearch Fielddata error on Rails 4 app using Chewy gem on one environment but not the other

We have a Rails 4 app running on two similar environments, staging and production. Lately, this error started appearing on local development environments and the staging environment, but is not happening on production.…
Ramses
  • 996
  • 4
  • 12
  • 28
2
votes
1 answer

How do you get the Chewy gem to filter results?

I just started on the Chewy gem, looks like a great idea, but I'm unable to get it working properly with even a super basic query. I have indexed my Lead model as LeadsIndex. Here I have a query that works: irb(main):068:0> LeadsIndex.filter.first …
hash12
  • 181
  • 1
  • 9
2
votes
0 answers

rails : how to set locale in elasticsearch use chewy gem

I use elasticsearch by gem Chewy. and I use Globalize gem to translation. I have a model Location, and translate attribute name of location. But chewy only update last data, don't update data with different locale. I want to chewy update both data…
2
votes
2 answers

Getting more than 10 results with Chewy Gem - ElasticSearch & Rails

With chewy gem, if I run: MyIndex.filter{attribute1?}.count It will always return 10 occurences. I know this is an ElasticSearch default and I have read this question, which says I should set the param size on the URL to a big number, to get all…
Mauricio Moraes
  • 7,255
  • 5
  • 39
  • 59
2
votes
0 answers

Can I have Rails ActiveRecord Magic in an Angular View with ElasticSearch thrown in?

I think I already know the answer to this, but I'm going to ask it anyway. I've got a rails app, and integrating angular into one of the areas of the app to get some of that magic. To add to the mix I'm integrating the Chewy gem to use…
2
votes
1 answer

Use chewy to connect a rails app to elasticsearch

I am using the chewy gem to tie ES to my rails app.I am new to chewy, so i am facing a problem when i try to index a field of my model. The field is a text field in the DB which i serialize as a Hash in my model. The hash is dynamic and might have 0…
Leon
  • 161
  • 1
  • 11
1
vote
1 answer

Elastic search 8.7 default field search not working as expected

I am facing an issue with default field search for elastic search version 8.7 Consider elastic search with index name customers with below data fields { "customer_name":"ABC Manufacturers", "vendor_name":"XZY Manufacturers", …
RKP
  • 750
  • 2
  • 12
  • 23
1
vote
0 answers

ActiveRecord::StatementInvalid: PG::ConnectionBad: connection is closed while in the middle of a migration

OK. I downloaded this social network server to test locally on my machine, I’ve followed all instructions, but the migrations are missing. Time after time I do the migrations (the command is bundle exec rake db:migrate RAILS_ENV=development), I am…
1
2 3 4