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

Leaderboard ranking via elasticsearch (with tire)

I have a mapping that boils down to the following (unrelated fields removed): mapping indexes :id, type: 'integer', index: :not_analyze indexes :first_name, boost: 5, type: 'string', analyzer: 'snowball' indexes :votes, type:…
Jim Neath
  • 1,217
  • 2
  • 14
  • 19
4
votes
2 answers

select distinct from elasticsearch

I have a collection of documents which belongs to few authors: [ { id: 1, author_id: 'mark', content: [...] }, { id: 2, author_id: 'pierre', content: [...] }, { id: 3, author_id: 'pierre', content: [...] }, { id: 4, author_id: 'mark',…
Adit Saxena
  • 1,617
  • 15
  • 25
4
votes
2 answers

Rails, Tire, and CircleCI: Getting a Errno::ECONNREFUSED error when running rspec tests when creating Tire-Searchable objects

I have a project that is using CicleCI for testing, and I'm trying to integrate Tire for a search functionality. Locally, all the tests run fine with no issue. However, when CircleCI runs the test, I'm getting a Errno::ECONNREFUSED : Connection…
justindao
  • 2,273
  • 4
  • 18
  • 34
4
votes
2 answers

ElasticSearch Bulk Delete by id

I'm attempting to do a bulk delete by ids and it appears to be not working. When I run my test suite and try via the Rails console, it seems to work OK. However, I'm running into occurrences where there are documents that simply don't get removed.…
Jey Balachandran
  • 3,585
  • 5
  • 27
  • 36
4
votes
3 answers

Ignoring Apostrophes (Possessive) In ElasticSearch

I'm trying to get user submitted queries for "Joe Frankles", "Joe Frankle", "Joe Frankle's" to match the original text "Joe Frankle's". Right now we're indexing the field this text is in with (Tire / Ruby Format): { :type => 'string', :analyzer =>…
LMH
  • 949
  • 9
  • 22
4
votes
2 answers

Pagination with Elasticsearch, Tire, and Kaminari

I'm having issues getting pagination of search results to work with Elasticsearch, Tire, and Kaminari. I am searching on all models in my application (news, paintings, books) as a general site search and therefore, need a block for the tire search,…
anthony
  • 391
  • 1
  • 3
  • 15
4
votes
1 answer

Prevent some models from being indexed with Tire in a Rails app

I have a searchable Item model in my Rails app. I want to index the majority of those in ElasticSearch, EXCEPT the ones that fulfill some condition. How can I do that? Is overriding update_index in the model an acceptable solution? I know I could…
Robin
  • 21,667
  • 10
  • 62
  • 85
4
votes
1 answer

Tire + Elastic Search - Forcing Import

In the tire gem's README, I see they propose two ways to import a model: rake environment tire:import CLASS='Article' rake environment tire:import CLASS='Article' FORCE=true I can appreciate that the FORCE=true will delete the index before…
zilla
  • 909
  • 1
  • 11
  • 17
4
votes
2 answers

Error loading custom synonym file in Elasticsearch

I am using Rails, Tire and Elasticsearch on EC2 single server setup, no sharding or replication (this is the Jenkins CI Server). With a custom initializer as such: analysis: filter: name_synonyms: type: synonym …
brupm
  • 1,183
  • 1
  • 11
  • 25
4
votes
1 answer

ElasticSearch/Tire: Find similar articles

My Rails project implements the ElasticSearch using the Tire gem. I would like to find records with similar text in a field called description. I would like to order results based on how similar the record is (%). Example of a similar tekst: 1. Hi…
xpepermint
  • 35,055
  • 30
  • 109
  • 163
4
votes
1 answer

What does setting the index to not_analyzed do when index mapping using elasticsearch?

What does :index => :not_analyzed do if I map it to a field or if I don't add it to a field? I couldn't find a definition on the main github tire page or in the elasticsearch.org website. Example of the code: class Article < ActiveRecord::Base …
perseverance
  • 6,372
  • 12
  • 49
  • 68
4
votes
1 answer

ElasticSearch Scoring (Tire gem)

I want ElasticSearch (Tire gem to be specific) to return the result based on the number of times a keyword appears in the fields. For example, I index the field title in a model called Article. I have two objects, the first object has the title…
RubyFanatic
  • 2,241
  • 3
  • 22
  • 35
4
votes
2 answers

Elastic Search/Tire: How to map to association attribute?

I'm using Tire for Elastic Search. In my application I have 2 models; Price and Product. I'm trying to search my Price class and use the Product it belongs to's :name attribute for the search field. Right now if I had a product called Product 1 and…
LearningRoR
  • 26,582
  • 22
  • 85
  • 150
4
votes
2 answers

How to prevent attachments from being stored in _source with Elasticsearch and Tire?

I've got some PDF attachments being indexed in Elasticsearch, using the Tire gem. It's all working great, but I'm going to have many GB of PDFs, and we will likely store the PDFs in S3 for access. Right now the base64-encoded PDFs are being stored…
Masonoise
  • 1,573
  • 3
  • 14
  • 28
3
votes
0 answers

No feature for name ['/appointments'] exception elasticsearch on heroku using Tire gem

I am using Tire gem in rails application for elasticsearch and for heroku i am using seachbox add-on.Things are working perfectly in my local machine but on heroku it gives an error while creating and index which is [ERROR] There has been an error…
Pratha
  • 61
  • 4