Skip to content

Instantly share code, notes, and snippets.

@AntonyBaasan
Created February 27, 2018 15:00
Show Gist options
  • Save AntonyBaasan/69dd01aecc928689b20b40728f3fda4c to your computer and use it in GitHub Desktop.
Save AntonyBaasan/69dd01aecc928689b20b40728f3fda4c to your computer and use it in GitHub Desktop.
var response = _client.Search<ElasticFileInfo>(s => s
.Index(_indexName)
.From(0)
.Size(10000)
.Query(qry => qry.QueryString(q => q.Query(queryString)))
.StoredFields(f => f.Fields(p => p.CreatedBy))
.Aggregations(a => a
.Terms("types", st => st
.Field(f => f.Type))
.Terms("addedby", st => st
.Field(f => f.CreatedBy.Suffix("keyword")))
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment