private static InsolvenceSearchResult NewSubjektVInsolvenci(int count, string typ, bool limitedView)
        {
            var client = Manager.GetESClient_Insolvence();

            try
            {
                var rs = Insolvence.SimpleSearch("dluznici.typ:" + typ, 1, count,
                                                 (int)InsolvenceSearchResult.InsolvenceOrderResult.DateAddedDesc, false, limitedView, null);
                //client.Search<Rizeni>(s =>
                //s.Size(count)
                //.Sort(o => o.Field(f => f.Field(a => a.DatumZalozeni).Descending()))
                //.Query(q => q.Match(m => m.Field("dluznici.typ").Query(typ))));

                return(rs);
            }
            catch (Exception)
            {
                // TODO: handle error
                throw;
            }
        }
 public RizeniStatistic(string spisovaZnacka, IEnumerable <string> filterDluzniciFromThisList = null)
     : this(Insolvence.LoadFromES(spisovaZnacka, false, false)?.Rizeni, filterDluzniciFromThisList)
 {
 }