本文整理汇总了C#中ISearchResponse类的典型用法代码示例。如果您正苦于以下问题:C# ISearchResponse类的具体用法?C# ISearchResponse怎么用?C# ISearchResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISearchResponse类属于命名空间,在下文中一共展示了ISearchResponse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var sigNames = response.Aggs.SignificantTerms("significant_names");
sigNames.Should().NotBeNull();
sigNames.DocCount.Should().BeGreaterThan(0);
}
示例2: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.IsValid.Should().BeTrue();
var commitsSum = response.Aggs.Sum("commits_sum");
commitsSum.Should().NotBeNull();
commitsSum.Value.Should().BeGreaterThan(0);
}
示例3: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
/** === Handling Responses
* Using the `.Agg` aggregation helper we can fetch our aggregation results easily
* in the correct type. <<aggs-vs-aggregations, Be sure to read more about .Aggs vs .Aggregations>>
*/
response.IsValid.Should().BeTrue();
var filterAgg = response.Aggs.Filters("projects_by_state");
filterAgg.Should().NotBeNull();
var namedResult = filterAgg.NamedBucket("belly_up");
namedResult.Should().NotBeNull();
namedResult.DocCount.Should().BeGreaterThan(0);
namedResult = filterAgg.NamedBucket("stable");
namedResult.Should().NotBeNull();
namedResult.DocCount.Should().BeGreaterThan(0);
namedResult = filterAgg.NamedBucket("very_active");
namedResult.Should().NotBeNull();
namedResult.DocCount.Should().BeGreaterThan(0);
namedResult = filterAgg.NamedBucket("other_states_of_being");
namedResult.Should().NotBeNull();
namedResult.DocCount.Should().Be(0);
}
示例4: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.IsValid.Should().BeTrue();
var min = response.Aggs.Max("min_commits");
min.Should().NotBeNull();
min.Value.Should().BeGreaterThan(0);
}
示例5: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var max = response.Aggs.Max("max_commits");
max.Should().NotBeNull();
max.Value.Should().BeGreaterThan(0);
}
示例6: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.IsValid.Should().BeTrue();
var commitsAvg = response.Aggs.Average("average_commits");
commitsAvg.Should().NotBeNull();
commitsAvg.Value.Should().BeGreaterThan(0);
}
示例7: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.IsValid.Should().BeTrue();
var commitCount = response.Aggs.ValueCount("commit_count");
commitCount.Should().NotBeNull();
commitCount.Value.Should().BeGreaterThan(0);
}
示例8: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.IsValid.Should().BeTrue();
var projectCount = response.Aggs.Cardinality("state_count");
projectCount.Should().NotBeNull();
projectCount.Value.Should().Be(3);
}
示例9: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var sumTheHardWay = response.Aggs.ScriptedMetric("sum_the_hard_way");
sumTheHardWay.Should().NotBeNull();
sumTheHardWay.Value<int>().Should().BeGreaterThan(0);
}
示例10: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var min = response.Aggs.Min("min_last_activity");
min.Should().NotBeNull();
min.Value.Should().BeGreaterThan(0);
min.ValueAsString.Should().NotBeNullOrEmpty();
}
示例11: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.IsValid.Should().BeTrue();
var commits = response.Aggs.Histogram("commits");
commits.Should().NotBeNull();
foreach (var item in commits.Items)
item.DocCount.Should().BeGreaterThan(0);
}
示例12: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.IsValid.Should().BeTrue();
var allProjects = response.Aggs.Global("all_projects");
allProjects.Should().NotBeNull();
var names = allProjects.Terms("names");
names.Should().NotBeNull();
}
示例13: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var commitsAvg = response.Aggs.Average("average_commits");
commitsAvg.Should().NotBeNull();
commitsAvg.Value.Should().BeGreaterThan(0);
commitsAvg.Meta.Should().NotBeNull().And.HaveCount(1);
commitsAvg.Meta["foo"].Should().Be("bar");
}
示例14: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.IsValid.Should().BeTrue();
var ringsAroundAmsterdam = response.Aggs.GeoDistance("rings_around_amsterdam");
ringsAroundAmsterdam.Should().NotBeNull();
ringsAroundAmsterdam.Items.Where(r => r.Key == "*-100.0").FirstOrDefault().Should().NotBeNull();
ringsAroundAmsterdam.Items.Where(r => r.Key == "100.0-300.0").FirstOrDefault().Should().NotBeNull();
ringsAroundAmsterdam.Items.Where(r => r.Key == "300.0-*").FirstOrDefault().Should().NotBeNull();
}
示例15: ExpectResponse
protected override void ExpectResponse(ISearchResponse<Project> response)
{
response.ShouldBeValid();
var commitsOutlier = response.Aggs.PercentileRanks("commits_outlier");
commitsOutlier.Should().NotBeNull();
commitsOutlier.Items.Should().NotBeNullOrEmpty();
foreach (var item in commitsOutlier.Items)
item.Should().NotBeNull();
}