aaw/mongoid_fulltext — pull request #42 by ethul (2012-02-21 16:11:26+00:00)
Title: Override query selector for filters

hi Aaron,

This is probably not the most elegant change, but I found that I needed a way to use a different query selector when I had a filter set up that returned an array. By default MongoId-Fulltext used $all in the query selector to match on the array, but I was looking to use the $in operator.

The following is an example of current behavior:

```ruby
ValueModel.fulltext_search("abc", :values => ["val1","val2","val3"])
MONGODB db['mongoid_fulltext.index_values'].find({"ngram"=>"abc", "filter_values.values"=>{"$all"=>[val1,val2,val3]})
```

With the changes, one could use the $in operator as follows (note that passing an array to `:values` still works as before).

```ruby
ValueModel.fulltext_search("abc", :values => {"$in" => ["val1","val2","val3"]})
MONGODB db['mongoid_fulltext.index_values'].find({"ngram"=>"val", "filter_values.values"=>{"$in"=>[val1,val2,val3]})
```
I realize this opens the door to the lower-level mongodb selector API, so perhaps there is a better way to incorporate this functionality, or perhaps there is already a slick way to do it that I missed.

Best,
-Eric