README.rdoc in xapian_db-0.5.2 vs README.rdoc in xapian_db-0.5.3

- old
+ new

@@ -26,38 +26,21 @@ * updates the index realtime (no scheduled reindexing jobs) * supports all major features of a full text indexer, namely wildcards!! I tried hard but I couldn't find such a thing so I decided to write it, based on the Xapian library. -== Getting started +<b>If you found a bug or are looking for a missing feature, please post to the {Google Group}[http://groups.google.com/group/xapian_db]</b> -If you want to use xapian_db in a Rails app, you need Rails 3 or newer. +== Requirements -=== Install Xapian if not already installed +* ruby 1.9.2 or better +* rails 3.0 or better (if you want to use it with rails) -To use xapian_db, make sure you have the Xapian library and ruby bindings installed. At the time of this writing, the newest release of Xapian was 1.2.4. You might -want to adjust the URLs below to load the most current release of Xapian. -The example code works for OSX. On linux you might want to use wget instead of curl. +== Getting started -A future release of xapian_db might include the Xapian binaries and make this step obsolete. +If you want to use xapian_db in a Rails app, you need Rails 3 or newer. -==== Install Xapian - curl -O http://oligarchy.co.uk/xapian/1.2.4/xapian-core-1.2.4.tar.gz - tar xzvf xapian-core-1.2.4.tar.gz - cd xapian-core-1.2.4 - ./configure --prefix=/usr/local - make - sudo make install - -==== Install ruby bindings for Xapian - curl -O http://oligarchy.co.uk/xapian/1.2.2/xapian-bindings-1.2.4.tar.gz - tar xzvf xapian-bindings-1.2.4.tar.gz - cd xapian-bindings-1.2.4 - ./configure --prefix=/usr/local XAPIAN_CONFIG=/usr/local/bin/xapian-config - make - sudo make install - For a first look, look at the examples in the examples folder. There's the simple ruby script basic.rb that shows the basic usage of XapianDB without rails. In the basic_rails folder you'll find a very simple Rails app unsing XapianDb. The following steps assume that you are using xapian_db within a Rails app. @@ -121,10 +104,18 @@ "Not one" end end end +You may add a filter expression to exclude objects from the index. This is handy to skip objects that are not active, for example: + + XapianDb::DocumentBlueprint.setup(Person) do |blueprint| + blueprint.attributes :name, :first_name, :profession + blueprint.index :notes, :remarks, :cv + blueprint.ignore_if {active == false} + end + place these configurations either into the corresponding class or - I prefer to have the index configurations outside the models - into the file config/xapian_blueprints.rb. === Update the index @@ -265,10 +256,10 @@ writer: beanstalk beanstalk_daemon: localhost:11300 === 4. start the beanstalk daemon - beanstalk -d + beanstalkd -d === 5. start the beanstalk worker from within your Rails app root directory rake RAILS_ENV=production xapian_db:beanstalk_worker