Setting a mapping for mapper-attachments


(François GUÉRIN) #1

Hi,

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):

https://gist.github.com/frague59/eddc0c9446809ba0c917

When I re-create the index, I've an error in the es logs :
https://gist.github.com/frague59/843dbaea1981b4232a49

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 !


(David Pilato) #2

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?


(François GUÉRIN) #3

I've updated with gist.


(David Pilato) #4

Which version please?


(François GUÉRIN) #5

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 !


(system) #6