Friday, February 22, 2008

Full Search Added to Rhizome

Yesterday I checked in what I think will be the last major change in Rhizome before I release the 1.0 version.

What was the feature? Full text search. Actually, full text search has always been supported, but it required Rhizome implementors to do lots of the heavy lifting on their own. That has now changed.

Now, from a Rhizome IndexSearcher instance, you can use the simpleSearch() methods to fire off very complex searches without having to do any custom coding.

SimpleSearch supports the following:
  • Specifying which metadata should be searched
  • Determining whether or not the main body should be searched
  • Returning results in sorted order by score
  • Handling multiple pages of search data
  • Using the ProxyRhizomeDocument class to return certain fields immediately, while delaying the load of entire documents until it is necessary
  • Handling very complex search strings, including metadata-specific searches.
On that last item, an example is in order. You could, for example, search for all documents that have a specific tag (or label) and contain a specific word. Here's the search string:
+tag:Nietzsche +zarathustra
This would search for only items with the Nietzsche tag, and with the word zarathustra somewhere in the body or metadata. A whole batch of operators and so on are supported, thanks to the Lucene subsystem.