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

how to get value selected by using select_tag with options_from_collection_for_select and pass it to controller

I have built a form search like this: <%= form_tag({ controller: 'questions', action: 'search_topic' }, method: 'get') do %> <%= select_tag 'search_topic', options_from_collection_for_select(current_user.get_topics, :id, :name) %> <%= submit_tag…
Thanh
  • 8,219
  • 5
  • 33
  • 56
4
votes
1 answer

Sunspot Solr search parameter "with" not working with strings

I'm developing a Ruby on Rails application using Sunspot Solr as an indexer. The thing is i try to use the parameter of the search with :, using strings and it doesn't seem to work. If i pass an int it works fine. Anyone knows how to do it with…
Wiggin
  • 329
  • 1
  • 3
  • 17
3
votes
2 answers

Java Runtime error when trying to install sunspot

i have seen other blogs and SO questions relating to this issue but none of them seem to help. I am trying to install sunspot with solr, however i keep getting an error when running the following command: bundle exec rake sunspot:solr:start The is…
Hishalv
  • 3,052
  • 3
  • 29
  • 52
3
votes
0 answers

Sunspot Rails and Carrot2

I'm using the sunspot_rails gem for a rails application. Is there a way to integrate the cluster engine carrot2 into a rails app? Obviously carrot2 is part of sunspot as it is commented in the solr configs. But I'd like to know wheather someone has…
ticcoid
  • 261
  • 1
  • 11
3
votes
1 answer

Named scope in Sunspot search in rails 3

i am using the Sunspot search from multiple models which are tagged under a name. Sunspot.search(Article,Blogpost) do with :tag_ids, params[:id] end How to apply named_scoped like recent ,popularity which are common for all of the 2 models inthe…
useranon
  • 29,318
  • 31
  • 98
  • 146
3
votes
1 answer

How can I get Sunspot to index the fixtures for my test environment?

I have a rails app that uses Sunspot and Solr for search functionality. I'm currently writing functional tests (using Rails own test suite) to verify that when I call my searches controller with a search term in the params, the correct records are…
James Hibbard
  • 16,490
  • 14
  • 62
  • 74
3
votes
2 answers

Sunspot unicode search working locally but not in production

I have my app working with Sunspot Solr locally, supporting unicode with no issues. In production however, with Heroku and Websolr, all unicode queries return zero results. I have confirmed with Websolr support I can query directly against their…
Bashar Abdullah
  • 1,545
  • 1
  • 16
  • 27
3
votes
1 answer

Sunspot Solr doesn't return any result but no error

Environment: Rails 3.0.1 Ruby 1.8.7 MySQL 5.5.16 Community server...Jdk 1.6 gem 'sunspot_rails' gem 'sunspot_solr' Model: class Item < ActiveRecord::Base searchable do text :title,:description end end Controller: def search p…
crazycrv
  • 2,395
  • 2
  • 19
  • 20
3
votes
1 answer

How can 'parse' be undefined for Time class in test environment, but not development or production?

I'm encountering a strange issue while running a test (Steak + Capybara) that requests a certain page where I get the error: undefined method parse for Time:Class The method call occurs in a Sunspot file called type.rb: def…
nichobot
  • 61
  • 6
3
votes
3 answers

sunspot with jruby

Hi can sunspot be used with jruby, also here is my app details jruby-1.6.1 rails 3.0.7 when i install all the gems and run rake sunspot:solr:start it gives me the following error Gem::LoadError: Could not find RubyGem sunspot (>= 0) …
dhaval2025
  • 317
  • 2
  • 5
  • 12
3
votes
1 answer

Sunspot/Solr queries ending with logical operators AND/OR/NOT result in error

I noticed that queries ending with logical operators like AND/OR/NOT example ('this AND') will result in an error. Now what would be the best way to handle this? Just trim out or escape all the queries ending with one of those? Note that it also…
Bashar Abdullah
  • 1,545
  • 1
  • 16
  • 27
3
votes
1 answer

what's the best way to re-index just the models that changed during solr downtime?

if I have millions of User records with some text fields getting indexed to solr on create and on update, how do I go back and re-index the few records that never made it to solr? i.e. what if solr goes down for a few minutes during the day and…
Andrew Arrow
  • 4,248
  • 9
  • 53
  • 80
3
votes
2 answers

Disable Solr during database rebuild

I am working on a rails project that involves the solr sunspot gem. I left the default behavior to auto update the index on model saves, but I was wondering if there was a way to temporarily disable the indexing when mass creating objects, such as…
Danny
  • 4,724
  • 6
  • 42
  • 55
3
votes
2 answers

Sunspot Solr specify offset and limit

I am aware of how to paginate a solr search via the sunspot gem. But I would like to specify the exact start row and maximum rows to fetch. For example, something like: Post.search do rows(:offset => 2, :limit => 23) end How can I do this?
Jey Balachandran
  • 3,585
  • 5
  • 27
  • 36
3
votes
0 answers

How to improve Typeahead performance by cancelling intermediate requests?

I'm using the gems sunspot_solr, sunspot_rails and twitter-typeahead-rails as outlined in this tutorial. Everything is integrated and it's working well. However, I notice that if the user pauses while typing, multiple sequential requests are made,…
Stephen Lead
  • 1,904
  • 5
  • 23
  • 46