[source, ruby]
----
response = client.indices.create(
  index: 'test',
  body: {
    mappings: {
      properties: {
        comments: {
          type: 'nested'
        }
      }
    }
  }
)
puts response

response = client.index(
  index: 'test',
  id: 1,
  refresh: true,
  body: {
    title: 'Test title',
    comments: [
      {
        author: 'kimchy',
        text: 'comment text'
      },
      {
        author: 'nik9000',
        text: 'words words words'
      }
    ]
  }
)
puts response

response = client.search(
  index: 'test',
  body: {
    query: {
      nested: {
        path: 'comments',
        query: {
          match: {
            'comments.text' => 'words'
          }
        },
        inner_hits: {
          _source: false,
          docvalue_fields: [
            'comments.text.keyword'
          ]
        }
      }
    }
  }
)
puts response
----
