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...

Lav
  • 1,017
  • 2
  • 11
  • 16
  • 2
    Asked and answered previously http://stackoverflow.com/questions/11017543/elasticsearch-parse-exception-error-when-attempting-to-index-pdf – concept47 May 23 '13 at 06:59
  • 1
    i had tried the same but still getting error so i think that converting into base64 is wrong – Lav May 23 '13 at 07:17
  • Sorry about that, I realize it may have come across as dismissive. – concept47 May 23 '13 at 07:26
  • 1
    I think the mapping is not applied to the right type. Should be text instead of doc in the json. – javanna May 23 '13 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. – concept47 May 24 '13 at 05:55
  • It doesn't return IndexMissingException when the problem is on the type name. It will just register the mapping on another type and use the default for the others. Which would be why the binary content is getting parsed as text, thus the error. – javanna May 24 '13 at 19:21
  • i had found out that i had not converted base64 into json format thats why error had occur – Lav May 27 '13 at 06:52

0 Answers0