3

I am new to elasticsearch. I was trying to index the attachment but getting error. i had executed following step. Installed the Mapper-attachment plugin

i had converted text file to base64 with openssl command

      openssl enc -base64 -in test3.txt -out t3.file

after that i had created mapping

     [root@n1 testcase]# curl -XPUT 'http://localhost:9200/indextryes/?pretty=1'  -d '
      { "mappings" : { "doc" : { "properties" : {"file" : {"type" : "attachment"}}}}}'

     {
      "ok" : true,
        "acknowledged" : true
     }

when i try to index it i got following error message

      [root@n1 testcase]# curl -X POST "localhost:9200/indextryes/text" -d @t3.file  
     {"error":"MapperParsingException[failed to parse]; nested: ElasticSearchParseException[Failed to derive xcontent from (offset=0, length=64): [98, 71, 86, 48, 99, 121, 66, 107, 98, 121, 66, 104, 98, 109, 57, 48, 97, 71, 86, 121, 73, 72, 82, 108, 99, 51, 81, 103, 89, 87, 53, 107, 73, 72, 90, 108, 99, 109, 108, 109, 101, 83, 66, 108, 98, 71, 70, 122, 100, 71, 108, 106, 99, 50, 86, 104, 99, 109, 78, 111, 76, 103, 61, 61]]; ","status":400}

thanks for help...

7
  • 2
    Asked and answered previously stackoverflow.com/questions/11017543/… Commented May 23, 2013 at 6:59
  • 1
    i had tried the same but still getting error so i think that converting into base64 is wrong Commented May 23, 2013 at 7:17
  • Sorry about that, I realize it may have come across as dismissive. Commented May 23, 2013 at 7:26
  • 1
    I think the mapping is not applied to the right type. Should be text instead of doc in the json. Commented May 23, 2013 at 18:39
  • I thought the same thing, but I figured it was just a typo as the error would have been different (index not found) vs what it was above. Commented May 24, 2013 at 5:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.