Questions tagged [sunspot-rails]

Sunspot Rails Plugin

Sunspot Rails is a Rails plugin that provides drop-in integration of the Sunspot[http://outoftime.github.com/sunspot] Solr search library with Rails

411 questions
17
votes
3 answers

sunspot_rails not re-indexing model after save

I have a model which deploys a delayed job that updates some of its attributes. The model is declared "searchable"... searchable do text :content, :stored => true end ... which I thought would re-index after a save. On testing, this doesn't…
Newy
  • 38,977
  • 9
  • 43
  • 59
16
votes
3 answers

Sunspot rails: include associated models when calling .results

Let's say that I want to search for Events in my app. When I display the results, I want to display who created the event, for instance. Is there any way to add .includes(:user) somewhere, to avoid unnecessary queries (one for each event)? I can't…
Robin
  • 21,667
  • 10
  • 62
  • 85
15
votes
2 answers

How does Sunspot modify Solr's schema.xml? Does it modify it at all?

Let me know if I am wrong, but I think solr only expects fields that are already mentioned in the schema.xml. So, if I have a field called 'title', I need to mention this in the schema. There is no mentioning about modifying the schema.xml in the…
denniss
  • 17,229
  • 26
  • 92
  • 141
14
votes
7 answers

SocketError (getaddrinfo: Name or service not known) - Sunspot/Solr Rails development

I have had lots of trouble with deploying my rails 3.0.10 application to Ubuntu 10.04 server with Passenger, Capistrano, nginx and MySQL (and even more trouble with apache2). After downgrading rake to 0.8.7 it's finally working, but now Sunspot/Solr…
Johan Hovda
  • 855
  • 2
  • 10
  • 23
13
votes
5 answers

Sunspot_Rails - undefined method `searchable' on page

I have a model with a searchable block, like so: class Contact < ActiveRecord::Base searchable do text :contact_name, :company_name, :contact_email end end In the controller's index action, I'm calling Contact.new, which is giving me an…
PaulC
  • 491
  • 6
  • 18
9
votes
6 answers

How to implement faster Search As You Type (SAYT) api in Rails 3 application

I am having millions of records in my mysql database. I implemented a normal REST api for the iPhone app in Rails 3, but the SAYT feature response is really slow. It takes a lot of time to search the database and return the results. How can I…
Amal Kumar S
  • 15,555
  • 19
  • 56
  • 88
9
votes
1 answer

Rails Sunspot gem: Usings facets with multiple model site-wide searches

I'm trying to implement a sitewide search through the powerful Sunspot gem for Rails. This involves a search across multiple, very different models at once. What I WANT to do is use the faceting feature to allow the user to filter their search…
chrisk
  • 235
  • 3
  • 6
9
votes
3 answers

Rails 4: RSolr::Error::Http (RSolr::Error::Http - 404 Not Found

I am in the process of upgrading my app to Rails 4, and now got my rails server, as well as sunspot solr, after a lot of tinkering, to run, I can access Solr admin page. However when I try to access solr from my rails development app to do search or…
8
votes
1 answer

Sunspot solr search, how to return all records at once?

I am using solr via sunspot in my rails application where I need to return more than 30 records which is set by default. I can do it as told in Sunspot solr but i don't want pagination for the data. I want to display all the data in a single page…
Bijendra
  • 9,467
  • 8
  • 39
  • 66
8
votes
1 answer

Sunspot Index Only When Searchable Fields Change

We are using sunspot for search in our latest project. We also use devise and are indexing our user model as follows: searchable do text :fname text :lname text :email text :description text :twitter_username end With this setup, a user…
ghempton
  • 7,777
  • 7
  • 48
  • 53
7
votes
2 answers

Querying multiple models with different attributes using Sunspot

I'm using Sunspot to index and search several models in a Rails project and I need to limit results based on the models' HABTM associations with a Department model. This is because users may not have permission to see records in all departments so…
Simon
  • 1,716
  • 1
  • 21
  • 37
6
votes
3 answers

How do I dynamically build a search block in sunspot?

I am converting a Rails app from using acts_as_solr to sunspot. The app uses the field search capability in solr that was exposed in acts_as_solr. You could give it a query string like this: title:"The thing to search" and it would search for that…
Richard Hulse
  • 10,383
  • 2
  • 33
  • 37
6
votes
2 answers

sunspot_rails unable to index due to "404 Not Found" error

I'm trying to install Sunspot in a small Rails app, exactly following the gem setup instructions, but every time I run into RSolr::Error::Http: RSolr::Error::Http - 404 Not Found errors when I try to index data. I can reproduce this with a fresh…
Topher Hunt
  • 4,404
  • 2
  • 27
  • 51
6
votes
2 answers

View raw Solr tokens for a single field on a single document

I'm debugging my Solr schema and I'd like to see the results of tokenizing a specific field. For a simplified example, if I have:
tristanm
  • 3,337
  • 2
  • 27
  • 40
5
votes
0 answers

Setting up sunspot geolocation scenario

I am using Sunspot for searching and using Geocoder for addresses and then for calculating distances, Geokit-rails3. class Product < ActiveRecord::Base belongs_to :store searchable do text :name end end class Store <…
LearningRoR
  • 26,582
  • 22
  • 85
  • 150
1
2 3
27 28