New improvements: Full-text search of Notebook content powered by Whoosh

Skip to first unread message

Alex Clemesha

Aug 29, 2009, 7:24:01 PM8/29/09

I just pushed the latest improvements up to codenode master
and the main new addition is Full-text search of Notebook content,
powered by Whoosh.

The best way to try out the new features is to do the following:
$ virtualenv --no-site-packages codenode_env
$ pip -E codenode_env install -e

Here is a little more about the new features. From the Whoosh
homepage (
"Whoosh is a fast, featureful full-text indexing and searching library
implemented in pure Python. "
and my experience with Whoosh has been great, as it was easy to "plug
in" to codenode
and has lots of great features.

The coolest detail about how Whoosh was integrated with codenode is
the way all Notebook content (every Cell ever created for a given Notebook)
is indexed. We use Django's excellent signal framework [1] to attach
a "post_save" signal to every save of each Cell.

In the file "codenode/frontend/search/" we have the following line:
"signals.post_save.connect(update_index, sender=models.Cell)"
which updates the search index with the Cell content, and is extremely
fast because each Cells content is, in general, small.

We also use Django's signal framework to do the Revision History
functionality, that was adding in a couple weeks ago, see here for
details and screenshots of that:

Lastly, the new search functionality is fully unit-tested. Thanks to the
effort by James Casbon, who helped getting Nose testing started, we are finding
it very easy to do more "test driven development" with Nose.



Alex Clemesha

Reply all
Reply to author
0 new messages