karmi/tire — pull request #844 by yaotti (2013-08-17 13:33:58+00:00)
Title: Don't remove `match` query followed by `ids` query

When the following code is executed, a json (query) containing `ids` and `match` queries should be printed.

```ruby
Tire.search 'article' do
query do
match :foo, 1
ids [1, 2, 3]
end
puts to_json
end
```

However this code prints the following, the query missing `match` block.

```js
{
"query": {
"ids": {
"values": [
1,
2,
3
]
}
}
}
```

This PR resolve the problem to build correct queries as follows.

```js
{
"query": {
"bool": {
"must": [
{
"match": {
"foo": {
"query": 1
}
}
},
{
"ids": {
"values": [
1,
2,
3
]
}
}
]
}
}
}
```