So I'm fairly new to Elasticsearch and am having trouble trying to get attachments to work. The system I'm working with pretty much does everything through the Java API and while I've been able to figure out most stuff getting attachments to work has been eluding me. I don't know if the problem is in how I've set up the mapping, or in how I'm trying search.
Basically, attachments seem to be properly indexed and I'm not getting errors in the log. I definitely know if the plugin isn't working or loaded because I'll get a ton of errors. If I search for the Byte64 encoded string itself I'll get back the attachment, so I know that the attachment itself is getting to the system.. But if I try to search on the contents of the attachment (a basic pdf) I get no results.
Mapping ends up looking like this:
"InfoEnvModel_Problem": {
"_all": {
"index_analyzer": "nGram_analyzer",
"search_analyzer": "whitespace_analyzer"
},
"properties": {
"InfoEnvModel_hasCollection": {
"type": "string",
"index": "not_analyzed",
"ignore_above": 5000
},
"InfoEnvModel_hasKleStatus": {
"type": "nested",
"properties": {
"reason": {
"type": "string",
"index_analyzer": "nGram_analyzer",
"search_analyzer": "whitespace_analyzer",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed",
"ignore_above": 5000
}
}
},
"status": {
"type": "string",
"index_analyzer": "nGram_analyzer",
"search_analyzer": "whitespace_analyzer",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed",
"ignore_above": 5000
}
}
}
}
},
"InfoEnvModel_hasManeuverStatus": {
..................
},
"InfoEnvModel_hasTaskInitiationAttachment": {
"type": "attachment",
"path": "full",
"fields": {
"InfoEnvModel_hasTaskInitiationAttachment": {
"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"
}
}
},
.............
Which seems to be correct. I've played around with overriding the various default meta fields and trying to add a 'file' or 'content' field which doesn't break anything but hasn't solved the problem. I just curious if anyone could give me some direction on how to figure out what I'm doing wrong.
Thanks for any help,
Eric