change first argument of search() to an options object for #2