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
0
votes
1 answer

ElasticSearch - query again if no results

I have a query that works decently well on a product catalog. My query currently utilizes fuzziness in the multi_match, but I would prefer that the search utilized the fuzziness option if the same query (without fuzziness) didn't return any results.…
Cannon Moyer
  • 3,014
  • 3
  • 31
  • 75
0
votes
1 answer

rails undefined method at module

i have a method in my rails module, this is my module module Searchable extend ActiveSupport::Concern included do include Elasticsearch::Model include Elasticsearch::Model::Callbacks index_name…
0
votes
1 answer

elastic search not found error in ruby on rails

I'm going to do elastic search on DoctorProfile and Subspeciality table. The error that I'm dealing with is that it gives the not found result. It takes a list of ids from doctor table but it doesn't gives desire result which is the doctor and with…
Hussein Ojaghi
  • 2,260
  • 3
  • 23
  • 41
0
votes
2 answers

Conditional queries for ElasticSearch 5.x (elasticsearch-rails/elasticsearch-model)

New to ElasticSearch and I was wondering if there is a way to construct conditional queries/filters. I am working with Rails, so I suppose it has to be on that particular level, as I couldn't find anything that points to conditional queries at…
0
votes
1 answer

How to query two different fields with different query terms in same request. ElasticSearch 5.x

new to ElasticSearch - start loving it. I am working on a Rails application (using elasticsearch-rails / elasticsearch-model). I have two fields - both strings consisting of Tags. about_me & about_you Now I was to query the about_you of another…
0
votes
1 answer

geo_distance doesn't return any hit Elasticsearch

Have a problem with this query, when I use geo_distance filter, nothing returned from query. When I remove it I get proper results. Query is bellow: GET _search { "query": { "bool": { "filter": { "geo_distance": { …
zauzaj
  • 1,206
  • 12
  • 20
0
votes
0 answers

Elasticsearch update mapping for type within index and reindexing

I've got an index called business_data which contains different types: Clients, Messages, Events etc... each one of these has its own mappings, analyzers, etc. I need to update the mapping for clients and reindex (reimport from activerecord, for…
0
votes
1 answer

Elasticsearch-rails results accuracy not as expected

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

How do you use the ingest-attachment plugin with elasticsearch-rails?

I was previously using the mapper-attachments plugin that is now deprecated, which was fairly easy to use along with normal indexing. Now that ingest-attachment has replaced it and requires a pipeline, etc. it has become confusing on how to properly…
0
votes
1 answer

Having trouble converting a filtered query into a bool query for Elasticsearch 5

I'm in the process of upgrading from elasticsearch 1.7 to 5.0. One of the changes is the removal of filtered query in favor of a bool query. For example, I have this search hash being used in the older version of ES: { "sort": [ { "updated_at" =>…
surjay
  • 123
  • 1
  • 8
0
votes
1 answer

Elasticsearch Rails indexing issue

I am using Elasticsearch and the Elasticsearch Rails gem. I have two models that are associated via ActiveRecord and I am trying to index and search them with Elasticsearch. Here is my store model store.rb has_many :addresses has_many :jobs def…
Mike Riley
  • 282
  • 3
  • 20
0
votes
2 answers

Elasticsearch datetime object in rails not properly hydrated from index, reads as string

I have an indexed field defined as :date that is a method to determine which DateTime object to store. settings index: { number_of_shards: 1 } do mapping do ... indexes :date, index: :not_analyzed, type: 'date' ... …
coneybeare
  • 33,113
  • 21
  • 131
  • 183
0
votes
1 answer

Elasticsearch Rails filter

I am building Rails web app with elasticsearch-model gem. I would like to build search query with filtering for my Place model. I succeded in wrtiting search by name however I would like to be able to filter my search with city(In this example…
0
votes
0 answers

Elasticsearch - Unique values in a field of an index

I have an index of a following type: { company: { watchlist: [ {id: 1}, {id: 2}, {id, 1} ] } } In the watchlist array in the indexes, duplicate values are stored. I want the indexes not to store duplicate values as this is increasing the…
Vikram Singh Jadon
  • 1,007
  • 1
  • 10
  • 23
0
votes
0 answers

NGRAM doesn't work in Elasticsearch Rails

I have a table which has job_title field, I want to make a fuzzy search let user can still get the result when they mis-spell query keyword. For example, I have many records have the "Android developer" as its job_title, When the user issues the…
newBike
  • 14,385
  • 29
  • 109
  • 192