itstommymorgan / asari

a Ruby wrapper for AWS CloudSearch.
52 stars 51 forks source link

allow compound boolean queries #53

Closed madcowley closed 6 years ago

madcowley commented 6 years ago

We needed to be able to turn a hash like filter: { and: {type_name: 'foo', not: {tags: 'mytag'}}} into (and type_name:'foo' (not tags:'mytag'))

to handle, for instance, excluding items tagged with a particular term from a search result.

The boolean_query field was instead returning: (and type_name:'foo'(not tags:'mytag')) which caused a bad request error.

This just adds a space where needed.