Setting a mapping for mapper-attachments


I'm using elasticsearch through django haystack, and I'm trying to set a mapping for an attachment.
This mapping is PUT to the es engine when creating the new index. This operation is done when rebuilding index.

My mapping looks like this (python dict encoded, json is produced later):

When I re-create the index, I've an error in the es logs :

I've tryed many settings conbinations, but I'm still stuck : the mapping is not created.
I've watched sour-code for mapper attachment, but I can't figure out how to set the mapping...

Thanks for your help !

Hi François

Could you please edit your thread and add a proper formatting. It's really hard to read.

You can use this to format a full block


But don't use ` before each line.

Could you also give the versions you are using please?

I've updated with gist.

Which version please?

I'm using mapper-attachments 3.1.1 with 2.1 elasticsearch.
I've corrected some things :

  • "mapping" key must be at the same level than "settings"
  • The rebuild_index command explores the objects classes to index, then it builds the mapping. I've re-wrote the mapping building, and it works better now.

Thanks !