joshuabowers/search_magic — Issue #18: Provide an instance method which yields the values which match a pattern
Author: joshuabowers
Created: 2011-12-01 11:36:05+00:00
State: open

This would be a method invokable on individual models, which would return the subset of `:searchable_values` which matched a given search pattern. This would be similar to running `:search_for`, but would be for information purposes. E.g.: if I were to perform the following search:

```ruby
games = Game.search_for("title:'elder scrolls'")
```

It would be nice to do the following:

```ruby
games.map do |game|
game.values_matching("title:'elder scrolls'")
end
```

Which would then result in something like:

```ruby
[["title:elder", "title:scrolls"]]
```