Questions tagged [sunspot]

Sunspot is a Ruby gem that interfaces with the Apache Solr search server. All the power of the Solr search engine; all the beauty of Ruby. Sunspot exposes all of Solr's most powerful search features using an API of elegant DSLs. That means robust, flexible fulltext search with no boolean queries and no string programming.

855 questions
7
votes
1 answer

Sunspot pagination with kaminari

I recently decided to port my indexing engine from sphinx to solr. Having used kaminari with thinking_sphinx I decided to try making use of generic pagination in sunspot https://github.com/sunspot/sunspot/pull/64 /…
maecro
  • 233
  • 2
  • 9
7
votes
1 answer

Search for partial words using Solr

I'm trying to search for a partial word using Solr, but I can't get it to work. I'm using this in my schema.xml file.
Linus Oleander
  • 17,746
  • 15
  • 69
  • 102
7
votes
2 answers

Solr / Sunspot - determine indexing language at runtime, dynamically choose analyzers

I would like to use Solr + Sunspot to index a bilingual FR-EN site. The issue: model Post can be written both in French or in English. I can determine at runtime what is the language, but I also need Solr to index the model accordingly. EG: For…
7
votes
2 answers

Sunspot / Solr full text search - how to index Rails associations

Is it possible to index through an association with Sunspot? For example, if a Customer has_many Contacts, I want a 'searchable' block on my Customer model that indexes the Contact#first_name and Contact#last_name columns for use in searches on…
Sam
  • 73
  • 1
  • 3
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
7
votes
1 answer

What is the correct way of maintaining indices for Sunspot Solr?

I am confused about the Solr indexing mechanism. Perhaps someone can shed some light on it. So, we have 2 rake commands: rake sunspot:solr:index and rake sunspot:solr:reindex Here's what my index task looks like (I overrode it for…
Yevgeniy
  • 1,313
  • 2
  • 13
  • 26
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
1 answer

Sunspot / Solr / Rails: Model Associations are not updating in the Index

I have a Fieldnote model in my app, which has_many :activities attached to it through a table called :fieldnote_activities. I then define a searchable index this way: searchable :auto_index => true, :auto_remove => true do integer :id integer…
landslide
  • 107
  • 1
  • 4
6
votes
1 answer

Rails & Sunspot facets and filtering

Pretty much a noobie here, so I appreciate any help someone can give. I'm trying to add faceting to the search on my site through Sunspot. Ryan just released a great Railscast which got me started:…
armbrusting
  • 61
  • 1
  • 3
6
votes
1 answer

How can I write a request spec with Capybara/RSpec for testing Sunspot/Solr searching?

I'd like to write my usual RSpec/Capybara request specs to test search functionality using Sunspot and Solr. I've been digging around but can't find how to get this working. I have the sunspot_test gem installed and have verified that the Products…
Eric M.
  • 5,399
  • 6
  • 41
  • 67
6
votes
1 answer

Sunspot: Sort/order facet results by attribute e.g. created_at

Asset model: searchable do text :title text :description time :created_at integer :category_ids, :multiple => true, :references => Category end Controller: search = Asset.search() do keywords(h(params[:query]), :fields => [:title,…
Chris
  • 318
  • 1
  • 15
6
votes
5 answers

How to rotate, override, or turn off logging from Sunspot Solr Rubygem?

I've had great experiences with Sunspot Solr search for Ruby on Rails, however, its log files are growing incredibly large and I can't seem to find a way to either rotate, override, or turn off these logs (other than with very hacky methods that I'd…
lightyrs
  • 2,809
  • 2
  • 29
  • 32
6
votes
4 answers

Full text search for Rails 3

I’m evaluating full text search methods for Rails 3 ATM. Does anyone here have a recommendation? Seems to me as if most of the known methods (Sunspot, Sphinx, Ferret, Xapian) aren’t yet ready for Rails 3. Is that so? At the moment I’ve got plenty of…
Ulf
  • 451
  • 1
  • 5
  • 13
6
votes
1 answer

SOLR 6.2 ignores heap settings (SOLR_JAVA_MEM param)

I've followed instructions from here and here to increase my SOLR memory allocation. I've done this because the SOLR server has shutdown periodically during some high frequency and high volume indexing activity. I'm a little new to using SOLR and…
6
votes
1 answer

Full text search for irregular rapper names with Solr

I'm implementing full text search functionality on my rap website, and I'm running into some issues with rapper and song names. For example, someone might want to search for the rapper "Cam'ron" using the query "camron" (leaving out the mid-word…
Tom Lehman
  • 85,973
  • 71
  • 200
  • 272
1 2
3
56 57