Questions tagged [elasticsearch-model]

46 questions
9
votes
3 answers

Searching subtitle data in elasticsearch

Having the following data (simple srt) 1 00:02:17,440 --> 00:02:20,375 Senator, we're making our final 2 00:02:20,476 --> 00:02:22,501 approach into Coruscant. ... what would be the best way to index it in Elasticsearch? Now here's the catch: I…
7
votes
0 answers

VersionConflictEngineException after upgrade to Rails 4.2.5.1

I'm getting this exception from time to time after updating Rails to 4.2.5.1 and updating a user document Elasticsearch::Transport::Transport::Errors::Conflict: [409] {"error":"VersionConflictEngineException[[users][0] [user][1]: version …
6
votes
4 answers

Elasticsearch rails/ Elasticsearch model search model association

I have a model named Movie that looks like this: class Movie < ActiveRecord::Base include Elasticsearch::Model include Elasticsearch::Model::Callbacks has_many :actors, after_add: [ lambda {|a,c| a.__elasticsearch__.index_document}], …
Optimus Pette
  • 3,250
  • 3
  • 29
  • 50
5
votes
1 answer

adding index for an attribute of jsonb field in elasticsearch rails

I am a beginner in elasticsearch and I want to add an index for the field inside a jsonb field I am having. This is not a nested relationship. I am having table payload with fields id (integer),user_id(integer),data(jsonb). Sample jsonb value is…
4
votes
1 answer

search by elasticsearch-model not returns the records

I'm using elasticsearch-model and I used concern approach and here is my search method.I have tried my query by curl it returns me back 5 entries but when I used this method def search_index(*args) …
Mini
  • 1,138
  • 9
  • 24
3
votes
2 answers

Rails __elasticsearch__.create_index! "Root mapping definition has unsupported parameters(mapper_parsing_exception)"

I have trouble with elasticsearch-rails, when I'm using Business.__elasticsearch__.create_index! I'm getting an error: {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: …
3
votes
2 answers

Rails - Elasticsearch (Bonsai) with Heroku - Performance Issues

I am using Elasticsearch - Bonsai in one of my Ruby on Rails Project. So, far things were going very smooth. But, the moment we launched this application to end-users and people started coming-in, we noticed that a single elasticsearch query takes…
3
votes
0 answers

elasticsearch-model - how to set TTL option?

I am using elasticsearch-model (https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-model) but I can't find a way to set the TTL on the documents. I have tried a few ways but without success. I have a model called "log" and an…
carvil
  • 199
  • 4
  • 12
3
votes
0 answers

Elasticsearch - Auto-import records from Active Record model

System: Rails 4 Ruby 2 Elasticsearch 1.6.0 I'm using Elasticsearch to filter records and calculate statistics for my Active Record models. I'd like my Elasticsearch indices to mirror my Postgres database so that existing records are imported into…
2
votes
1 answer

Elasticsearch for mysql view rails

How to create an elasticsearch index for a view in MYSQL ? I tried making a model for a migration of a mysql view and in the model put include Elasticsearch::Model include Elasticsearch::Model::Callbacks and put in elasticsearch.rb unless…
2
votes
0 answers

How do elasticsearch-rails mappings translate into elasticsearch index configuration?

I'm using elasticsearch-rails (elasticsearch-model) gem and I'm getting a bit confused about how the model-dsl ultimately translates into an index configuration. I'm having the following code to directly set up the index, and it works fine: require…
2
votes
1 answer

How to import parent/child objects in Elasticsearch

I'm using the gems elasticsearch-rails and elasticsearch-model in my Rails app. I'm using this integration test as a template for setting up my mappings and such before importing existing data, which has the same basic association between the parent…
2
votes
0 answers

Rails Elasticsearch-model model mapping - raw and not_analyzed

I am using the Elasticsearch-rails gem in my application. I need my index mapping in the model to look like the JSON you see below (shortened only to include only relevant pieces). The part I don't understand relates to "name." How would that…
aressidi
  • 680
  • 1
  • 10
  • 26
2
votes
2 answers

rails elasticsearch searching a nested json field

I'm using the elasticsearch-model gem for a model that has a has_many relationship. To match the documentation, let's say the model is Article and the relationship is has_many categories. So I wrote the customer serializer as follows (directly from…
ezvz
  • 35
  • 2
  • 6
1
vote
1 answer

Using scroll api via elasticsearch-model

For the life of me I can't find any reference to using the ElasticSearch scroll api from within Ruby on Rails and the elastisearch-model (or rails or dsl) gem. The only thing they do reference in the docs is calling scroll directly on the client,…
1
2 3 4