Giter Club home page Giter Club logo

book_search_demo's Introduction

Book Search Demo

This app is being built simply to test full text search using sunspot/rsolr/solr.

Just a simple collection of searchable nested resources.

Installation

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

Creation

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

References

Other

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?

book_search_demo's People

Contributors

jakewendt avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.