Questions tagged [elasticsearch-rails]

Ruby and Rails integrations for Elasticsearch

Ruby and Rails integrations for Elasticsearch:

  • ActiveModel integration with adapters for ActiveRecord and Mongoid
  • Repository pattern based persistence layer for Ruby objects Active
  • Record pattern based persistence layer for Ruby models
  • Enumerable-based wrapper for search results
  • ActiveRecord::Relation-based wrapper for returning search results as records
  • Convenience model methods such as search, mapping, import, etc
  • Rake tasks for importing the data Support for Kaminari and WillPaginate pagination
  • Integration with Rails' instrumentation framework

https://github.com/elastic/elasticsearch-rails

117 questions
1
vote
1 answer

Elasticsearch search on phone numbers

I have postgres array column which I wanted to be indexed and then use it in search. Here is example below, phones = [ "+175 (2) 123-25-32", "123456789", "+12 111-111-11" ] I have analyzed the tokens using analyze api, elasticsearch is tokenizing…
1
vote
1 answer

Elastic Search Upgrade in Ruby On Rails from 0.90 to 2.x

In My current Ruby on Rails application elasticsearch is implememnted, the version of elasticsearch is 0.90 and we used "tire" gem. Now I want to update it with latest version of elasticsearch("2.x"). Tier gem is now not supporting elasticsearch…
1
vote
1 answer

custom mapping for mapper attachment type with elasticsearch-persistence ruby

In my project I store data in active record model and index html document in elasticsearch using mapper-attachments plugin. My document mapping look like this: include Elasticsearch::Model settings index: { number_of_shards: 5 } do mappings do …
channa ly
  • 9,479
  • 14
  • 53
  • 86
1
vote
1 answer

Can you use copy_to with elasticsearch-rails?

I'm trying to copy the collection_title field to a title field using copy_to. This does nothing whatsoever: mappings dynamic: 'false' do indexes :collection_title, type: 'string', copy_to: 'title' end I'm using the collection of…
Bailey Smith
  • 2,853
  • 4
  • 27
  • 39
1
vote
1 answer

How to search multiple generations in Elasticsearch

Elasticsearch's article outlines how to find objects based on a search through one generation: https://www.elastic.co/guide/en/elasticsearch/guide/current/grandparents.html GET /company/country/_search { "query": { "has_child": { "type":…
boo-urns
  • 10,136
  • 26
  • 71
  • 107
1
vote
3 answers

If one record found execute show action

I wondering what would be the best practice to perform next task. I have a search results to display from index action. Every individual record displays in the pop up through show action. What I would love to do is to execute pop up if there is…
Misha
  • 1,876
  • 2
  • 17
  • 24
1
vote
1 answer

Connect Rails app to Elasticsearch server

I am using logstash+elasticsearch to index server logs. The Elasticsearch server is running at localhost:9200 with millions of server log docs. I also have a Rails app running at localhost:3000. I need to connect this rails app to the ES server. I…
1
vote
1 answer

Elasticsearch-rails completion suggester, map data, create indexes, suggest method

I am using elasticsearch-model and elasticsearch-rails gems. In my Profile model I have settings index: { number_of_shards: 3 } do mappings dynamic: 'false' do indexes :profile_type, analyzer: 'keyword' indexes :profile do |p| …
Nermin
  • 6,118
  • 13
  • 23
0
votes
0 answers

Implementing elasticsearch index update in ruby on rails application

I am creating a rails application with integration to elasticsearch for fulltext search. I have the search working for a model, however when another part of the app does an attribute_update on it, I get below…
vinnar
  • 15
  • 2
  • 8
0
votes
0 answers

Elasticsearch ruby clear_scroll API

I'm trying to use ES v6 scroll API to fetch the data in batches from the index The issue that I facing is in clear_scroll function as it takes scroll_id as an argument and put it in the URL as a query param which leads to cause a failure due to the…
0
votes
1 answer

Elasticsearch random_score pushes documents towards the end of results

Here's the logic I am trying to accomplish: I am using Elasticsearch to display top selling Products and randomly inserting newly created products in the results using function_score query DSL. The issue I am facing is that I am using random_score…
Puneet Pandey
  • 541
  • 2
  • 6
  • 23
0
votes
1 answer

Elasticsearch: Add field on the fly like driving distance by a user searching

Is there a way to dynamically append a driving distance of the CONSUMER in ES? I am trying to create an app and sort PROVIDERS by driving distance. One thing I could think of is get all the PROVIDERS within a range then put them in an array. Iterate…
dr.calix
  • 667
  • 8
  • 21
0
votes
0 answers

Elasticsearch Indexing and Searching using association

I have a Provider model which has many schedules & has many services. Provider name email location(lat/lng) ProviderSchedules provider_id start_datetime end_datetime ProviderServices provider_id service_id Questions: How do index Provider with…
dr.calix
  • 667
  • 8
  • 21
0
votes
1 answer

Elasticsearch: Rank by most number of should matches

I have an indexed job description field. I am trying to rank or order the results by number of matches. Example, I am searching for: friendly honest personality excellent communication skills Records with most number of matches will be ranked…
0
votes
1 answer

Unable to retrieve nested object within Elastic Search

An ELK noob here, having the ELK task drop to me last minute. We are adding an extra data named prospects into the vehicle index, so the user could search for it. I'm able to to add the prospects into the index, now I'm unable to get the nested…