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
1
vote
0 answers

Puma caught this error: undefined method `first' for nil:NilClass (NoMethodError)

Puma caught this error: undefined method `first' for nil:NilClass (NoMethodError) with elastic search services use. when record update then this…
1
vote
1 answer

Getting error object field starting or ending with a [.]

While inserting the below document in an Elasticsearch index: { "id": "122223334444", "name": "Mei", "url": "mei-2019-tamil", "alternate_urls": [ "mei-2019-tamil", "sa-baskaran-aishwarya-rajesh-untitled" ], "type": "Movie", …
1
vote
0 answers

Change default strategy for Chewy on application initialisation

I have a requirement in my application to use the urgent strategy. The Chewy document has a way to override the strategy in the application but every time a Chewy call is made, it has to be wrapped up in a code block. I am wondering if there is a…
mscode
  • 11
  • 3
1
vote
2 answers

How to update Elasticsearch field type with Chewy

My question is about changing a field type in my elasticsearch index using the elasticsearch ruby client chewy. I am trying to update a field type in my index. I am getting this error: illegal_argument_exception. I have read that it is impossible to…
Elie Teyssedou
  • 749
  • 1
  • 7
  • 19
1
vote
2 answers

How to access Chewy results with the dot notation?

I'm using Toptal's Chewy gem to connect and query my Elasticsearch, just like an ODM. I'm using Chewy along with Elasticsearch 6, Ruby on Rails 5.2 and Active Record. I've defined my index just like this: class OrdersIndex < Chewy::Index …
vinibrsl
  • 6,563
  • 4
  • 31
  • 44
1
vote
3 answers

Get available apartments query

Overview I have apartments which have reservations. My index has the reservations as nested fields with date fields for start_date and end_date. I'm using the chewy ruby gem - but this doesn't matter at this time i think. Just need to get my query…
Oliver
  • 801
  • 13
  • 26
1
vote
1 answer

How to query multiple fields with Chewy

Let's say I have an index with multiple objects in it: class ThingsIndex < Chewy::Index define_type User do field :full_name end define_type Post do field :title end end How do I search both users' full_name and posts'…
CodeOverload
  • 47,274
  • 54
  • 131
  • 219
1
vote
0 answers

Chewy & ElasticSearch - Parent-Child Relationship

I use chewy gem for elasticsearch. I have two separate indexes: Items1Index and Items2Index. I should find Items2 by a field from the Items2Index, and filter found items by a few fields from Items1Index. (Item1 has many Items2) I don't want repeat…
AlexMrKlim
  • 270
  • 1
  • 3
  • 15
1
vote
1 answer

How to use elasticsearch scroll api using chewy gem?

I am using 'chewy' gem for elasticsearch in my ROR application. But I didn't find any documentation for elasticsearch scroll api. I'm getting below error when I jump to last page of the records. [500]…
vitthal-gaikwad
  • 1,184
  • 11
  • 13
1
vote
2 answers

Chewy Gem - Query to get ranges of dates containing specific date

I am using ElasticSearch with chewy GEM on a Rails application. I would some help in order to translate that: all.select { |task| (task.start_at.to_date..task.end_at.to_date).cover?(Date.today) } to use a filter with chewy. I tried making this…
Édipo Féderle
  • 4,169
  • 5
  • 31
  • 35
1
vote
1 answer

Can't get highlighting on search results for relations using chewy gem

I'm using the chewy gem for elasticSearch with Rails. I have related documents, and I want to show both the fields with highlighting and some other fields in my results. When I get search results back the highlighting shows up for matches in the…
tomf
  • 449
  • 4
  • 13
0
votes
0 answers

Multiple MUST inside SHOULD query on Elasticsearch 6.6

I am trying to build a search filter/query to return either one of the two conditions. (first_score >= 5 AND first_score <= 18) AND (last_score <= 20) OR (first_score = 19) AND (last_score = 0) Sample document: first_score = 18 last_score =…
chuki
  • 1
0
votes
1 answer

Any way to run a block right after Chewy `udpate_index`?

In a Rails app Chewy gem is used to handle ElasticSearch indexing. I have a block of code in an after_commit and I need it to be run once a new record of the RDB is indexed in our NRDB. it looks like: class User < ApplicationRecord …
0
votes
1 answer

Chewy (Elasticsearch) - Multiple emails with uax_url_email

I have a simple email analyzer analyzer: { email: { tokenizer: 'uax_url_email', filter: ['lowercase'] } } And a field with multiple email values: field :emails, type: :text, analyzer: 'email', …
zolter
  • 7,070
  • 3
  • 37
  • 51
0
votes
1 answer

How use Chewy as Elasticsearch in Rest Api project of Ruby on Rails?

I have problem with connect Chewy to my Rest Api app with Ruby on Rails. I have simple Item and controller with base CRUD. In this example i add only create method I read a few tutorials but last I…
besek
  • 5
  • 2