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

Flattening a polymorphic AR relation with Elasticsearch/Tire

I'm working with a Rails 3 application to allow people to apply for grants and such. We're using Elasticsearch/Tire as a search engine. Documents, e.g., grant proposals, are composed of many answers of varying types, like contact information or…
Erik
  • 89
  • 4
5
votes
3 answers

Keep id order as in query

I'm using elasticsearch to get a mapping of ids to some values, but it is crucial that I keep the order of the results in the order that the ids have. Example: def term_mapping(ids) ids = ids.split(',') self.search do |s| s.filter…
spas
  • 1,914
  • 14
  • 21
5
votes
1 answer

reloading tire/elasticsearch mappings for a model that already has data stored

I am using Tire and elasticsearch to provide search functionality on a MongoMapper model, which is part of a Rails App. I just stumbled across a problem where the mappings for this model were not being updated when I redeployed to an environment…
5
votes
1 answer

Ignore accents using elastic search and tire

I'm inheriting a project that has some elastic search through tire. The search is working, but accents through it off. Searching for "this" needs to return "thís" and "thiš" for instance. I have read this tire documentation:…
Hsiu Dai
  • 1,303
  • 2
  • 14
  • 21
5
votes
1 answer

Filter applying to only one model with Tire and ElasticSearch in Rails

I have several models indexed with elasticsearch and one of them has an association that needs to be filtered, but if I add something like this into the search method search.filter :range, 'sessions.starts_on' => {:gte => start_date, …
alony
  • 10,725
  • 3
  • 39
  • 46
4
votes
2 answers

How do I set the default analyzer for elastic search with tire?

I have been experimenting with elasticsearch lately with ruby on rails. I am having trouble getting my data indexed so I can search for items with both plural, and non-plural keywords. Tire will allow me to assign an analyzer per mapping…
demersus
  • 1,185
  • 2
  • 10
  • 24
4
votes
1 answer

Differences between sunspot and tire gems

Currently I am using thinking sphinx for search. Now I'm considering using sunspot or tire because they automatically index new content. Are there any performance differences between the two? Is there anything else I should be concerned with?
serengeti12
  • 5,205
  • 4
  • 23
  • 27
4
votes
1 answer

Tire/ElasticSearch Single Table Inheritance Support

Cross post from GitHub: My app search for links in various 3rd-party services like Delicious, Twitter … I have following base class: class Link include Mongoid::Document include Tire::Model::Search include Tire::Model::Callbacks field…
Mario Uher
  • 12,249
  • 4
  • 42
  • 68
4
votes
2 answers

Ruby On Rails: ElasticSearch authentication (Tire and ElasticSearch-rails)

I have a Ruby On Rails app deployed on Heroku, Im using the ElasticSearch add-on, my elastic search clusters were working normally but recently ElasticSearch add-on required all clusters to enforce authentication to protect the data that is inside…
svelandiag
  • 4,231
  • 1
  • 36
  • 72
4
votes
1 answer

Rails use searchkick for multi fields

I recently add searchkick on my web app, but the research works only on the name fields. There's my code : MODEL : class Campaign [...] searchkick language: "French" [...] def self.search_fields(params) @query = "*#{params[:search]}*" …
F4Ke
  • 1,631
  • 1
  • 20
  • 49
4
votes
5 answers

Delete Elasticsearch index without deleting its mappings

How can I delete data from my elasticsearch database without deleting my index mapping? I am Tire gem and using the delete command deletes all my mappings and run the create command once again. I want to avoid the create command from being run again…
Scorpy
  • 95
  • 4
  • 11
4
votes
2 answers

Elasticsearch weird sort results

I have some data stored in elasticsearch with tire. Assume that i have such data: customer_name/ amount. Now when i'm sorting by amount everything is ok. But when sorting by name results are unexpected: These are results of sorting by name…
dfens
  • 5,413
  • 4
  • 35
  • 50
4
votes
3 answers

Rails: Elasticsearch :through association mapping

I'm trying to index a model when I have a has_many, :through association, but no results are being displayed. class Business < ActiveRecord::Base include Tire::Model::Search include Tire::Model::Callbacks def self.search(params) …
hellomello
  • 8,219
  • 39
  • 151
  • 297
4
votes
2 answers

How to perform ElasticSearch query on records from only a certain user (Rails Tire gem)

I have a Mongoid model which I perform ElasticSearch search queries on. Very standard: class ActivityLog include Mongoid::Document include Mongoid::Timestamps include Tire::Model::Search include Tire::Model::Callbacks field :extra, type:…
Cjoerg
  • 1,271
  • 3
  • 21
  • 63
4
votes
1 answer

Search multiple models with Tire and ElasticSearch

I have two models, Posts and Channels that I'm searching using Tire and ElasticSearch. Currently, everything works just fine. However, I'm performing two searches and returning the results of both. I'd like to consolidate this into one – and search…
cmw
  • 946
  • 2
  • 11
  • 26
1 2
3
33 34