Hi elastic,
I'm indexing some text files to elastic search, i've installed ingest attachment plugin and successfully created mapping and indexed few text files in to ES and the file which i've indexed is Base 64 encoded.
Now i'm perform search query to see content "Hello World", but the search query which i performed is not giving expected output. so could guys help me in writing search query that should look for only particular content out of all the files which i've indexed.
PUT _ingest/pipeline/attachment
{
"description" : "Extract attachment information from arrays",
"processors" : [
{
"foreach": {
"field": "attachments",
"processor": {
"attachment": {
"target_field": "_ingest._value.attachment",
"field": "_ingest._value.data"
}
}
}
}
]
}
PUT company/employee/my_id?pipeline=attachment
{
"attachments":[
{
"filename":"test.txt",
"data":"dGVzdCBvbmUgZmlsZQ=="
},
{
"filename":"test1.txt",
"data":"IkhlbGxvIFdvcmxkIg=="
},
{
"filename":"test2.txt",
"data":"dGVzdDNmaWxlIHF3ZXJ0eQ=="
},
{
"filename":"test3.txt",
"data":"dGVzdA0KdGVzdDQNCnRlc3Q0NA0KdGVzdDQ0NA=="
}
]
}
GET company/employee/_search
{
"query": { "match_phrase": {
"attachments.attachment.content": "hello world"
}
},
"highlight": {
"fields": {
"content":["Hello"]
}
}
}