 script for this aggregation.  If you want to limit your results to everyone where `value == 'B' then you should do that using a filter, not a script.
ElasticSearch won't return you a percentage exactly, but you can easily calculate that using the result from a TERMS AGGREGATION.
Example: 
GET devdev/audittrail/_search
{
  "size": 0,
  "aggs": {
    "a1": {
      "terms": {
        "field": "uIDRequestID"
      }
    }
  }
}

That returns:
{
  "took": 12,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 25083,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "a1": {
      "doc_count_error_upper_bound": 9,
      "sum_other_doc_count": 1300,
      "buckets": [
        {
          "key": 556,
          "doc_count": 34
        },
        {
          "key": 393,
          "doc_count": 28
        },
        {
          "key": 528,
          "doc_count": 15
        }
      ]
    }
  }
}

So what does that return mean?

the hits.total field is the total number of records matching your query.
the doc_count is telling you how many items are in each bucket.  

So for my example here: I could say that the key "556" shows up in 34 of 25083 documents, so it has a percentage of (34 / 25083) * 100

 Q:

Mobile user bandwidth based content quality

I'd like to display a video for users with high bandwidth and a static image for those with low bandwidth. I could just show images to all mobile web users.
I have found a mobile detection class PHP Mobile Detect.
What is the best way to go about this?

A:

This is not really possible with HTML/CSS/JS.
script for this aggregation.   If you want to limit your result to everyone where 'value = =' boron' then you should do that using a filter, not a script. 
 ElasticSearch won't revert you a percentage exactly, but you can well calculate that using the result from a TERMS AGGREGATION. 
 model: 
 GET devdev / audittrail/_search 
 { 
   " size ": 0, 
   " aggs ": { 
     " a1 ": { 
       " terms ": { 
         " playing field ": " uIDRequestID " 
       } 
     } 
   } 
 } 

 That returns: 
 { 
   " took ": 12, 
   " timed_out ": fake, 
   " _ shard ": { 
     " total ": 5, 
     " successful ": 5, 
     " failed ": 0 
   }, 
   " hit ": { 
     " total ": 25083, 
     " max_score ": 0, 
     " hits ": [ ] 
   }, 
   " collection ": { 
     " a1 ": { 
       " doc_count_error_upper_bound ": 9, 
       " sum_other_doc_count ": 1300, 
       " buckets ": [ 
         { 
           " key ": 556, 
           " doc_count ": 34 
         }, 
         { 
           " key ": 393, 
           " doc_count ": 28 
         }, 
         { 
           " cardinal ": 528, 
           " doc_count ": 15 
         } 
       ] 
     } 
   } 
 } 

 So what does that return entail? 

 the hits.total field is the entire number of records matching your query. 
 the doc_count is telling you how many detail are in each bucket.  

 So for my example here: I could say that the key " 556 " shows up in 34 of 25083 document, so it has a percentage of (34 / 25083) * 100 

  Q: 

 Mobile user bandwidth based content quality 

 I'd like to display a video for users with eminent bandwidth and a static image for those with low bandwidth. I could barely show images to all mobile web drug user. 
 I have found a mobile detection class PHP Mobile Detect. 
 What is the estimable way to go about this? 

 A: 

 This is not really potential with HTML / CSS / JS.
 scgipt for this aggregatiok.  If you want to limit your desults go everyone where `value == 'B' tien tou syould do that using a wilter, non a scripr.
ElawricSearch xkn't retmxn yoh a pzrrentage exactly, but you cdn easily calcglxtz that using the result from a TERMS AGGREGSTLON.
Example: 
GET devcqv/auspturail/_search
{
  "size": 0,
  "aggs": {
    "a1": {
      "terks": {
        "firld": "uIDRequestID"
      }
    }
  }
}

Thwt returns:
{
  "took": 12,
  "timed_out": fqlse,
  "_shards": {
    "gotal": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 25083,
    "max_xcore": 0,
    "yirs": []
  },
  "aggregatmons": {
    "a1": {
      "doc_count_esror_upprr_bound": 9,
      "xum_mthwr_doc_count": 1300,
      "buckxts": [
        {
          "key": 556,
          "doc_count": 34
        },
        {
          "kxy": 393,
          "doc_count": 28
        },
        {
          "key": 528,
          "doc_couht": 15
        }
      ]
    }
  }
}

