This app is being built simply to test full text search using sunspot/rsolr/solr.
Just a simple collection of searchable nested resources.
The solr server must be running to access any of the searchable models.
This is unfortunate. It would be nice, if some things just wouldn’t work or would fallback on standard database searching, but no. If it is not, you’ll get …
Errno::ECONNREFUSED: Connection refused - connect(2) rake db:create rake db:migrate rake sunspot:solr:start rake app:import script/server
mv Rakefile Rakefile.orig cat Rakefile.orig | sed "s/rake\/rdoctask/rdoc\/task/" > Rakefile rake db:migrate mv config/environment.rb config/environment.rb.orig cat config/environment.rb.orig | awk '{sub(/\|config\|/,"&\n\tconfig.gem \"sunspot_rails\"");print}' > config/environment.rb # doesn't work. # undefined method `searchable' for #<Class:0x103aed5b8> #echo "require 'sunspot/rails/tasks'" >> Rakefile cp /usr/lib/ruby/user-gems/1.8/gems/sunspot_rails-1.2.1/lib/sunspot/rails/tasks.rb lib/tasks/sunspot.rake script/generate sunspot # adds solr/conf/* and starts solr in background # use rake sunspot:solr:run to see it running in the foreground rake sunspot:solr:start
Which model is “searchable”? Or all of them? Do I add a searchable block to all?
Then how do I search them all? Say “moses”, and return verses containing “moses” AND book title containing “moses”? Search verses, chapters or books?
How to create a collection, group or version like Bible or New Testament or King James? Tags?
Book has Chapter has Verse/Paragraph/Page/Section
Book title author release date language extra text Chapter acts_as_list or linked list or both? doesn't really matter in this example. position title number Verse/Paragraph/Page/Section acts_as_list or linked list or both? doesn't really matter in this example. position text ( < 65000 chars seems unnecessarily long. how many chars on average paperback page? ~1500 chars) longest bible verse is Esther 8:9 which is 81 words or 464 characters. novels are around 50,000 words so about 250,000 characters just stick with the default for now. it is just a demo.
download and parse bible as example as contains many books
www.gutenberg.org/cache/epub/10/pg10.txt
start searching
-
collectiveidea.com/blog/archives/2011/03/08/full-text-searching-with-solr-and-sunspot/
-
hemju.com/2011/01/04/full-text-search-with-sunspot-in-rails/
-
masonoise.wordpress.com/2010/02/06/using-sunspot-for-free-text-search-with-redis/
-
timcowlishaw.co.uk/post/3179661158/testing-sunspot-with-test-unit
if intended to be real app, could add …
add users and then ... bookmarks perhaps subscribe to book and email it 1 verse a day or whatever "rate" subscribed allow users to write and share books?