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

How to define a Tire property of type nested in a ActiveRecord mapping block?

I have a Rails application where a topic can be followed by various users. I want to be able to find a topic matching a name and followed by a specific user. Only using a Tire query statement, without a filter. For that I intend to use a boolean…
Florent2
  • 3,463
  • 3
  • 28
  • 38
0
votes
1 answer

Creating a no-database rails model that would serve as a view to index data in elasticsearch

I'm facing a complex problem which i haven't been able to resolve yet. I'm using Rails 4(edge) with postgresql 9, ElasticSearch 0.20.6 and the gem Tire (0.5.7). I have multiple table that are linked together. for instance: Agency has many…
Crystark
  • 3,693
  • 5
  • 40
  • 61
0
votes
1 answer

Tire Elastic search: Deleting a record from model and redirecting immediately throws error

I am having a model named User. When I destroy a user and redirect to the User's index page, it throws an exception ActiveRecord::RecordNotFound: Couldn't find all Users with IDs (1, 200) (found 1 results, but was looking for 2) But when I refresh…
deniro
  • 23
  • 5
0
votes
1 answer

tire working with several elastic instances.. how?

I'm digging into Tire gem documentation. I need some way to search against another elastic instance or create index on another elastic instance. Don't ask me why - it's architecture problem. We can define some basic settings within…
Volodymyr
  • 1,136
  • 3
  • 11
  • 28
0
votes
1 answer

elasticsearch highlighting error, failed to highlight ... String index out of range

I cannot make head or tail of this error, and it's happening pretty randomly to where I don't even know where to start looking. This is what the full error looks like Tire::Search::SearchRequestFailed: 500 : { "error":…
concept47
  • 30,257
  • 12
  • 52
  • 74
0
votes
1 answer

query by date vs query by time

I assume that application code should store time in database always as UTC ( punch me if I am wrong) Now lets say I want to query everything between 23-mar-2013 to 24-mar-2013 . Should I create a time object and then query something like…
Gaurav Shah
  • 5,223
  • 7
  • 43
  • 71
0
votes
2 answers

Filter result based on a count of inner data

I am building my search query for some listing data. As part of the search people can ask for multiple rooms which sleeps a min amount of people, ie two rooms which sleep 2 and 3 people. Im not sure how I can perform that with a filter. Here is a…
Lee
  • 20,034
  • 23
  • 75
  • 102
0
votes
1 answer

ElasticSearch with Tire doesn't include custom analyzer with STI model

I have an STI model which I want to be searchable with ElasticSearch and Tire. The issue I am having is when Tire creates the mappings it seems to ignore my custom analyzers for the second model. Below is an example of my models. class Account <…
0
votes
1 answer

Alternative syntax for ElasticSearch vs ThinkingSphinx

Please have a look on below code, Its the normal indexing statement for thinking sphinx indexes owned_tags.name, :as => :owned_tag_names has owned_tags.id, :as => :owned_tag_ids, :facet => true Can any one guide what would be the syntax to have…
Nazar Hussain
  • 5,102
  • 6
  • 40
  • 67
0
votes
1 answer

elasticsearch stops indexing new documents after a while, using Tire

I have my website running, with ElasticSearch, using Tire. In the background, I have a rake task that is looping over thousands of objects and creating one record for each of them. At first, the records are indexed, and every time I refresh my…
Robin
  • 21,667
  • 10
  • 62
  • 85
0
votes
2 answers

Elasticsearch sort based on the number of occurrences a string appears in an array

I have an array field containig a list of strings: ie.: ["NY", "CA"] At search time I have a filter which matches any of the strings in the array. I would like to sort the results based on documents that have the most number of appearances of the…
brupm
  • 1,183
  • 1
  • 11
  • 25
0
votes
3 answers

error tire elastic search if I write ":" colon character

This is my tire setting: def self.search(params) tire.search(load: true, page: params[:page], per_page: 9) do query do boolean do must { string params[:query], default_operator: "AND" } if params[:query].present? …
hyperrjas
  • 10,666
  • 25
  • 99
  • 198
0
votes
1 answer

Config Tire to work with Bonsai ElasticSearch Heroku add-on

So I have a rails 3.2 app. I created an index. I followed this guide: https://gist.github.com/nz/2041121 to create an bonsai.rb file in config/initializers/bonsai.rb It looks like this: ENV['ELASTICSEARCH_URL'] = ENV['BONSAI_URL'] # Optional, but…
user592638
0
votes
1 answer

EdgeNGram with Tire and ElasticSearch

If I have two strings: Doe, Joe Doe, Jonathan I want to implement a search such that: "Doe" > "Doe, Joe", "Doe, Jonathan" "Doe J" > "Doe, Joe", "Doe, Jonathan" "Jon Doe" > "Doe, Jonathan" "Jona Do" > "Doe, Jonathan" Here's the code that I…
zilla
  • 909
  • 1
  • 11
  • 17
0
votes
1 answer

ElasticSearch in rails not returning the expected pluralised response

I'm just implementing elasticsearch on my database of foods, and I'm having difficulty understanding why I'm seeing the results I'm seeing. I'm searching the USDA food database. When I pass in the query for Banana, I get back all forms of singular…
pedalpete
  • 21,076
  • 45
  • 128
  • 239