Jingzhao Ou, do you state that you successfully combined msearch with the
query containing aggregations (like in your example)? How should the query
be constructed then to prevent "msearch approach is not accepting normal
JSON payloads"? Could you please post a working msearch API call example?
Thanks,
Roman
субота, 20 вересня 2014 р. 02:51:17 UTC+3 користувач Jingzhao Ou написав:
>
> Hi, David,
>
> Thanks a lot for your prompt help. I got both approaches working, which is
> very exciting. I prefer the top_hits aggregation approach. The msearch
> approach is not accepting normal JSON payloads, which makes things a bit
> harder for processing in Javascript.
>
> My query payload is shown below. Works like a champ!
>
> Best regards,
> Jingzhao
>
> {
> "size": 0,
> "query": {
> "bool": {
> "should": [
> { "term" : { "_type": "0000000000000001" } },
> { "term" : { "_type": "0000000000000002" } }
> ]
> }
> },
> "sort": {
> "id": "desc"
> },
> "aggs": {
> "top-tags": {
> "terms": {
> "field": "_type"
> },
> "aggs": {
> "top_tag_hits": {
> "top_hits": { "size" : 1 }
> }
> }
> }
> }
> }
>
>
>
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/a16ca0fc-d6cb-4b6f-8adb-06bb683c82f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.