Has Parent Query Usage

edit

Fluent DSL example

edit
q
.HasParent<Developer>(c => c
    .Name("named_query")
    .Boost(1.1)
    .InnerHits(i => i.Explain())
    .Score()
    .Query(qq => qq.MatchAll())
    .IgnoreUnmapped()
)

Object Initializer syntax example

edit
new HasParentQuery
{
    Name = "named_query",
    Boost = 1.1,
    ParentType = Infer.Relation<Developer>(),
    InnerHits = new InnerHits { Explain = true },
    Query = new MatchAllQuery(),
    Score = true,
    IgnoreUnmapped = true
}

Example json output.

{
  "has_parent": {
    "_name": "named_query",
    "boost": 1.1,
    "parent_type": "developer",
    "score": true,
    "ignore_unmapped": true,
    "query": {
      "match_all": {}
    },
    "inner_hits": {
      "explain": true
    }
  }
}