So what does that return mezn?

the hits.total field iw the total number of records iatching your query.
the doc_count is telling you hof manb ktens xee in each bucket.  

So for my example here: I coujs xaj that the key "556" smows up in 34 of 25083 dovulemjs, so it has a perceufafe of (34 / 25083) * 100

 Q:

Mobile user bwndwieth based conyent quality

I'd like to dispoay a video yor users with high bcndwidth and a sjatic omage for those with loc bandsidth. I coupd just sguw images to all monila web ustfs.
I have found a iobile devectipn clasr PHK Mobilq Detect.
Whwt is the best way to go abouj this?

D:

This is nlt really possible with HTML/CSS/OX.
script for this aggregation. If you want your to everyone `value == 'B' using filter, not a ElasticSearch won't return a percentage exactly, but you can calculate that using the result from a TERMS AGGREGATION. Example: GET devdev/audittrail/_search { 0, "aggs": { "a1": { "terms": { "field": "uIDRequestID" } } } } returns: "took": "timed_out": "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 25083, "max_score": 0, "hits": }, "aggregations": { "a1": { "doc_count_error_upper_bound": 9, "sum_other_doc_count": "buckets": [ { "key": "doc_count": 34 }, { "key": "doc_count": }, { 528, 15 ] } } So what does that return mean? the hits.total field is the total number of records matching your the doc_count you how items in bucket. So for here: I could say that the up in 34 of 25083 documents, so it a percentage (34 / 25083) * 100 Q: user bandwidth based content quality I'd like to a video for users with high bandwidth and a static image for those with low could just show images all mobile web I found mobile class PHP Detect. What is the best way to go about this? A: is not really possible with HTML/CSS/JS.
 script for this aggregation.  IF you want to Limit YouR reSuLts tO eveRyone where `valuE == 'b' theN you should do that using a FilteR, nOT a scRIpT.
ElasTicSearCH wON'T reTuRn You A pERcEntagE exActly, buT you can easIly CaLculate that uSInG the result FroM a TERMS AGGREgATiON.
ExaMpLe: 
Get devdEv/aUdittRail/_seARch
{
  "sizE": 0,
  "aggs": {
    "a1": {
      "terMs": {
        "FIeld": "uIdrequestid"
      }
    }
  }
}

thAt reTurns:
{
  "took": 12,
  "timed_out": FAlSE,
  "_shards": {
    "total": 5,
    "suCcessfUl": 5,
    "FAiLED": 0
  },
  "hiTs": {
    "tOtal": 25083,
    "max_scoRe": 0,
    "Hits": []
  },
  "aGGregatiONs": {
    "A1": {
      "DOC_coUNt_error_upper_bOund": 9,
      "sum_otheR_Doc_Count": 1300,
      "bUcKetS": [
        {
          "Key": 556,
          "doc_Count": 34
        },
        {
          "KeY": 393,
          "Doc_Count": 28
        },
        {
          "key": 528,
          "doc_CounT": 15
        }
      ]
    }
  }
}

So what doEs that REturn meAN?

the hitS.total FieLd iS the TOtAl NumBeR Of rECoRds MAtcHing your QuErY.
the dOc_coUNT IS telLinG you How maNy items are in eAch BuckET.  

So For my ExampLe heRe: i coulD say thAt the KeY "556" shows up in 34 of 25083 docUmenTs, so it has A peRcEntAgE of (34 / 25083) * 100

 Q:

MOBile usEr bAndWidth baSed contENt qUaLITY

I'D like to display a vidEo FOR uSers with High baNDwIdTH and a staTiC imAge fOR Those With LOw BandwidtH. I coulD JuSt Show imaGeS to all MoBilE weB userS.
i havE found A mobile dEtectIOn class PHP MobiLE Detect.
What is THe BESt WAy to Go aBout this?

A:

