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

RSpec & Tire gem: test for Tire::Results::Collection

Trying understand syntax for testing around the Tire gem. This controller spec (default from a scaffold template) is failing describe "GET index" do it "assigns all reports as @reports" do report = Report.create! valid_attributes …
Meltemi
  • 37,979
  • 50
  • 195
  • 293
3
votes
1 answer

How to add facet in Tire (elasticsearch) to has_many association

I want to add facet to has_many association. I am migrating from PostgreSQL fulltext search to elasticsearch. Currently I have following SQL query to do search (PostgreSQL way): rt = "#{Rule.table_name}" Sentence. …
nothing-special-here
  • 11,230
  • 13
  • 64
  • 94
3
votes
1 answer

fields not in mapping are included in the search results returned by ElasticSearch

I want to index pdf attachment using Tire gem as client for ElasticSearch. In my mapping, I exclude the attachment field from _source, so that the attachment is not stored in the index and not returned in the search results: mapping :_source => {…
Tuan Nguyen
  • 305
  • 2
  • 10
3
votes
1 answer

Elasticsearch and Tire Gem: "IndexMissingException[[products] missing]"?

I'm not sure how I get my products to index because I think thats why I get this error: Tire::Search::SearchRequestFailed in SearchController#results 404 : {"error":"IndexMissingException[[products] missing]","status":404} Here is my Products…
LearningRoR
  • 26,582
  • 22
  • 85
  • 150
3
votes
1 answer

Getting ElasticSearch to score number of total nested hits across results (idf?) higher than tf of single hit?

Forgive me if I'm munging the terminology, but I am having problems getting ES to score results in a way that makes sense for my app. I am indexing thousands of Users with several simple fields, as well as potentially hundreds of child objects…
thoughtpunch
  • 1,907
  • 4
  • 25
  • 41
3
votes
2 answers

How can I stop meta_search from defining search on my models?

I'm using active_admin and that's bringing in meta_search to my project. (Which I don't want to use for anything else). It seems to be defining the search method on all my models, which then means when I include tire, I can't use it's search…
Jords
  • 1,855
  • 3
  • 18
  • 28
3
votes
1 answer

Why is the elasticsearch index not updating in my mongo rails app?

I'm using the tire gem in my rails 3.2 mongo app and I am having issues with elasticsearch not updating. I included my question model below. class Question include Mongoid::Document include Mongoid::Timestamps include Mongoid::Paranoia …
mike
  • 2,722
  • 6
  • 31
  • 46
3
votes
2 answers

Tire/Elasticsearch search for association

I have the following code and i'm trying to use ElasticSearch to query it. It is working when i do Book.search(:q=>'Foo') but it doesn't work when i do Book.search(:author=>'Doctor'). In my database I have a entry with a name like "Barz, Foo,…
VP.
  • 5,122
  • 6
  • 46
  • 71
2
votes
1 answer

i18n search using tire and Globalize3

i have a site that uses globalize3 gem (https://github.com/svenfuchs/globalize3) and i'm currently adding the Tire gem to make site search. How do i do to Index a table translations depending on the actual locale? right now the model that gets…
2
votes
3 answers

Facet Troubles with Elasticsearch on Query

When adding a term to my query instead of a filter I am getting 0 facets. FYI I am using the tire gem with Ruby. Here is my model code with its mapping: class Property < ActiveRecord::Base include Tire::Model::Search include…
Lee
  • 20,034
  • 23
  • 75
  • 102
2
votes
1 answer

Ruby on rails -elasticsearch tire impoting existing db

I have a Ruby on rails 3.2 application. I want to enable text based search on a model that has a lot of data already populated in it. Suppose the name of the model class is Post. I am planning on using elasticsearch since I heard it is one of the…
nightf0x
  • 1,969
  • 3
  • 17
  • 24
2
votes
1 answer

How to create a bool query with minimum_number_should_match when using queries saved as blocks

I'm using tire with elasticsearch, and I'm stumped how to create a boolean query with the minimum_number_should_match option while also tossing it a set of queries stored in a block. So, I have options = {:minimum_number_should_match => 1} s =…
timting
  • 57
  • 7
2
votes
1 answer

Error using Tire persistence

I have an ActiveAdmin app with a simple model that I want to persist in Elastic Search with Tire: class Person include Tire::Model::Persistence property :firstName property :lastName end But I get this error on the index…
DarylWM
  • 151
  • 2
  • 7
2
votes
1 answer

Tire (elasticsearch) is not updating when I do a update_all()

I am using Tire in ruby on rails to connect with ElastiSearch. When I modify an element's parameters with update_attributes, Tire automatically updates the index to reflect this change. However, when I modify many elements simultaneously by doing…
Razor Storm
  • 12,167
  • 20
  • 88
  • 148
2
votes
1 answer

No handler found for uri [/ModelName] and method [POST]

Trying to deploy rails app on heroku production with Elasticsearch and Tire. Heroku bonsai addon is added but still after running this command heroku run rake environment tire:import CLASS=Property FORCE=true getting error: 400 : No handler…
webber
  • 23
  • 2
  • 8