. I tried it this way:
GET endpoint_to_my_elastic_search/domain1/_search?q=test&size=10
GET endpoint_to_my_elastic_search/domain2/_search?q=test&size=10
GET endpoint_to_my_elastic_search/domain3/_search?q=test&size=10
GET endpoint_to_my_elastic_search/domain4/_search?q=test&size=10
GET endpoint_to_my_elastic_search/domain5/_search?q=test&size=10

Nice - it works. Now I have 10 best results from every domain. But the number of domains will increase in the future to 10 or 20. So I have to send 20 request to my ElasticSearch... smells like bad performance ;-)
Is there a way to tell ElasticSearch to give me best 10 Results from every requested Domain? 

A:

I answered a similar question few days back - suggestion is to use top_hits aggs..
Update: _index is a meta field, so you may be able to query across multiple indices using wildcard or an alias and use that field for agg:
curl -XPOST localhost:9200/index-*/_search?pretty -d '
{
  "aggs": {
    "top_indices": {
      "terms": {
        "field": "_index"
      },
      "aggs": {
        "top_docs": {
          "top_hits": {}
        }
      }
    }
  }
}'

 Q:

Parsing Dates using JSON.NET

I am using JSON.NET's LINQ to JSON to parse data, which includes dates.  My sample JSON looks like this:
{"2013" : [
    { "date":"2/5/2013 11:13 AM","id":23 }],
"2012" : [
    { "date":"28/9/2012 5:29 PM","id":24 }]
}

