You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I try to add a document using the bulk update API (doc_as_upsert=true) and set its parent property, I do not see the document as the child of the specified parent when I make a has_parent query. Can you please help see what could be wrong with the below. Thanks in advance.
If I try to add a document using the bulk update API (doc_as_upsert=true) and set its parent property, I do not see the document as the child of the specified parent when I make a has_parent query. Can you please help see what could be wrong with the below. Thanks in advance.
Following is the mapping:
mappings: {
store: {
properties: {
name: {
type: string
}
owner: {
type: string
}
}
}
department: {
_routing: {
required: true
}
properties: {
name: {
type: string
}
numberOfProducts: {
type: long
}
}
_parent: {
type: store
}
}
}
Following is the bulk input file:
{ "index" : { "_index" : "parent_child", "_type" : "store", "_id" : "store1" } }
{ "name" : "auchan", "owner" : "chris" }
{ "index" : { "_index" : "parent_child", "_type" : "department", "_id" : "department1", "parent" : "store1" } }
{ "name" : "toys", "numberOfProducts" : 150 }
{ "update" : { "_index" : "parent_child", "_type" : "department", "_id" : "department2", "parent" : "store1" } }
{"doc" : { "name" : "dolls", "numberOfProducts" : 300 }, "doc_as_upsert" : "true"}
Query -
{
"query": {
"has_parent": {
"type": "store",
"query": {
"match_all": {}
}
}
}
}
The text was updated successfully, but these errors were encountered: