Mapper parsing exception even after installed ingest attachment 5.0.1

Hi,
I installed elastic search 5.0.1 in Unix and installed 'ingest_Attachment_5.0.1' (Also restarted after ingest attachment installation).
I created an index using command : curl -X PUT 10.242.104.46:9200/test1.
Then when i tried creating mapping, i got an error as shown below. Please help to resolve this,

curl -XPUT 'http://10.242.104.46:9200/test1/person/_mapping' -d '{
"person": {
"properties": {
"file": {
"type": "attachment",
"path": "full",
"fields": {
"file": {
"type": "string",
"term_vector":"with_positions_offsets",
"store": true
}
}
}
}
}
}'

{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"No handler for type [attachment] declared on field [file]"}],"type":"mapper_parsing_exception","reason":"No handler for type [attachment] declared on field [file]"},"status":400}.

Please format your code using </> icon. It will make your post more readable.

Ingest does not provide a new type of field.
Just follow the guide here https://www.elastic.co/guide/en/elasticsearch/plugins/current/using-ingest-attachment.html

Thanks David, I will try the code as in that guide ..Before that , Could i please ask you , how do i get the base64 "string" that is being passed for the field 'data'.
For instance, {
"data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="
}
I am new to elastic search, Requesting your help please. I am trying to index pdf documents in elasticsearch

May be use something like: http://www.motobit.com/util/base64-decoder-encoder.asp

On Linux may be:

base64 yourfile.pdf

Also have a look at https://github.com/dadoonet/fscrawler

Thanks again David .. I tried with the example given in https://www.elastic.co/guide/en/elasticsearch/plugins/current/using-ingest-attachment.html
i created 'myindex2' wih pipeline attachment as shown below,
curl -XGET 'http://10.242.104.46:9200/my_index2/my_type/my_id?pretty'
{
"_index" : "my_index2",
"_type" : "my_type",
"_id" : "my_id",
"_version" : 1,
"found" : true,
"_source" : {
"data" : "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0=",
"attachment" : {
"content_type" : "application/rtf",
"language" : "ro",
"content" : "Lorem ipsum dolor sit amet",
"content_length" : 28
}
}
}

I tried to do search the content 'dolor' using below command,
curl -XGET 'http://10.242.104.46:9200/my_index2/search?q=content:dolor'
Output HIts is 0. Please correct if i am doing it wrong ..
emphasized text_

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.