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

Elastic Search Synonyms - Rails

I'm using Ruby on Rails with the elasticsearch-rails gem and I am trying to use a synonyms filter. I have been following the question posted here for guidance (my implementation works as expected except for the synonym part):…
1
vote
1 answer

Function Score attribute to rank searches based on clicks not working with elastic search and rails

I have implemented the function score attribute in my document model which contains a click field that keeps tracks of a number of view per document. Now I want the search results to get more priority and appear at the top based on the clicks per…
1
vote
1 answer

How can I increase the rank for a particular search result based on user selection in Elastic search using rails

So let's say I enter the text "Ebook" for searching and get the following results: Ebook for Rails Elastic Ebook Booking for ebook. Now I select "Elastic Ebook" from the list. Let's say that several other users input Ebook for searching and most of…
1
vote
0 answers

Elastic Search "Did you mean" for auto correction of words implementation not working with rails

I am trying to implement full search text engine for my rails app using elastic search for a document class. It should have an auto correction for misspelled words. This is my document.rb require 'elasticsearch/model' class Document <…
1
vote
1 answer

How do I merge two or more results from elasticsearch rails gem?

I'm trying to merge two elasticsearch results into one variable, here my code tries... class SearchController < ApplicationController def index end def advanced @results = {} if !params[:fast_search].empty? …
1
vote
2 answers

Elasticsearch-Rails & Elasticsearch 5.4: Geopoint not updating

So I am running a Rails 5 application using elasticsearch-rails Gem to work with Elasticsearch 5.4. Everything works fine, the only problem I am having is that when I update the location using Geocoding to retrieve the new longitude and latitude,…
Georg Keferböck
  • 1,967
  • 26
  • 43
1
vote
1 answer

elasticsearch-rails how to write query for search

I am using elasticsearch-rails and elasticsearch-model gem for searching words in my rails app. Here is my model article.rb where I want to search to take place: require 'elasticsearch/model' class Article < ActiveRecord::Base include…
Yogesh Nikam
  • 73
  • 10
1
vote
0 answers

Elasticsearch-rails How to increase accuracy in result as expected?

I am using elasticsearch-rails and elasticsearch-model gem for searching words in my rails app. Here is my model article.rb where I want to search to take place: require 'elasticsearch/model' class Article < ActiveRecord::Base include…
Yogesh Nikam
  • 73
  • 10
1
vote
1 answer

Elasticsearch rails not geting proper response

I am using elasticsearch-rails and elasticsearch-model gem for searching words in my rails app. I want to make my search case insensitive and must be independent of pluralization. I researched a lot on google but got a hunch on how to do it using…
Prajakta Dumbre
  • 37
  • 1
  • 10
1
vote
2 answers

Rails 4 elasticsearch using multiple search conditions, combine search feature

i'm using elasticsearch-rails for a project, there is a combine search feature, all columns are in one table. I just write a custom search function, and the search dsl didn't work, can't have any results. def self.combine_search_filter(remark=nil,…
JCJC
  • 35
  • 6
1
vote
1 answer

How do I query array elements in elastic search

This is the index of my model in the elastic search { "_index":"cars", "_type":"car", "_id":"3275", "_version":4, "_score":1, "_source":{ "category_id": 6, "car_branches":[ …
gates
  • 4,465
  • 7
  • 32
  • 60
1
vote
1 answer

Elasticsearch autocomplete with picture of product and other options

Recently I've started to learn elasticsearch and currently working with some sample product data. Now I want to suggest the product as user type it. I've checked some documentations for Completion Suggester and implemented some examples for…
1
vote
0 answers

Most Searched for Keyword, in Elastic Search

In Elastic Search, how do I get the strings that are searched for the most number of times? I tried getting this result, but was not successful. For eg: Multiple users searches for work 'stackoverflow'. What is the total number of times,…
MIdhun Krishna
  • 1,739
  • 1
  • 13
  • 31
1
vote
0 answers

Elastic search query searches for 1=0 and returns no results

I have recently added ES to by Ruby on Rails application using elasticsearch-rails and elasticsearch-model gems. I have added proper index and mappings to my model and also imported it. But my search always returns 0 records. The query searches for…
1
vote
1 answer

How could I keep the synchronization within elasticsearch-rails

I have a existing data in mysql. I imported all records from mysql into elasticsearch with a rake task However, I wonder know how could I keep synchronization when I delete, update, insert a record within Rails How could Rails trigger the…
newBike
  • 14,385
  • 29
  • 109
  • 192