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
48
votes
3 answers

How to test ElasticSearch in a Rails application (Rspec)

I was wondering how you were testing the search in your application when using ElasticSearch and Tire. How do you setup a new ElasticSearch test instance? Is there a way to mock it? Any gems you know of that might help with that? Some stuff I…
Robin
  • 21,667
  • 10
  • 62
  • 85
46
votes
3 answers

Analyzers in elasticsearch

I'm having trouble understanding the concept of analyzers in elasticsearch with tire gem. I'm actually a newbie to these search concepts. Can someone here help me with some reference article or explain what actually the analyzers do and why they are…
Vamsi Krishna
  • 3,742
  • 4
  • 20
  • 45
28
votes
4 answers

Elasticsearch 503 error when checking server status

I've been using elasticsearch as a search engine for my Rails application, however it stopped working properly due to a reason i can't understand. When making a curl request to elasticsearch server i get a 503 error. curl -XGET…
roman
  • 5,100
  • 14
  • 44
  • 77
28
votes
2 answers

Elasticsearch, Tire, and Nested queries / associations with ActiveRecord

I'm using ElasticSearch with Tire to index and search some ActiveRecord models, and I've been searching for the "right" way to index and search associations. I haven't found what seems like a best practice for this, so I wanted to ask if anyone has…
Masonoise
  • 1,573
  • 3
  • 14
  • 28
22
votes
4 answers

Multi-field, multi-word, match without query_string

I would like to be able to match a multi word search against multiple fields where every word searched is contained in any of the fields, any combination. The catch is I would like to avoid using query_string. curl -X POST…
brupm
  • 1,183
  • 1
  • 11
  • 25
21
votes
1 answer

ElasticSearch & Tire: Using Mapping and to_indexed_json

While reading the Tire doc, I was under the impression that you should use either mapping or to_indexed_json methods, since (my understanding was..) the mapping is used to feed the to_indexed_json. The problem is, that I found some tutorials where…
Alain
  • 1,251
  • 1
  • 14
  • 32
15
votes
1 answer

Elasticsearch char_filter replace any character with whitespace?

I'm using elasticsearch for my Ruby on Rails application. I want to use char_filter to replace some characters with whitepace. In tutorial of elasticsearch it says something like: "mappings" : ["ph=>f", "qu=>q"] I've tried the following: "mappings"…
İlker İnanç
  • 607
  • 3
  • 8
  • 16
14
votes
3 answers

Can't start elasticsearch server via Homebrew

So I have installed elasticsearch through brew: $ brew install elasticsearch Then when I run the elasticsearch server: elasticsearch -f -D es.config=/usr/local/Cellar/elasticsearch/0.19.3/config/elasticsearch.yml I get this error: {0.20.4}: Setup…
user592638
13
votes
1 answer

How can elasticsearch objects be boosted based on date or score

For example, if something has a higher favorites_count I want it to be more relevant, or if it is updated more recently it is more relevant. Is there a way to do this? This is different than the standard boost functionality, because these fields…
quinn
  • 5,508
  • 10
  • 34
  • 54
12
votes
1 answer

Symbols in query-string for Elasticsearch

I have "documents" (activerecords) with an attribute called deviations. The attribute has values like "Bin X" "Bin $" "Bin q" "Bin %" etc. I am trying to use tire/elasticsearch to search the attribute. I am using the whitespace analyzer to index the…
Arnob
  • 467
  • 1
  • 4
  • 13
12
votes
1 answer

Index the results of a method in ElasticSearch (Tire + ActiveRecord)

I'm indexing a data set for elasticsearch using Tire and ActiveRecord. I have an Artist model, which has_many :images. How can I index a method of the Artist model which returns a specific image? Or alternatively reference a method of the associated…
johnny.rodgers
  • 1,347
  • 1
  • 11
  • 12
11
votes
3 answers

Elastic Search/Tire: How do I filter a boolean attribute?

I want to filter the private boolean of my class so it only shows resources that aren't private but it's not working for me. (I dumbed down the code tremendously) mapping do indexes :private, type: "boolean" indexes :name, type: "string" end…
LearningRoR
  • 26,582
  • 22
  • 85
  • 150
9
votes
1 answer

ElasticSearch + Tire: good strategy to mock ES

I use ElasticSearch on the homepage of my site. In my acceptance tests, when a user logs in, he's redirected to the homepage. But using ES in a test is expensive (need to create and delete the index), so I don't want to have to do that every time a…
Robin
  • 21,667
  • 10
  • 62
  • 85
8
votes
1 answer

Elasticsearch, Tire & Associations

Running: Ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0], Rails 3.2.0 I'm trying to get elastic search working through the TIRE gem across associations. For some reason I keep getting the following error/errors when performing a rake…
DaveG
  • 1,203
  • 1
  • 25
  • 45
8
votes
1 answer

Tire - Elasticsearch - how to skip indexing on create?

I' m working on a rails app. using gem tire as a bond for elasticsearch. in a multistep form I would like to index at the end of the procedure. is there a way of skipping indexing on create. guess: Post.create( :indexing => false ) or whatever or…
1
2 3
33 34