Mapper-attachments

I am trying to install mapper-attachments for es 2.3.1. if follow https://www.elastic.co/guide/en/elasticsearch/plugins/current/mapper-attachments.html it would install mapper-attachments 2.3.1 (same as es). but here GitHub - elastic/elasticsearch-mapper-attachments: Mapper Attachments Type plugin for Elasticsearch looks the version are different. if I need to install from the later link, what does this mean?

2.1 elasticsearch repository github?

I tried to install the plugin from the zip file elasticsearch-mapper-attachments-master.zip, it said NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
ERROR: Could not find plugin descriptor 'plugin-descriptor.properties' in plugin zip

so a little confusing..

thanks!

Just read the guide (the first link you provided).

https://www.elastic.co/guide/en/elasticsearch/plugins/current/mapper-attachments.html#mapper-attachments-install

If you read the very first lines of the README in the GitHub repo you would see also the link to this guide.

thanks. I got your point.

Very wired here.

here is my env:

http://localhost:9200/_nodes/plugins?pretty

{
  "cluster_name" : "elasticsearch",
  "nodes" : {
    "hYCvRc1yQSK3BoClf5C5zQ" : {
      "name" : "Destroyer of Demons",
      "transport_address" : "127.0.0.1:9300",
      "host" : "127.0.0.1",
      "ip" : "127.0.0.1",
      "version" : "**2.3.1"**,
      "build" : "bd98092",
      "http_address" : "127.0.0.1:9200",
      "plugins" : [ {
        "name" : "**mapper-attachments**",
        "version" : **"2.3.1",**
        ...
      } ],

mapping is:

"tech": {
    "mappings": {
      "manual": {
        "properties": {
          "file": {
            "type": "attachment",
            "fields": {
              "content": {
                "type": "string"
              },
              "author": {
                "type": "string"
              },
              "**title**": {
                "type": "string",
                "store": true
              },
              "**name**": {
                "type": "string"
              },
              "date": {
                "type": "string",
                "store": true
              },
              "**keywords**": {
                "type": "string",
                "store": true
              },
              "**content_type**": {
                "type": "string",
                "store": true
              },
              "content_length": {
                "type": "string",
                "store": true
              },
              "**language**": {
                "type": "string",
                "store": true
              }
            }
          }
        }
      }

I am able to see the content of the indexed document:

   "_source": {
      "file": {
        "_content": "JVBERi0xLjcNJeLjz9MNCg==M......=ZW5kc3RyZWFtDWVuZG9iag1zdGFydHhyZWYNCg==MTE2DQo=JSVFT0YNCg=="
        "_name": "12-240.pdf",
        "_title": "12-240.pdf",
        "_keywords": "Div42 Src580 LGE Mechtech",
        "_language": "en",
        "_content_type": "pdf"
}

but when I search

curl -XGET "http://localhost:9200/tech/manual/_search" -d'
{
  "fields": ["file.content_type", "file.title", "file.keywords", "file.language", "file.name"], 
  "query": {
   "match_all": {}
  }
}'

the response has no file.keywords, file.language, and file.name as follow, I also can't search on these fields.

 "hits": {
    "total": 1,
    "max_score": 0.30685282,
    "hits": [
      {
        "_index": "tech",
        "_type": "manual",
        "_id": "AVPx8cRH4bGZ_KKaUS0y",
        "_score": 0.30685282,
        "fields": {
          "file.content_type": [
            "pdf"
          ],
          "file.title": [
            "12-240"
          ]
        }
      }
    ]
  }

what's possible not right?
Thanks!

Thank you for reporting.

I was able to reproduce it with a Java test in master branch.

EDIT: actually we never implemented or documented that: https://www.elastic.co/guide/en/elasticsearch/plugins/current/mapper-attachments-usage.html

The only values you can force are _content_type, _name and _language. Not that the later only works if you set index.mapping.attachment.detect_language: true.

I added this PR to get this fully covered by a test.

Note that mapper-attachments is deprecated in 5.0.0 so people should then use ingest-attachment plugin instead.

Thanks dadoonet! I got it. Yes thought to get things to work before going to 5.0.0.

Hi David

I'm using ES 2.3.4 and trying to install mapping-attachments without success (downloaded from internet)! What is the correct zip file i should be using? Could u please post the correct url? I cannot figure it out!

Please help me out!

thanx valerio

Why hacking an old thread?

What did you try so far?
Did you read the plugin documentation which explains how to install it?

Hi david and thx.

1 I ve tried bin/plugin install mapping-attachements but it cannot find the file to download from different websites.
2 I ve trid to install the mapping-attachments-master.zip file locally(downloaded from github) but i get an error :ERROR: Could not find plugin descriptor 'plugin-descriptor.properties' in plugin zip
3 I've tried to add plugin-descriptor.properties filled-out manually to the zip file in the root directory, but i get another error regarding missing _source file.

I need to show the elastic search to my customer who is interested into full -text search in pdf file....

Any help is appreciated, i am using ES 2.3.4

If you copy and paste from the doc it should work.

mapper not mapping is probably your problem here.