Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using parent property in update API with doc_as_upsert=true does not work #3444

Closed
poorvamandar opened this issue Aug 5, 2013 · 5 comments
Closed

Comments

@poorvamandar
Copy link

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": {}
}
}
}
}

@ghost ghost assigned javanna Aug 5, 2013
@javanna javanna closed this as completed in 636c35d Aug 6, 2013
javanna added a commit that referenced this issue Aug 6, 2013
… ttl, timestamp, version and versionType)

Closes #3444
@javanna
Copy link
Member

javanna commented Aug 6, 2013

A small note: found and fixed the same issue on upserts (slightly different from doc_as_upsert case)

@poorvamandar
Copy link
Author

Thanks much for the quick fix!

@poorvamandar
Copy link
Author

Hi Luca - is there a nightly build that I can use to get this fix? Or will I have to do my own build?

@javanna
Copy link
Member

javanna commented Aug 9, 2013

@poorvamandar the fix was released with 0.90.3, no need for any nightly build, just download the latest version of elasticsearch ;)

@poorvamandar
Copy link
Author

Ah, thanks Luca!

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants