I was able to resolve this through following, first created a mapping in config.yml as shown
# Elastica Configuration
fos_elastica:
clients:
default: { host: localhost, port: 9200 }
indexes:
website:
client: default
index_name: docova
types:
documents:
mappings:
Doc_Title: ~
Description: ~
Attachments:
type: "object"
properties:
File_Name:
content:
type: attachment
persistence:
driver: orm
model: Docova\DocovaBundle\Entity\Documents
provider: ~
listener: ~
finder: ~
Then I needed to make a change to one of entity to return attachment as a binary content to elastic search as shown below:
return file_get_contents($this->file_path . DIRECTORY_SEPARATOR . $this->getDocument()->getId() . DIRECTORY_SEPARATOR . md5($this->File_Name), 'r');
This solved it for me.