added support for setting search options

This is a PR for #363 adding `$options` as a second or third parameter depending on the usage.