kidpollo / tanker

IndexTank Integration with your fav ORM
MIT License
97 stars 30 forks source link

Seach across multipule fields #36

Closed coryschires closed 13 years ago

coryschires commented 13 years ago

Looking good to me. Heart of the change was re-adding an __any parameter to the query string:

  query = "#{search_on_fields}:(#{query.to_s}) OR __any:(#{query.to_s}) __type:(#{models.map(&:name).map {|name| "\"#{name.split('::').join(' ')}\"" }.join(' OR ')})"

Rather than:

  query = "#{search_on_fields}:(#{query.to_s}) __type:(#{models.map(&:name).map {|name| "\"#{name.split('::').join(' ')}\"" }.join(' OR ')})"

Also, added a few integration tests to help protect against regression.

coryschires commented 13 years ago

This addresses issue #34

coryschires commented 13 years ago

Everything in this pull request is also in #37 so there's no need to worry with this one.