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
0
votes
2 answers

Proxies to the real Tire methods?

I am reading the documentation for the Tire gem and I am a confused about what it mean by the following paragraphs. Could someone explain it? In fact, all this time you've been using only proxies to the real Tire methods, which live in the tire…
LuckyLuke
  • 47,771
  • 85
  • 270
  • 434
0
votes
2 answers

What is returned by a search with Tire gem in Rails

What is returned when I do a search with the Tire gem in Rails (using Active Record integration)? Is the actual models returned or is it some generic object? I don't understand what I get back.
LuckyLuke
  • 47,771
  • 85
  • 270
  • 434
0
votes
1 answer

How to sort with elasticsearch?

I am trying to make methods for sorting desc and asc. I am using rails, tire gem and elasticsearch. I am trying to figure out what sort params I can send in the URL So I have defined in the search-block that it is sorting the result desc order. sort…
user592638
0
votes
1 answer

elastic search object association querying through params

I'm having some difficulty with Elastic Search and Tire not returning any results. I'm using Ruby 1.9.3 and Rails 3.2.11. In my controller I'm calling: @location_id = 1 @listings = Listing.search(params.merge!(location_id: @location_id)) In my…
Ryan
  • 23
  • 3
0
votes
1 answer

Elasticsearch:Tire - If field is missing, put it last

I am using rails and for search I am using Tire and elasticsearch. I have a string type field which in some records have value and in some records is nil. I'd like to sort and show last, all the records that have null value in this field. As I see…
JohnDel
  • 2,092
  • 8
  • 35
  • 64
0
votes
1 answer

Tire pass param to model and use this param in search

Im trying to exclude current_user.id from my Tire search results but cannot figure how to pass a param to Tire and use that instead of a fixed value for search. How could one pass the current_user.id to the model and exclude it in search…
Rubytastic
  • 15,001
  • 18
  • 87
  • 175
0
votes
1 answer

Having trouble with mixed complex boolean with Tire (and ElasticSearch)

I've been trying to figure out how to do mixed boolean searches that use nested objects using Tire. All the simple examples I've found don't include a more complex query (when searching on other attributes). My search involves finding a Team that…
Skander
  • 118
  • 1
  • 7
0
votes
0 answers

Elastic Search equivalent of "Scoping (Scalar Fields)" in sunspot/solr

I'm exploring various options for a search engine for our rails-app/data. I was able to make sunspot/solr work and am currently exploring ElasticSearch as an alternative but couldn't get the same thing(scoping/filtering) to work under ES. I would…
letronje
  • 9,002
  • 9
  • 45
  • 53
0
votes
1 answer

How to exclude some types from tire results?

Tire.search index do query do filtered do query { string term } filter :or, { missing: { field: :group_id } }, { terms: { group_id: group_ids } } filter :not { type: "Movie" } if…
tomekfranek
  • 6,852
  • 8
  • 45
  • 80
0
votes
1 answer

Elasticsearch, Tire, and Nested fields with ActiveRecord

Please read this answer to a similar question I have below Elasticsearch, Tire, and Nested queries / associations with ActiveRecord Lets say I added the following field the the Book model provided in the question above: field :account_tags, type:…
Craig Heneveld
  • 389
  • 2
  • 7
0
votes
1 answer

Elasticsearch/tire Nested Queries with persistant objects

I'm trying to use Tire to perform a nested query on a persisted model. The model (Thing) has Tags and I'm looking to find all Things tagged with a certain Tag class Thing include Tire::Model::Callbacks include Tire::Model::Persistence …
Chris Lowis
  • 560
  • 4
  • 14
0
votes
0 answers

Rails tire search take datas by comparing with created_at

I am using tire to search in my Rails application. I want to take data by comparing with created_at field. ie, giving conditions like created_at > '2013-01-01' I read a method named excludes, But I couldn't see any tutorial for how to use this.
Jyothu
  • 3,104
  • 17
  • 26
0
votes
1 answer

How to write task for reindex all ES indexes in Tire?

For now I have: desc "Index Elastic Search" namespace :tire do namespace :import do task all: :environment do aliases = Tire::Configuration.client.get(Tire::Configuration.url + '/_aliases').body indexes_names =…
tomekfranek
  • 6,852
  • 8
  • 45
  • 80
0
votes
1 answer

Problems with tire and sorted search

I'm trying to do a sorted search using the tire gem but i always get this error: Parse Failure [No mapping found for [occupation] in order to sort on]] what's wrong with my code? following is my user model class User include Mongoid::Document …
danielgatis
  • 737
  • 7
  • 19
0
votes
1 answer

ElasticSearch / Tire - Facets are not filtered by the query?

I have an ElasticSearch / Tire query that has facets attached. It seems the facets a using the global scope, instead of the query scope and filters. Here is my definition. I'm not sure how to scope the it to use the filters. def…
Williamf
  • 595
  • 4
  • 14