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
0
votes
0 answers

Elasticsearch works fine in localhost, but gives connection error while testing

I'm new to Elasticsearch and Docker. I'm getting search results with my application, But when I run test against the same , I'm getting connection error like this cannot assign requested address - cannot assign requested address - connect(2) for…
Shamila
  • 23
  • 4
0
votes
0 answers

Conflict when using toptal/chewy gem with ankane/strong_migration gem

I having trouble when using the ankane/strong_migration gem with the toptal/chewy gem. Both 2 gems rewrite the method migrate of Active Support, lead to an infinite loop in the migrate function when I run rake db:migrate Here are the error…
Kyle
  • 21
  • 5
0
votes
1 answer

Callback after update index on elastic search using chewy

Suppose that I have the following code: class User < ActiveRecord::Base update_index('users#user') { self } after_commit :send_socket_event, on: %i[create update] def send_socket_event(self): …
Hernan Acosta
  • 377
  • 5
  • 19
0
votes
1 answer

Filtering Elastic search result with must and match giving unexpected result

{ "body": { "query": { "bool": { "must": { "match": { "_id": "24" } }, "should": [ { "term": { "draft_id": "draft_11" } }, …
przbadu
  • 5,769
  • 5
  • 42
  • 67
0
votes
1 answer

How I need to use geo_point type with Chewy?

§Hi guys, i have problem with geo_point type definition My Chewy Index code: class CoordinatesIndex < Chewy::Index define_type Coordinate.includes( :location ) do field :location, type: 'geo_point' field :user_id, type:…
Boris Kuzevanov
  • 1,232
  • 1
  • 12
  • 21
0
votes
1 answer

Block certain date ranges for pickup/dropoff

I have items for rent. The User specifies a start_date and end_date. Every item has multiple blocked_periods also with start and end date. Goal: Query all available items. Lets say: 12.11., 13.11., 14.11., 15.11. Blocked are 13. and 14. The item…
Oliver
  • 801
  • 13
  • 26
0
votes
1 answer

Update user index failing using chewy gem in rails app

I have a user in my Rails app that I am trying to manually index. In the console I am doing: u=User.find 4317 User.update_index u but the result of the index is: irb(main):006:0> User.update_index u => [User(id: integer kind: string, login: string,…
Mark Locklear
  • 5,044
  • 1
  • 51
  • 81
0
votes
1 answer

elasticseach How to add search type in request body

I have a query where I am using search_type as GET /test_videos/_search?search_type=dfs_query_then_fetch&explain=true { "query": { "bool": { "must": { "multi_match": { "query": "funny", …
Saurav Prakash
  • 1,177
  • 1
  • 11
  • 25
0
votes
1 answer

Elastic Search blank `should` returning results

I'm running a should query with any empty list against an index. I'm expecting it to return 0 results since there are no should queries/filters to match against: (Syntax is Chewy but pretty close to regular ES) OrganizationsIndex.filter( bool: { …
0
votes
1 answer

Merging elastic search query and filter doesn't work correctly

I have to merge to query and filter. we did this in elastic search 2.4 using filter_mode(:must) after merging query and filter. Now filter_mode and query_mode in incompatible. I am merging query using 'and'. I am using chewy for using elastic search…
Rahul Sharma
  • 1,393
  • 10
  • 19
0
votes
1 answer

Query to get available dates using start and end date

I’m trying to create a query which returns available products with no reservation at that date (or date range) or no reservations at all. It’s driving me crazy. Here is my current mapping with index settings: { "development_product_instances" : { …
Oliver
  • 801
  • 13
  • 26
0
votes
1 answer

vinsol-spree-contrib/shopspree-sales-app Installation error

After Cloning the ShopSpree Sales I followed the installation instructions and almost worked fine except bundle exec rake spree_sample:load. It gives me the following error : asdf08:~/workspace (master) $ bundle exec rake spree_sample:load Loaded…
Madushan Perera
  • 2,568
  • 2
  • 17
  • 36
0
votes
2 answers

Elasticsearch prioritize specific _ids but don't filter?

I'm trying to sort my query in elasticsearch where the query will prioritize documents with specific _ids to appear first but it won't filter the entire query based on the _ids it's just prioritizing them. Here's an example of what I've tried as an…
startupsmith
  • 5,554
  • 10
  • 50
  • 71
0
votes
1 answer

Order Terms Aggregation by Geo Distance

So I have an issue here... I'm using chewy ruby gem to communicate with Elasticsearch => #
rukia_kuchiki_21
  • 1,279
  • 3
  • 17
  • 34
0
votes
1 answer

Exception when search by null value in elasticsearch

I am using elasticsearch to search some records in my application. filtered: { query: { query_string: { query: "*#{term}*", fields: ["name"] } }, …
Aman Garg
  • 4,198
  • 2
  • 21
  • 29