Copy_to and nested field type


#1

Hi,

I have difficulty with copy_to and nested field. I'm trying to copy some field value from original document to nested document, and as I can see from stored_fields, it has been copied successfully. The problem appears when I try to query that "copied_to" field - it returns zero results although I know there are lots of documents that match the query. Does anybody know what am I missing?

Here is my mapping:
{
"mappings": {
"property": {
"properties": {
"bedrooms": {
"type": "byte",
"copy_to": "discount.bedrooms"
},
"discount": {
"type": "nested",
"properties": {
"value": {"type": "integer"},
"bedrooms": {"type": "byte"}
}
}
}
}
}
}

GET /_search
{
"query": {
"nested": {
"path": "discount",
"query": {
"term": {
"discount.bedrooms": 5
}
}
}
}
}


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.