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
0
votes
1 answer

How to search table associations using Sunspot/Solr

I am very new to Sunspot/Solr and I am facing problems in getting a fulltext search to work on my website. Please find the code below: /models/product.rb attr_accessible :category_id, :title, :description belongs_to :category searchable do text…
ansh0809
  • 143
  • 1
  • 6
0
votes
1 answer

Trying to implement facets on object type using sunspot on Rails

My basic goal is to create a facet based on the returned object type, not any specific field of the various objects. I have a search in my controller that returns multiple types of objects. It looks like this: def search @raw_results =…
gitb
  • 1,090
  • 2
  • 12
  • 20
0
votes
1 answer

Sunspot solr search works only from one page?

I am following the instructions mentioned here Rails 3: sunspot solr : adding search ability for every page However it does not seem to work for me. I'm trying to implement a twitter like search functionality where the search bar stays at the top in…
Donny
  • 678
  • 11
  • 34
0
votes
1 answer

how to search has_many relation field as criteria sunspot rails

i have a Project Model and a ProjectAttribute Model that basically have 3 fields: name, value, project_id, used to store key-value records about Project, i've tried the approach below but without any success. project.rb class Project <…
Nando
  • 747
  • 7
  • 23
0
votes
1 answer

Matching substrings in fulltext search not working

In my rails application, i'm using solr search. Substring matching working fine on local server but it is matching full words on my deployment server. searchable block searchable do text :firstname, :lastname, :login, :mail boolean :member …
Ramiz Raja
  • 5,942
  • 3
  • 27
  • 39
0
votes
1 answer

Sunspot search has_one association, other model has no foreign key

I'm using Sunspot Solr to search events and each event has a group_id that refers to a Group object (multiple events can have the same group). I want to find the right events if the user searches the group name. Attempted solution in the searchable…
Andrew
  • 1,167
  • 1
  • 10
  • 16
0
votes
1 answer

Sunspot failing to index an integer belongs_to id field

In the examples for sunspot sunspot.github.com, a belongs_to :blog association is indexed inside a searchable block with integer :blog_id. Later, the search can be constrained to a particular blog using with(:blog_id, 1). If have done this, except…
Tony Pitale
  • 1,192
  • 2
  • 11
  • 23
0
votes
0 answers

How to search sunspot rails for empty associations

Before, we were able to successfully find 'roots' in a tree by checking for an empty previous_id: Phrase.search do with :previous_id, nil end.results Now we successfully changed the model from 1:n (belongs_to) to n:n (has_and_belongs_to_many). We…
Anno2001
  • 1,343
  • 12
  • 17
0
votes
0 answers

Sunspot rails search, deny creating facets by condition

I use sunspot_rails gem in full text searching in Ruby on Rails, I added boolean field ('show_facet') to my model Product, and to solr index Then I want to do next: if 'show_facet' == true then show Product in search list and facets list if…
0
votes
1 answer

sunspot searchable include not loading has_and_belongs_to_many association

in the following Sunspot Rails scenario the has_and_belongs_to_many association does not get loaded despite of the include directive: has_and_belongs_to_many :predecessors, :join_table => 'next_phrases', :class_name => "Phrase", :foreign_key =>…
Anno2001
  • 1,343
  • 12
  • 17
0
votes
1 answer

Searching for a similar phrase on a RoR application

I am a beginner to Rails and I am using Sunspot for implementing search functionality. I want to search for patients names. Up to now im searching using the fulltext method and it is working. However I want to achieve the following functionality.…
interboy
  • 856
  • 1
  • 11
  • 25
0
votes
1 answer

Can I use "-" in FQs using Sunspot gem

I've inherited a Solr installation that doesn't really work for our data. Before re-building, we want to roll out a simple search: filtering on any of our product inventory with size 8, shoe size 9. We have 2 facets, clothing_size, and shoe_size.…
Anna Billstrom
  • 2,482
  • 25
  • 33
0
votes
1 answer

How do you monitor a solr server with god, instead of respawning bundle sunspot-solr start

The issue is that the command I use to start sunspot, bundle exec sunspot-solr start, itself spawns a solr server, which is the actual process that needs to be monitored, not the original command. If I just set the start command, then it…
D-Nice
  • 4,772
  • 14
  • 52
  • 86
0
votes
0 answers

Ordering the search result - sunspot rails

I have two models, an School model, a Price model. A School has one price. Here is my School-controller, I eager load the price model with school-model: def index @search = School.search(:include => [:price]) do fulltext params[:search] …
user592638
0
votes
2 answers

Search using Sunspot:solr

I have two models, named as Products and Variants, in which Variant model have association with Products as a Product have many Variants. Variant model have field named as "available_on" ... I want to implement search using two dates as check-in n…
Gopal S Rathore
  • 9,885
  • 3
  • 30
  • 38