Questions tagged [tire]

Tire is a Ruby client for the ElasticSearch search engine/database. It provides Ruby-like API for fluent communication with the ElasticSearch server and blends with ActiveModel classes for convenient usage in Rails applications.

Tire is a Ruby client for the ElasticSearch search engine/database. It provides Ruby-like API for fluent communication with the ElasticSearch server and blends with ActiveModel classes for convenient usage in Rails applications. It allows to delete and create indices, define mapping for them, supports the bulk API, and presents an easy-to-use DSL for constructing your queries. It has full ActiveRecord/ActiveModel compatibility, allowing you to index your models (incrementally upon saving, or in bulk), searching and paginating the results. Please check the documentation at http://karmi.github.com/tire/.

509 questions
3
votes
1 answer

Elasticsearch – combine ids query with must_not clause

I’d like to combine ids query with must_not clause. I’m using (re)tire gem with rails application. I’m doing something like this: query do ids ["foo", "bar", "test"] end Which works. However, when I’m trying to combine it with must_not clause,…
user1105595
  • 591
  • 2
  • 8
  • 20
3
votes
1 answer

Asciifolding with Elasticsearch and Tire in Rails 4 not Working

I created a search engine in my rails 4 app that was working great, but I am having a very hard time getting the asciifolding filter to work. My model has a lot of terms with accents which will not come up unless they're spelled exactly right, ie: I…
tommy-taco
  • 227
  • 1
  • 8
3
votes
1 answer

elasticsearch-rails not a geopoint field error

i tried to implement geo distance search with elasticsearch-rails but i am getting not a geopoint field error also triend with string version of latitude and longitude. i am using elasticsearch version 1.0.2 error "error_code": "103", …
surendar
  • 656
  • 1
  • 9
  • 27
3
votes
1 answer

How do you get nested facets with Searchkick/ElasticSearch

How can you do nested facets in ElastiSearch with the Searchkick gem? I would like to achieve something like this: Category Name median price count min price max price
Avishai
  • 4,512
  • 4
  • 41
  • 67
3
votes
1 answer

Tire : Eager loading associations from multiple models

I am using elasticsearch for querying in my application. Lets say there are 2 models Class Topic has_many :posts and Class Article has_many :comments I want to do a combined search on both these models and my query looks like: Tire.search…
Arvinth Shriram
  • 263
  • 4
  • 12
3
votes
0 answers

Tire returning no "hits" with Bonsai Elastic Search on Heroku

Locally, tire and elasticsearch work. However, tire doesn't seem to be working well with Bonsai on Heroku. The index builds properly, however, Tire is not hitting the index with the search method. When I inspect the search method called on my model…
cmw
  • 946
  • 2
  • 11
  • 26
3
votes
0 answers

Using filters with elasticsearch and tire to mimic named scopes in rails

I have an Exhibition model that has three named scopes: scope :opening, -> { where(start_date: (Date.today .... } scope :closing, -> { where(end_date: .... } scope :reception, -> { where("reception is not null")... } I have the following tire…
Dan Garman
  • 646
  • 1
  • 5
  • 20
3
votes
0 answers

Uniformly distributing results in elastic search based on an attribute

I am using tire to perform searches on sets of objects that have a category attribute (there are 6 different categories). I want the results to come in pages of 6 with one of each category on a page (while it is possible). Eg1. So if the…
Matthew Hirst
  • 31
  • 1
  • 2
3
votes
2 answers

How to use Tire for "MoreLikeThis" query of ElasticSearch

I would like execute this exemple : $ curl -XGET 'http://localhost:9200/twitter/tweet/1/_mlt?mlt_fields=tag,content&min_doc_freq=1' with Tire gem. It's poossible ? My goal to search document related to another document.
Bastien D
  • 1,395
  • 2
  • 14
  • 26
3
votes
0 answers

Rails filter elasticsearch tire query

I'm using Tire gem with eleasticsearch and I want to filter results of the query like a Rails scope do. I want to exclude different parameters of the result like I have done with this scope : scope :online, ->{ where.not(price: nil ||…
Jonnyx Delavilla
  • 555
  • 9
  • 24
3
votes
1 answer

Complex tire query involving nested models

I have the following models. class Author include Tire::Model::Search include Tire::Model::Callbacks has_many :books has_many :tags #(eg: 'german', 'philosopher') end class Book belongs_to :author belongs_to :book_type…
Rahul
  • 1,866
  • 17
  • 32
3
votes
2 answers

ElasticSearch Tire: How to bulk remove?

Is there a way to bulk remove documents from a ES index with Tire gem? There is a way to bulk import, but what about remove? Bulk Import Example: articles = Article.where("id < 10") Tire.index 'articles' do import articles end
Henley
  • 21,258
  • 32
  • 119
  • 207
3
votes
1 answer

How to filter by external data not indexed in ElasticSearch

I can't find a way to do the following with ElasticSearch: I have 2,000,000 items indexed in ElasticSearch I have 30,000 players saved in MySQL Every item has the name of a player as an attribute. The online status of these players changes every…
Robin
  • 21,667
  • 10
  • 62
  • 85
3
votes
3 answers

Update Tire index without using Tire::Model::Callbacks

I've gone over the Tire documentation and I understand that it's possible to create indexes and import objects into Elasticsearch using Tire without using the ActiveModel includes. I would like to keep my model files completely clear of any Tire…
Robert Fall
  • 861
  • 10
  • 22
3
votes
2 answers

Elasticsearch reindexing: How do you direct updates to the new index while it is being built?

I understand reindexing using an alias to avoid downtime, as described here: Is there a smarter way to reindex elasticsearch? But one problem remains: Say the reindexing takes an hour, while the original DB keeps changing. I would need any updates…
Lars P
  • 796
  • 6
  • 16