Tagged Questions
36
votes
3answers
8k views
How to test ElasticSearch in a Rails application (Rspec)
I was wondering how you were testing the search in your application when using ElasticSearch and Tire.
How do you setup a new ElasticSearch test instance? Is there a way to mock it?
Any gems you ...
9
votes
1answer
2k views
ElasticSearch + Tire: good strategy to mock ES
I use ElasticSearch on the homepage of my site. In my acceptance tests, when a user logs in, he's redirected to the homepage.
But using ES in a test is expensive (need to create and delete the ...
6
votes
2answers
2k views
Installed elasticsearch using homebrew and cannot locate the config files
I installed elasticsearch using homebrew and I want to make some configurations to it but I can't find the folder it was installed to. I'm looking for the configuration files as state here. Using ...
6
votes
1answer
2k views
How to limit the total returned results when using ElasticSearch with Tire (A Ruby on Rails Gem)?
I tried to use Post.search(keyword, :size => 10) and Post.search(keyword).size(10). but non of these will work.
5
votes
3answers
5k views
Elastic Search/Tire: How do I filter a boolean attribute?
I want to filter the private boolean of my class so it only shows resources that aren't private but it's not working for me. (I dumbed down the code tremendously)
mapping do
indexes :private, ...
5
votes
1answer
832 views
How to get elasticsearch to perform similar to SQL 'LIKE'
If using a SQL 'Like' statement to query data it will return data even if its only partially matched. For instance, if I'm searching for food and there's an item in my db called "raisins" when using ...
4
votes
3answers
3k views
tire + elasticsearch tutorials please
I am implementing elasticsearch using tire in my project. Can any one please guide me to a good tutorial for tire?
4
votes
1answer
6k views
Can't start elasticsearch server via Homebrew
So I have installed elasticsearch through brew:
$ brew install elasticsearch
Then when I run the elasticsearch server:
elasticsearch -f -D ...
4
votes
1answer
929 views
Tire/ElasticSearch Single Table Inheritance Support
Cross post from GitHub:
My app search for links in various 3rd-party services like Delicious, Twitter … I have following base class:
class Link
include Mongoid::Document
include ...
3
votes
2answers
804 views
Multiple facet filters with Elasticsearch
How can I apply multiple filters to facet (with tire gem)? I have a code:
facet "packages" do
terms :package
facet_filter :terms, producer: [*params[:producer]] if params[:producer].present?
...
3
votes
3answers
1k views
Elastic Search Console
Is there any console interface available for ElasticSearch similar to Ruby IRB or Rails console? Is there any GUI tool to query ElasticSearch?
3
votes
1answer
760 views
How to work with elasticsearch and associations between index objects?
I am using the Tire gem for Rails and a couple of questions have been raised about model associations. How do you work with them? Let say you have a relation between a Person and a car. Each Person ...
3
votes
1answer
2k views
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 = ...
2
votes
2answers
3k views
Elastic Search vs Sunspot comparison on features
Couden't find any compare questions related to sunspot (Solr) to Elastic Search (Lucene)
What would be the pro's and con's on both search engines?
I saw other VS questions to get a better inside in ...
2
votes
1answer
1k views
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] ...
2
votes
1answer
616 views
searchkick index related model fields
I have a rails application and I'm switching from Sphinx to ElasticSearch and using the gem searchkick.
I have a model Teacher and a model Tags (via a gem), where a Teacher can have multiple tags ...
2
votes
1answer
499 views
Authorize elasticsearch results with cancan
Do you have any suggestions how to perform authorization of elasticsearch results (using tire) with cancan?
My approach would be to let cancan load and authorize the models and pass in all authorized ...
2
votes
2answers
4k views
connection error with tire/elasticsearch remote server
I have installed a ubuntu 12.04 remote server with elasticsearch.
I have installed elasticsearch with:
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
wget ...
2
votes
1answer
1k views
Search multiple models with Tire and ElasticSearch
I have two models, Posts and Channels that I'm searching using Tire and ElasticSearch.
Currently, everything works just fine. However, I'm performing two searches and returning the results of both. ...
2
votes
2answers
703 views
checking environment tire.rb file
This is my config/initializers/tire.rb file:
if Rails.env.production?
Tire.configure do
url "http://remoteserver.com:9200"
end
end
If I try on my production server:
bundle exec rake ...
2
votes
2answers
913 views
Update ElasticSearch mapping in production (Tire)
I would like to have a clear understanding on how to deal with the following scenario:
I'm adding or removing an attribute from an activerecord model, so I want to update its mapping in ...
2
votes
1answer
356 views
'Warning: Non-executables were installed to “bin” ' when installing elasticsearch via homebrew
I'm following this railscast to get elasticsearch going in my rails app. When I install it using homebrew like the railscast shows, I get this warning
Warning: Non-executables were installed to ...
2
votes
1answer
472 views
Join / split search words in elasticsearch (using tire)
I have the following analyzer (a slight tweak to the way snowball would be setup):
string_analyzer: {
filter: [ "standard", "stop", "snowball" ],
tokenizer: "lowercase"
}
Here is the ...
2
votes
2answers
316 views
Elasticsearch Tire on rails, return all males in age range but it returns the woman too
Using elasticsearch and Tire im trying to search a few profile records.
Try to get results where gender = male and age_from = 18, age_to = 30. Currently with this setup it returns everyone that is ...
2
votes
1answer
2k views
Elasticsearch may have failed to start..tried multiple versions
I am keep getting above error ..
i need to setup elasticsearch on my local machine
I followed github & original website both with 0.20.2 & 0.19.2 version but still have the same issue .i ...
2
votes
2answers
720 views
How do I limit Tire/ElasticSearch results by association?
I have a collection of posts that are within categories and subcategories using a belongs_to association. Additionally, the posts have a belongs_to relationship with my state and city models.
I am ...
2
votes
2answers
295 views
how to use Tire for getting data from Elasticsearch index and without hitting database
I am using Tire for implementing Elasticsearch. My environment is Linux,Rails 3.2 with Ruby 1.9.3.
I am able to index using Elasticsearch with the help of gem Tire(0.5.8).
But now to improve ...
1
vote
2answers
2k views
How do I search with multiple queries on the same field in elasticsearch?
I'm using ElasticSearch and tire.rb to index and search my collection of items.
I want to query on the name field in my index.
If I have a document with the name: Alfa Romeo, I would like to find ...
1
vote
1answer
2k views
Tire + Elasticsearch: How to search ranges of values?
Love Tire and elasticsearch so far but can't figure out how to search values between ranges like:
age_from age_to
18 to 20
And return all Profile's where the age is between these 2 ranges?
I have ...
1
vote
1answer
1k views
ElasticSearch + Tire: OR query
I have some trouble defining a query with Tire.
What I have:
My documents are events. They have a starts_at date, and a ends_at date.
The ends_at date is not required.
What I want:
I want to ...
1
vote
1answer
185 views
unable to send rails logs into graylog2
I am newbie for graylog2 , i installed graylog2 along with web interface . I am getting TCP syslogs into graylog server from other servers . But i am unable to get GELF HTTP logs sending through Rails ...
1
vote
2answers
207 views
How to sum boost points of elasticsearch results and sort them?
I have User model.
class User < ActiveRecord::Base
attr_accessible :last_visited_at, :friend_id, :blacklisted
has_many :friends
end
And conditions:
If phrase exist in description, give ...
1
vote
2answers
972 views
Parse elasticsearch response in RestClient
I'm writing a Rails 3 application using Datamapper as an ORM. I'm looking at using ElasticSearch for searching but can't use the Tire gem as it seems to depend on ActiveRecord.
I'm using RestClient ...
1
vote
1answer
160 views
tire and elasticsearch_autocomplete accents and facets
I'm using elasticsearch_autocomplete gem for autocomplete feature.
I have a problem with special characters ñ and accents áéíóú.
Model:
class Car
ac_field :name, :description, :city, ...
1
vote
2answers
120 views
How to Boost The relevance dynamically(boost value get from database) in Tire elasticsearch
if the search term provided by an end user contains any of the words or phrases (but does not need to be an exact match) contained in the Decrease_Relevance_Text field, then the relevance for that ...
1
vote
1answer
159 views
Elasticsearch mapping does not include attributes from Rails key-value store
Model:
class Item
store :socket_store, accessors: [:sockets, :socket_count, :socket_link_count]
end
Mapping:
mapping do
indexes :id, key: "value", index: :not_analyzed
...
1
vote
1answer
84 views
elasticsearch / tire how to correctly return default recordset?
What would be the best way to approach the return of a default recordset? If no search results are returned. Currently using below code but it feels not the correct way.
def self.search(params)
...
1
vote
1answer
437 views
ElasticSearch / Tire & Keywords. Right way to match “or” for a keyword list?
I've got an Entity model (in Mongoid) that I'm trying to search on its keywords field which is an array. I want to do a query where I pass in an array of potential search terms, and any entity that ...
1
vote
1answer
431 views
Elasticsearch/Tire text query DSL for excluding certain fields from being searched
I have a elastic search query like the following,
{
"query": {
"bool": {
"must": [
{
"query_string": {
"fields": ["title"],
"query": "test"
...
1
vote
0answers
131 views
Using Elasticsearch Facets in a dropdown menu
I'm using Tire with Elasticsearch, and have followed this railscast tutorial with success: http://railscasts.com/episodes/307-elasticsearch-part-2
I've setup a facet that allows users to filter ...
1
vote
0answers
135 views
Elastic search mapping issue with tire
Following is the mapping in Occurrence model
mapping do
indexes :_event_id, type: 'integer', index: :not_analyzed,boost: 1000
indexes :start, type: 'date', index: :not_analyzed , boost: 100
...
1
vote
0answers
151 views
Tire not working with will_paginate in controller
I'm currently searching two models (Posts and Channels), using Tire and ElasticSearch.
I need to add pagination using will_paginate. The issue is, Tire doesn't appear to support will_paginate in the ...
1
vote
0answers
104 views
how to use Tire to get Elasticsearch model with includes models(there are 3)
I want to replace AR models(job listing) having includes models(for eager loading) with Elasticsearch model. This is required to get the data without hitting database.
I have added indexes with ...
1
vote
1answer
66 views
Make item “Private” in rails
App Attributes:
Rails 3.2, Mongoid, Devise, Elasticsearch
Basic Structure:
User has a Post
Post can be seen by other users
Situation:
A User wants to remove the post from being view-able by ...
1
vote
1answer
148 views
get random result of Tire::Results::Collection
I have inside this variable @results a Tire::Results::Collection with many results.
How can I get 1 random result of this Tire::Results::Collection
Thanks!
1
vote
1answer
359 views
Using SQL with elastic search and tire
With my current setup I need to add some custom SQL statement that scopes some data with the Tire Gem.
I'm using Rails 3.2 with Ruby 1.9.3
In my Listing controller, I have the following:
@listings ...
1
vote
1answer
464 views
Tire and Elastic Search - Object Associations
I'm having a little difficulty with the Tire and Elastic Search functionality.
I have a Listing that has a Property. I'm trying to get a basic search form working so that I can create a query from ...
1
vote
0answers
169 views
Tire not seeing singular/plural?
From everything I have read this should work. I'm re-indexing after each change.
My category names are stored as plural, e.g. "books", "movies" or "tapes". In rails terms this is the same as ...
1
vote
1answer
759 views
Delta indexing the elastic search index on change of model's association record value change using Tire and Elastic Search
I am a newbie to elastic Search and Tire in Ruby on Rails. Watched the railscasts from ryan bates and helped me to get going. Tire is a great gem and has functionality to delta indexing. Assuming i ...
1
vote
1answer
719 views
Tire / Elasticsearch for HABTM associated models
I am trying to implement a full-text searching with tire/elasticsearch for my Client model. I have a set of users, working with clients. There is a HABTM association between Client and User models.
...