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

ElasticSearch & Tire. Search for an object with nested attributes

I've spent several hours trying to solve the problem. I hope someone can help me. First, here's some code to illustrate the structure: class Company < ActiveRecord::Base include Tire::Model::Search include Tire::Model::Callbacks …
0
votes
1 answer

How to test tire indexed_json results?

I would like to test my search method but how to test to_indexed_json results. Here is my test: describe Search do before do Question.index.delete Question.tire.create_elasticsearch_index app = create :app, name: "Marketing", id: 76 …
tomekfranek
  • 6,852
  • 8
  • 45
  • 80
0
votes
1 answer

How to filter search collection only if resource has specific attribute?

I am using Elastic Search and Tire in searching. I created Search class for searching across all my models. class Link < ActiveRecord::Base ... tire.mapping do indexes :id, :type => 'string', :index => :not_analyzed indexes :app_id,…
tomekfranek
  • 6,852
  • 8
  • 45
  • 80
0
votes
1 answer

Filter ElasticSearch results by Mongo _id

I'm currently using Mongoid/MongoDB for my database with Tire/ElasticSearch. I want to filter my results based on an array of _id's. Here is some pseudo-code similar to what I'm attempting: search = Tire::Search::Search.new() search.filter :terms,…
Nick
  • 9,493
  • 8
  • 43
  • 66
0
votes
1 answer

ElasticSearch / Tire with rails: no parser for element

I'm using elasticsearch with tire gem for Ruby on Rails. so far so good, I have a successfull range facet on dates, but now i'm trying to do the same for a float field and it is giving me 'no parser for element' errors. mapping indexes :budget,…
bobomoreno
  • 2,848
  • 5
  • 23
  • 42
0
votes
2 answers

Single index multi type - elasticsearch indexing via tire

In my multi-tenant app (account based with number of users per account), how would I update index for a particular account when a user document is changed. I have a separate index for each account, in which the mappings for each model (user and…
Vamsi Krishna
  • 3,742
  • 4
  • 20
  • 45
0
votes
1 answer

How do I get Tire to filter by current_team?

I am implementing Elasticsearch using Tire (and Ryan Bates' railscasts) as a site-wide search. It searches across multiple models. I would like for it to filter by current_team. I have at least two problems: 1) hard-coding the filter to 'team 2'…
Jon Lehman
  • 19
  • 6
0
votes
1 answer

Multiple mappings per ActiveModel/Record?

Lets say I want to create two separate indexes on something like BlogPosts, so that I can do a quick search using one index (for autocomplete purposes for example) then use the other index for full blown search querying. Is that something I can do…
concept47
  • 30,257
  • 12
  • 52
  • 74
0
votes
1 answer

search not returning matches I want with ngram filter

My elastic search setup is something like this :analyzer => { :default => { :type => "custom", :tokenizer => "whitespace", :filter => ["lowercase", "standard", "my_ngram"] } …
concept47
  • 30,257
  • 12
  • 52
  • 74
0
votes
1 answer

Sharing settings between elasticsearch indexes for ActiveRecord models (Tire gem)

I have tire working correctly for a single ActiveRecord model in the format setting do ...SETTINGS... mapping do ...INDEXES... end end If possible I would like to share these settings between multiple models. I can't find any way of doing…
Felix
  • 674
  • 5
  • 16
0
votes
1 answer

How can I set up Elastic Search's minimum_number_should_match within Tire?

I'm having a bit of trouble setting the minimum_number_should_match within my boolean query. I'm wondering how I can set that. Also, what is the default? options = {:minimum_number_should_match => 1} result = tire.search(load: true, page:…
Kirk
  • 1,521
  • 14
  • 20
0
votes
1 answer

Boosting results of a query in Tire, if match particular ID?

I have an ElasticSearch database that has "pages" in it. class Page field :domain_id field :page_id field :title field :description field :filetype field :content end Each page has an ID of a domain. I'd like to be able to boost…
Williamf
  • 595
  • 4
  • 14
0
votes
1 answer

Facet with all_terms: true on index alias

I have an multi-tenant application that uses index aliases with filters. There is just one issue... when I use facet('tags') { terms :tags, all_terms: true } it returns all terms for the complete index and not the ones that match the current…
spas
  • 1,914
  • 14
  • 21
0
votes
2 answers

Elastic search with Tire: Custom stopwords not working

I want to add a custom set of stopwords to one particular field in a model. So I added a custom analyzer for that field. But still when I search with the stopwords, results are showing up. The code inside my model is as follows: settings :analysis…
deniro
  • 23
  • 5
0
votes
1 answer

How to connect tire to an external server?

It should have been easy to find but somehow we didn't find out How to connect tire* to an external server? *Tire is A rich Ruby API and DSL for the ElasticSearch search engine
Anno2001
  • 1,343
  • 12
  • 17