public SignificantTermKeyItem(SignificantTermItem item) { DocCount = item.DocCount; BgCount = item.BgCount; Score = item.Score; Key = Text = Value = item.Key; Aggregations = SearchAggregationParser.Parse(item.Aggregations); var splitKey = Key.Split(new[] { FilterField.DefaultDelimiter }, StringSplitOptions.RemoveEmptyEntries); if (splitKey.Length == 2) { Value = splitKey[0]; Text = splitKey[1]; } }
private IAggregation GetSignificantTermItem(JsonReader reader, JsonSerializer serializer, KeyItem keyItem) { reader.Read(); var score = reader.Value as double?; reader.Read(); reader.Read(); var bgCount = reader.Value as long?; var significantTermItem = new SignificantTermItem() { Key = keyItem.Key, DocCount = keyItem.DocCount, BgCount = bgCount.GetValueOrDefault(0), Score = score.GetValueOrDefault(0) }; reader.Read(); significantTermItem.Aggregations = this.GetNestedAggregations(reader, serializer); return(significantTermItem); }
private IAggregation GetSignificantTermItem(JsonReader reader, JsonSerializer serializer, KeyItem keyItem) { reader.Read(); var score = reader.Value as double?; reader.Read(); reader.Read(); var bgCount = reader.Value as long?; var significantTermItem = new SignificantTermItem() { Key = keyItem.Key, DocCount = keyItem.DocCount, BgCount = bgCount.GetValueOrDefault(0), Score = score.GetValueOrDefault(0) }; reader.Read(); significantTermItem.Aggregations = this.GetNestedAggregations(reader, serializer); return significantTermItem; }