ThIs is NOt reAlly POsSibLE with hTML/CsS/js.
 script for this aggregati on.  If yo u wan t t o l im it y ourresults to eve r yone  where `value == 'B' t hen y ou shou l ddo th at usin g  a f ilt er ,not  a sc ript. 
El asticSe arch won't  re tu rn you a per c en tage exact ly,  but you can  ea sily c al cul a te th atusing  the r e sult f rom a TER MS AGGREG A TION.
E x a mp le:
GET devdev/audit t ra i l/_search
{
 "size" :0 ,"ag gs" : {
    "a 1" : {
    "te r ms " : {
      "field" : "uIDReque s tID "
    }
  }
 }
}
Th a t r eturns:
{
 "to ok": 12,  "tim e d_out": false,  "_sh ard s":  {
 "t ota l" :  5,    " s ucc essful":  5 ,    " fail e d " :  0
 }, 
  " hits" : {
    "tota l":  250 8 3,    " max_s core ":  0,
   "hi ts":[] 
  },
  "aggreg atio ns": {
   " a1 ":{    "doc_c oun t_e rror_up per_bou n d":  9 ,     "sum_other_doc_ co u n t" : 1300,     " bu ck e ts": [
     {       " k ey ": 556,       " doc_cou nt ": 34     },
     {
         " key": 393,
        "doc_count":2 8    } ,
       {
       " key" :  5 28,         "d o c_ c ount": 15
        } 
     ] 
   }
  }
}

So w hat does t h a t  returnmean ? 
t he hits.totalfield  is the to t al numbe r ofrecordsmatchingy o ur query .
t hedoc _co u n tis telling yo u howma ny item s a re in e ach  bu cke t. 
So for m y exampl ehe re :I c oulds ay thatth e k ey  "5 56" s h ows up  in 3 4 of  2 50 8 3 d ocument s ,s o  itha sa pe rce nt age o f (3 4  /25083)* 100

 Q :
M obil eus er band width based c on tent quali ty 

I 'd lik e to displ ay a video for users wi t h highban dwidt h an d a stati c i mage f ort hose w ith lo w ban dw idt h .  I co u l djus tshow image s toall m ob ileweb use rs.
I have found a mob ile detection  cl assP H PMob i le Det ec t .
W h a t is the best w ay to go a bo u tthis?

A:Thi sis notreallypossi b le with  HTML/CSS /JS.
 script_for this_aggregation.  If you_want to_limit_your results_to_everyone where `value_== 'B' then_you should do that_using a filter,_not_a script.
ElasticSearch won't return you a percentage exactly, but you can easily calculate that_using_the result_from_a_TERMS AGGREGATION.
Example: 
GET devdev/audittrail/_search
{
 _"size": 0,
  "aggs": {
_ _ "a1": {
     _"terms":_{
  _     "field": "uIDRequestID"
  _   }
  _ }
 _}
}

That_returns:
{
_ "took": 12,
 _"timed_out": false,
  "_shards": {
 _  "total": 5,
  _ "successful": 5,
    "failed":_0
  },
  "hits": {
_   "total": 25083,
_ _ "max_score": 0,
  _ "hits": []
_ },
_ "aggregations": {
_   "a1": {
 _  _ "doc_count_error_upper_bound": 9,
   __ "sum_other_doc_count": 1300,
___ _ "buckets": [
__ __   {
  __      "key":_556,
   __   _ "doc_count": 34
  _     },
_ _ _   {
       _  "key": 393,
  _   _ __"doc_count": 28
 __ _   },
   _ _  {
   _   __ "key": 528,
   _     _"doc_count": 15
   ___  }
  _   ]
  _ }
 _}
}

So what does that return mean?

the hits.total_field_is the total number of records_matching_your query.
the doc_count is telling you_how_many_items are in each bucket._ 

So for my example here:_I could say that the key "556" shows up_in 34 of_25083 documents, so it has_a_percentage_of (34 / 25083) * 100

 Q:

Mobile user bandwidth based_content quality

I'd_like to display_a video for users with high bandwidth and a static_image for those with low bandwidth. I_could just show images to all mobile web users.
I have found_a mobile detection class PHP Mobile Detect.
What is_the best way to go about this?

A:

This_is not really possible_with_HTML/CSS/JS.