README.rdoc in xapian_db-0.3.2 vs README.rdoc in xapian_db-0.3.3
- old
+ new
@@ -112,12 +112,11 @@
XapianDb::DocumentBlueprint.setup(Person) do |blueprint|
blueprint.language_method :language
end
-Don't worry if you have languages in your database that are not supported by Xapian. If the language is not supported, XapianDb
-will fall back to the global language configuration or none, if you haven't configured one.
+The method must return the iso code for the language (:en, :de, ...) as a symbol or a string. Don't worry if you have languages in your database that are not supported by Xapian. If the language is not supported, XapianDb will fall back to the global language configuration or none, if you haven't configured one.
You can place this configuration anywhere, e.g. in an initializer.
=== Update the index
@@ -143,12 +142,18 @@
=== Process the results
<code>XapianDb.search</code> returns a resultset object. You can access the number of hits directly:
- result.size # Very fast, does not load the resulting documents
+ results.size # Very fast, does not load the resulting documents
+If you use a persistent database, the resultset may contain a spelling correction:
+
+ # Assuming you have at least one document containing "mouse"
+ results = XapianDb.search("moose")
+ results.corrected_query # "mouse"
+
To access the found documents, get a page from the resultset:
page = result.paginate # Get the first page with 10 documents
page = result.paginate(:page => 2, :per_page => 20) # Get the second page page with documents 21-40
@@ -160,9 +165,8 @@
person = doc.indexed_object # Access the object behind this doc (lazy loaded)
== What to expect from future releases
-* multi language support (spelling correction, stop words)
* facet support
* will_paginate support
* asynchronous index writer based on {resque}[https://github.com/defunkt/resque] for production environments
\ No newline at end of file