increments/es-query-builder — pull request #1 by f-kubotar (2014-12-26 09:34:35+00:00)
Title: Support nested query, has_chlid query

I want to keyword serach to hit the normal fields and nested fields, child field.
It has not been supported in simple_query_string of ES.
So, I tried to implement the query builder.

```ruby
builder = EsQueryBuilder.new(nested_fields: { user: ['name', 'profile'] })
builder.build('hoge')
#=> {:bool=>
{:should=>
[{:match=>{"_all"=>"hoge"}},
{:nested=>{:path=>"user", :query=>{:multi_match=>{:fields=>["name", "profile"], :query=>"hoge"}}}}]}}
```

```ruby
builder = EsQueryBuilder.new(child_fields: { entry: ['title', 'body'] })
builder.build('hoge')
#=> {:bool=>
{:should=>
[{:match=>{"_all"=>"hoge"}},
{:has_child=>{:type=>"product", :query=>{:multi_match=>{:fields=>["title", "body"], :query=>"hoge"}}}}]}}
```