karmi/tire — pull request #643 by moktin (2013-02-26 13:17:33+00:00)
Title: Allow support of boost (and other options) to Terms Query

Hi,

While using tire, I had problem using the boost on query terms.

I am pretty new to both tire and elasticsearch world, so maybe I am just doing it wrong.

With this indices
```ruby
class User < ActiveRecord::Base
include Tire::Model::Search
mapping do
indexes :subjects do
indexes :id, type: :integer
end
end
end
```

A request like :
```ruby
search = User.search do
query do
boolean do
should {
terms 'comments.id', [1, 2], boost: 10
}
end
end
end
```
produce such a result :

```
curl -X GET 'http://localhost:9200/users/user/_search?load=true&size=12&pretty' -d '
{
"query": {
"bool": {
"should": [
{
"terms": {
"comments.id": [
1,2
]
}
}
]
}
},
"size": 12
}
'
```
When I was waiting for something like that :
````
curl -X GET 'http://localhost:9200/users/user/_search?load=true&size=12&pretty' -d '
{
"query": {
"bool": {
"should": [
{
"terms": {
"comments.id": [
1,2
],
"boost": 10
}
}
]
}
},
"size": 12
}
'
````

The attached pull request solve that.

Thank you to let me know if it helps or if you need some more informations