Attachment Plugin : content-type autodetection


(David Pilato) #1

Heya,

I'm working on an issue about content-type autodetection that doesn't seem
to work as expected.

I just added a tika().detect() method and I'm able to see in debug mode that
my file is right detected by the mapper attachment plugin.

But when Elasticsearch saved the document, metadata does not seem to be
added.

@Shay : would you please have a look at my commit :
https://github.com/dadoonet/elasticsearch-mapper-attachments

And run the test case I added :
<https://github.com/dadoonet/elasticsearch-mapper-attachments/blob/master/sr
c/test/java/org/elasticsearch/plugin/mapper/attachments/test/SimpleAttachmen
tIntegrationTests.java#L139>
https://github.com/dadoonet/elasticsearch-mapper-attachments/blob/master/src
/test/java/org/elasticsearch/plugin/mapper/attachments/test/SimpleAttachment
IntegrationTests.java#L139

You will see that assertThat(getResponse.field("file.content_type"),
notNullValue()); fail.

Same for assertThat(getResponse.field("file._content_type"),
notNullValue());

Any idea?

Thanks

David.


(system) #2