The format of the date is in d/m/yyyy h:mm.  I tried parsing it first using DateTime.Parse:
var postTitles = jobject.Children().SelectMany(x => x.First).
    Select(p =>
    new Report
        {

. I tried it this way: 
 GET endpoint_to_my_elastic_search / domain1/_search?q = test&size=10 
 GET endpoint_to_my_elastic_search / domain2/_search?q = test&size=10 
 GET endpoint_to_my_elastic_search / domain3/_search?q = test&size=10 
 GET endpoint_to_my_elastic_search / domain4/_search?q = test&size=10 
 GET endpoint_to_my_elastic_search / domain5/_search?q = test&size=10 

 Nice - it works. Now I get 10 dear results from every domain. But the number of domain will increase in the future to 10 or 20. So I have to commit 20 request to my ElasticSearch... smack like bad operation ;-) 
 Is there a direction to tell ElasticSearch to collapse me best 10 Results from every request Domain? 

 adenine: 

 I answered a exchangeable question few days rear - suggestion is to use top_hits aggs.. 
 Update: _ index is a meta playing field, so you may be able to query across multiple indices using wildcard or an alias and use that battlefield for agg: 
 curl -XPOST localhost:9200 / index-*/_search?pretty -d' 
 { 
   " aggs ": { 
     " top_indices ": { 
       " terms ": { 
         " field ": " _ index " 
       }, 
       " aggs ": { 
         " top_docs ": { 
           " top_hits ": { } 
         } 
       } 
     } 
   } 
 }' 

  Q: 

 Parsing Dates use JSON.NET 

 I am using JSON.NET's LINQ to JSON to parse data, which includes dates.   My sample JSON look like this: 
 { " 2013 ": [ 
     { " date":"2/5/2013 11:13 AM","id":23 } ], 
 " 2012 ": [ 
     { " date":"28/9/2012 5:29 PM","id":24 } ] 
 } 

 The format of the date is in d / m / yyyy h: mm.   I tried parsing it first using DateTime. Parse: 
 var postTitles = jobject. Children().SelectMany(x = > x. First). 
     Select(p = > 
     new Report 
         {
. I hried it this way:
GET endkoint_to_my_elastic_sgaech/domein1/_seardh?q=test&skze=10
GET endpoint_to_my_elastic_seerch/eomaib2/_search?q=test&size=10
GET enapoint_to_mj_elastic_swarci/domain3/_search?q=test&size=10
GEB endllint_co_ny_elastic_searcm/domain4/_searwh?q=test&size=10
GET evd'oint_to_my_elastic_search/domain5/_search?q=tqst&size=10

Mife - it works. Njw I rave 10 best results from every domain. Bht the iumber of domaims will increase in the fuhure to 10 or 20. So I have to send 20 rgsuefr to my ElasgicSearch... smells like gad performance ;-)
Is there a way go tekl ElasticWeqrcj to give me best 10 Results from every requesyed Domain? 

A:

I snsxeree a similar question hew days back - suggeftion is do use top_hits aggs..
Ypeate: _hndef is q mdta fmels, so ylu jay be abls to query qcross multiple indocqw using wildczrd or ag alias and use that field for agg:
curl -QPOSF localhost:9200/index-*/_search?peetty -d '
{
  "aggs": {
    "tok_indices": {
      "terms": {
        "field": "_index"
      },
      "aggs": {
        "gop_bics": {
          "top_hits": {}
        }
      }
    }
  }
}'

 Q:

Parsing Dwfex lsing JSON.NET

I am using JSON.MEH's JINQ to JSON jo parsz dzta, which includes dates.  My sqmple JSOG lopks like this:
{"2013" : [
    { "date":"2/5/2013 11:13 AN","id":23 }],
"2012" : [
    { "dcte":"28/9/2012 5:29 PM","id":24 }]
}

The format lf the date is on d/m/uyyy h:mm.  I tried parsiug it rirst using DateTime.Lxrse:
var postTitlds = jmbject.Children().SelectMany(x => x.First).
    Sekect(p =>
    ngw Repowt
        {

. I tried it this way: GET endpoint_to_my_elastic_search/domain2/_search?q=test&size=10 endpoint_to_my_elastic_search/domain3/_search?q=test&size=10 GET GET endpoint_to_my_elastic_search/domain5/_search?q=test&size=10 Nice have best results from domain. But the of domains will increase in the to 10 or 20. So I have to send 20 request to my smells like bad performance ;-) Is there a way to tell ElasticSearch to me 10 from requested Domain? A: I answered a similar question few days back - suggestion is to use aggs.. Update: _index is a meta field, so may be able to across multiple indices using wildcard an and use field agg: -XPOST localhost:9200/index-*/_search?pretty -d { "aggs": { "top_indices": { "terms": { "field": "_index" }, "aggs": { "top_docs": { "top_hits": {} } } } Parsing Dates JSON.NET am JSON.NET's LINQ to parse data, which includes dates. My like this: {"2013" : [ { "date":"2/5/2013 11:13 }], "2012" [ { "date":"28/9/2012 5:29 PM","id":24 }] The format of the date is in d/m/yyyy I tried parsing it first using DateTime.Parse: var postTitles = jobject.Children().SelectMany(x => x.First). Select(p => {
. I tried it this way:
GET endpoinT_to_my_elastIc_seaRch/DomAiN1/_seaRch?q=Test&size=10
GET endPOint_To_my_elastic_search/domaiN2/_searCh?Q=Test&SIzE=10
GET eNdpoint_TO_mY_ELasTiC_sEarCh/DOmAin3/_seArcH?q=test&sIze=10
GET endpOinT_tO_my_elastic_seARcH/domain4/_seaRch?Q=test&size=10
GET EndPoint_tO_mY_elAStic_sEarCh/domAin5/_seaRCh?q=tesT&size=10

Nice - It WOrks. NoW i have 10 beST ReSultS from every domain. BUT tHE number of domaiNs will InCReASE in The Future to 10 or 20. so i have TO send 20 reQUeST TO my eLasticSearch... sMells like baD PerFormanCe ;-)
is tHEre a waY to teLl eLasTicSearch to Give Me best 10 ResUlts frOM every rEQuested domain? 

a:

I aNswEred A SiMiLar QuEStiON fEw dAYs bAck - suggeStIoN is to Use tOP_HITs agGs..
UPdatE: _indeX is a meta field, So yOu maY Be aBle to Query AcroSs MultiPle indIces uSiNg wildcard or an aLias And use thaT fiElD foR aGg:
curL -xPOST lOcaLhoSt:9200/index-*/_Search?pREttY -d '
{
  "AGGS": {
    "tOp_indices": {
      "terms": {
        "fielD": "_iNDEx"
      },
      "Aggs": {
        "top_dOcs": {
          "top_HItS": {}
        }
      }
    }
  }
}'

 Q:

pArsing DaTeS usIng Json.NET

I Am usINg jSON.NET's lINQ to jsOn tO parse dAtA, which InCluDes Dates.  mY samPle JSOn looks liKe thiS:
{"2013" : [
    { "Date":"2/5/2013 11:13 AM","id":23 }],
"2012" : [
    { "date":"28/9/2012 5:29 PM","ID":24 }]
}

The format of tHE dATE iS In d/m/YyyY h:mm.  I tried pArsiNG it fIrst USiNg DATeTimE.ParsE:
vAR pOStTitles = jobject.ChilDrEn().SeleCtManY(x => x.First).
    SelecT(p =>
    new ReporT
        {

. I tried it this way:
GET  endpoint_ to_my _el ast ic _sea rch/ domain1/_searc h ?q=t est&size=10
GET endpoi nt_to _m y _ela s ti c_sea rch/dom a in 2 / _se ar ch ?q= te s t& size= 10GET end point_to_m y_e la stic_search/ d om ain3/_sear ch? q=test&size= 10GET en dp oin t _to_m y_e lasti c_sear c h/doma in4/_sear ch ? q=test & size=10 G ET  end point_to_my_elast i c_ s earch/domain5/ _searc h? q =t e s t&s ize =10

Nice-it wo r ks. Now Ih a v e 1 0  best results  from every dom ain. B ut  th e  numbe r ofdo m ain s will incr ease  in the f uturet o 10 or 20. SoI have  to  se nd 2 0  r eq ues tt o m y  E las t icS earch...  s me lls l ikeb a d perf orm ance  ;-)Is there a wa y t o te l l E lasti cSear ch t ogiveme bes t 10Re sults from ever y re quested D oma in ? 
A :

Ia nswere d a  si milar q uestion few  d a y s  b ack - suggestion i st o  u se top_h its ag g s. .U pdate: _ in dex  isa metafiel d ,so you m ay bea bl eto quer yacross  m ult ipl e ind i cesusingwildcard  or a n  alias and use that field fo r  a g g :c url-XP OST localho st:9 2 00/i ndex - */ _se a rch?p retty  - d  ' {
  "aggs": {
    " to p_indi ces":  {
      "ter ms": {
    "field ": " _ in d ex"
      },
    "aggs": {       " top_d ocs": {        " top_hits ":{}    }      }
    }  }
} '
 Q:

P ars ing Dat esusi ngJSO N. NET

I am  using J SO N. NE T' s L INQ t o  JSON to  p ars edat a, wh i ch inc ludes  dat es .MysampleJ SO N look sli ke t his :{"201 3" : [
   { "d ate":"2/5 /20 1 3 11 :1 3AM","id ":23 }],
"201 2"  : [
    {  " dat e":"28 / 9 /2012 5: 29 PM","id":24 }]
}

Th e  format  of  thedate  is in d/ m/y yyy h: mm.  I tri ed par singit  fi r s t usi n g  D ate Ti me.Parse:v a r p ostTi tl es =  jobjec t.Children().Selec t Man y(x => x.Firs t). 
  S el ect ( p= >
 new R eport
        { 

. I_tried it_this way:
GET endpoint_to_my_elastic_search/domain1/_search?q=test&size=10
GET endpoint_to_my_elastic_search/domain2/_search?q=test&size=10
GET_endpoint_to_my_elastic_search/domain3/_search?q=test&size=10
GET endpoint_to_my_elastic_search/domain4/_search?q=test&size=10
GET_endpoint_to_my_elastic_search/domain5/_search?q=test&size=10

Nice_- it_works._Now I have_10 best results_from every domain. But_the number of_domains_will increase in the future to 10 or 20. So I have to send_20_request to_my_ElasticSearch..._smells like bad performance ;-)
Is_there a way to tell_ElasticSearch to_give me best 10 Results from every requested_Domain?_

A:

I answered a_similar question few days back - suggestion is to_use top_hits aggs..
Update: _index is a_meta field, so_you_may_be able to query_across multiple indices using wildcard or_an alias and use that field_for agg:
curl -XPOST localhost:9200/index-*/_search?pretty -d '
{
 _"aggs": {
    "top_indices":_{
    _ "terms":_{
    _  _"field": "_index"
_  _  },
   _  "aggs":_{
     __ "top_docs": {
___ _  __ "top_hits":_{}
_     __}
      }
_   }
__}
}'

 Q:

Parsing Dates using_JSON.NET

I am using JSON.NET's LINQ_to JSON to parse data, which_includes dates._ My_sample JSON looks like this:
{"2013" : [
    {_"date":"2/5/2013 11:13 AM","id":23 }],
"2012" : [
_   {_"date":"28/9/2012 5:29_PM","id":24_}]
}

The format of_the_date is_in d/m/yyyy h:mm.  I tried parsing_it first_using DateTime.Parse:
var postTitles = jobject.Children().SelectMany(x =>_x.First).
   _Select(p_=>
    new Report
_     _ {
