NOTE: You are looking at documentation for an older release. For the latest information, see the current release documentation.
Has Child Query Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Has Child Query Usage
editFluent DSL example
editq
.HasChild<CommitActivity>(c => c
.Name("named_query")
.Boost(1.1)
.InnerHits(i => i.Explain())
.MaxChildren(5)
.MinChildren(1)
.ScoreMode(ChildScoreMode.Average)
.Query(qq => qq.MatchAll())
)
Object Initializer syntax example
editnew HasChildQuery
{
Name = "named_query",
Boost = 1.1,
TypeRelation = Infer.Relation<CommitActivity>(),
InnerHits = new InnerHits { Explain = true },
MaxChildren = 5,
MinChildren = 1,
Query = new MatchAllQuery(),
ScoreMode = ChildScoreMode.Average
}
Example json output.
{
"has_child": {
"_name": "named_query",
"boost": 1.1,
"type": "commits",
"score_mode": "avg",
"min_children": 1,
"max_children": 5,
"query": {
"match_all": {}
},
"inner_hits": {
"explain": true
}
}
}