Hello,
I want to search into attachment value but I don't get any outcome document (I tried to use other fields - no attachment field - and works properly). So, if I have the following document in Elastic Search:
GET /example/fs/LONG_XML_7
{
"_index": "example",
"_type": "fs",
"_id": "LONG_XML_7",
"_version": 1,
"found": true,
"_source": {
"content": "PD94bWwgdmVyc2lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9yPlBhY288L2F1dGhvcj48dGl0bGU+U3ByaW5nLUJvb3Q8L3RpdGxlPjwvYm9vaz48Ym9vayBpZD0iYmsxMDEiPjxhdXRob3I+QXV0aG9yIFRlc3Q8L2F1dGhvcj48dGl0bGU+VGl0bGUgVGVzdDwvdGl0bGU+PC9ib29rPjxib29rIGlkPSJiazEwMSI+PGF1dGhvcj5QYWNvPC9hdXRob3I+PHRpdGxlPkVsYXN0aWMgU2VhcmNoPC90aXRsZT48L2Jvb2s+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9yPk5vYm9keTwvYXV0aG9yPjx0aXRsZT5Ob3RoaW5nPC90aXRsZT48L2Jvb2s+",
"upload_date": "2016-01-16T22:56:37.419000",
"md5": "7e8c66a0a97e1fafaef1fc6ce36f4f28"
}
}
And I try to do a search on the content field (attachment) like this:
GET /example/fs/_search
{
"query": {
"match": {
"content": "Nothing"
}
}
}
I don't get any outcome document
My mapping is the following:
{
"example": {
"mappings": {
"fs": {
"properties": {
"chunkSize": {
"type": "integer",
"store": true
},
"content": {
"type": "attachment",
"path": "full",
"fields": {
"content": {
"type": "string"
},
"author": {
"type": "string"
},
"title": {
"type": "string"
},
"name": {
"type": "string"
},
"date": {
"type": "date",
"format": "dateOptionalTime"
},
"keywords": {
"type": "string"
},
"content_type": {
"type": "string"
},
"content_length": {
"type": "integer"
},
"language": {
"type": "string"
}
}
},
"data": {
"type": "attachment",
"path": "full",
"fields": {
"data": {
"type": "string"
},
"author": {
"type": "string"
},
"title": {
"type": "string"
},
"name": {
"type": "string"
},
"date": {
"type": "date",
"format": "dateOptionalTime"
},
"keywords": {
"type": "string"
},
"content_type": {
"type": "string"
},
"content_length": {
"type": "integer"
},
"language": {
"type": "string"
}
}
},
"files_id": {
"type": "string",
"store": true
},
"length": {
"type": "integer",
"store": true
},
"md5": {
"type": "string",
"store": true
},
"n": {
"type": "integer",
"store": true
},
"uploadDate": {
"type": "date",
"store": true,
"format": "dateOptionalTime"
},
"upload_date": {
"type": "date",
"format": "dateOptionalTime"
}
}
}
}
}
}
}
What is it wrong?
Many thanks!
Regards,
Paco.