(#4)  Add filter function option

Add an option to filter out documents from the search index.  
This is for issue #4.
Can i reuse somehow the `tryCode` function from map/reduce ?  Or should I duplicate it ?