internal override void WrapInContainer(AggregationContainer c) => c.Missing = this;
 internal override void WrapInContainer(AggregationContainer c) => c.TopHits = this;
 internal override void WrapInContainer(AggregationContainer c) => c.MovingFunction = this;
 internal override void WrapInContainer(AggregationContainer c) => c.IpRange = this;
 internal override void WrapInContainer(AggregationContainer c) => c.Cardinality = this;
 internal override void WrapInContainer(AggregationContainer c) => c.StatsBucket = this;
 internal override void WrapInContainer(AggregationContainer c) => c.GeoDistance = this;
 internal override void WrapInContainer(AggregationContainer c) => c.SerialDifferencing = this;
Beispiel #9
0
 internal override void WrapInContainer(AggregationContainer c) => c.GeoCentroid = this;
 internal override void WrapInContainer(AggregationContainer c) => c.Histogram = this;
Beispiel #11
0
 internal override void WrapInContainer(AggregationContainer c) => c.Composite = this;
Beispiel #12
0
 internal override void WrapInContainer(AggregationContainer c) => c.BucketScript = this;
Beispiel #13
0
 internal override void WrapInContainer(AggregationContainer c) => c.Derivative = this;
Beispiel #14
0
 internal override void WrapInContainer(AggregationContainer c) => c.WeightedAverage = this;
Beispiel #15
0
        public object GetObjectCount(Object obj, Object Criteria)
        {

            Type typeObj = obj.GetType();
            Type filtertype = Criteria.GetType();
            if (!System.Configuration.ConfigurationManager.AppSettings["StorageType"].Equals("SQL"))
            {
                var node = new Uri(blueChappieSetttings.BlueChappieElasticServer + "/" + typeObj.Name + "lib/");
                var client = new Nest.ElasticClient(node);
                var searchRequest = new Nest.SearchRequest();
                var aggregationRequest = new Nest.AggregationContainer();
                QueryContainer andQuery = null;
                ValueCountAggregation vcagg = null;
                foreach (var imgFields in filtertype.GetProperties())
                {
                    if (imgFields.GetValue(Criteria) != null)
                    {
                        if (!imgFields.GetValue(Criteria).Equals(""))
                        {
                            andQuery &= new TermQuery
                            {
                                Field = imgFields,
                                Value = imgFields.GetValue(Criteria)
                            };
                            //vcagg &= new ValueCountAggregation {
                            //    name ="a",
                            //    Field = imgFields
                            //};
                        }
                    }
                }
                var query = client.Search<object>(s => s
                                       .Query(q => q
                                       .ConstantScore(c => c
                                       .Filter(fl => fl
                                        && andQuery))));
                var docs = query.Documents;
                DataTable tbl;
                foreach (var rows in docs)
                {
                    tbl = (DataTable)JsonConvert.DeserializeObject("[" + rows.Suffix("]") + "]", (typeof(DataTable)));
                    foreach (DataRow row in tbl.Rows)
                    {
                        foreach (System.Data.DataColumn fld in tbl.Columns)
                        {
                            foreach (PropertyInfo imgFields in typeObj.GetProperties())
                            {
                                if (imgFields.Name.Equals(fld.ColumnName))
                                {
                                    if (imgFields.CanWrite)
                                    {
                                        imgFields.SetValue(obj, row.Field<object>(fld.ToString()));
                                    }
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                System.Data.DataSet dataSet = new System.Data.DataSet();
                System.Data.SqlClient.SqlConnection sqlConnection = new System.Data.SqlClient.SqlConnection("Database=BlueChappie;Server=localhost;uid=ProTrack2;pwd=protrack123;Connect Timeout=30;Min Pool Size=5;Max Pool Size=900;");
                System.Data.SqlClient.SqlDataAdapter sqlDataAdapter = new System.Data.SqlClient.SqlDataAdapter();

                string SQLStatement = "SELECT TOP 1 * FROM " + typeObj.Name + "lib with (nolock) WHERE 1=1";
                string filter = "";
                foreach (PropertyInfo imgFields in filtertype.GetProperties())
                {
                    if (imgFields.GetValue(Criteria) != null)
                    {
                        if (!imgFields.GetValue(Criteria).Equals(""))
                        {
                            filter += ((filter.Equals("")) ? "" : " AND ") + imgFields.Name + "='" + imgFields.GetValue(Criteria) + "', ";
                        }
                    }
                }
                if (filter.Length > 0)
                {
                    filter = filter.Substring(0, filter.Length - 2);
                    SQLStatement = SQLStatement.Replace("1=1", filter);
                }
                sqlDataAdapter.SelectCommand = new System.Data.SqlClient.SqlCommand(filter, sqlConnection);
                sqlDataAdapter.Fill(dataSet);
                DataTable tbl = dataSet.Tables[0];
                tbl.TableName = typeObj.Name + "lib";
                foreach (System.Data.DataRow row in tbl.Rows)
                    foreach (System.Data.DataColumn fld in tbl.Columns)
                    {
                        foreach (PropertyInfo imgFields in typeObj.GetProperties())
                        {
                            if (imgFields.Name.Equals(fld.ColumnName))
                            {

                                if (imgFields.CanWrite)
                                {
                                    imgFields.SetValue(obj, row.Field<object>(fld.ToString()));
                                }
                            }
                        }
                    }
            }

            return obj;
        }
Beispiel #16
0
 internal override void WrapInContainer(AggregationContainer c) => c.MatrixStats = this;
Beispiel #17
0
 internal override void WrapInContainer(AggregationContainer c) => c.AdjacencyMatrix = this;
 internal override void WrapInContainer(AggregationContainer c) => c.GeoBounds = this;
Beispiel #19
0
 internal override void WrapInContainer(AggregationContainer c) => c.MovingAverage = this;
 public void Add(string key, AggregationContainer value) => BackingDictionary.Add(ValidateKey(key), value);
		internal override void WrapInContainer(AggregationContainer c) => c.PercentilesBucket = this;
 internal override void WrapInContainer(AggregationContainer c) => c.ScriptedMetric = this;
Beispiel #23
0
 internal override void WrapInContainer(AggregationContainer c) => c.Nested = this;
Beispiel #24
0
 internal override void WrapInContainer(AggregationContainer c) => c.Sampler = this;
 internal override void WrapInContainer(AggregationContainer c) => c.SignificantTerms = this;
 internal override void WrapInContainer(AggregationContainer c) => c.RareTerms = this;
 internal override void WrapInContainer(AggregationContainer c) => c.MovingPercentiles = this;
Beispiel #28
0
 internal override void WrapInContainer(AggregationContainer c) => c.ValueCount = this;
 internal override void WrapInContainer(AggregationContainer c) => c.CumulativeSum = this;
 internal override void WrapInContainer(AggregationContainer c) => c.BucketSelector = this;
 internal override void WrapInContainer(AggregationContainer c) => c.Filters = this;