Skip to content

attachment mapping #10

@gkapitany

Description

@gkapitany

Hi,
I'd like to add attachment mapping for:

https://github.com/elasticsearch/elasticsearch-mapper-attachments/

I not sure what is the correct way to do that. I would appreciate your help. Maybe would help to also update the documentation, in case somebody else needs it.
Here is the modified mapping I'm trying to use:

curl -XGET 'http://localhost:9200/imapriverdata/_mapping?pretty'
{
  "imapriverdata" : {
    "mappings" : {
      "imapriverstate" : {
        "properties" : {
          "errormsg" : {
            "type" : "string"
          },
          "exists" : {
            "type" : "boolean"
          },
          "folderUrl" : {
            "type" : "string"
          },
          "lastCount" : {
            "type" : "long"
          },
          "lastIndexed" : {
            "type" : "long"
          },
          "lastSchedule" : {
            "type" : "long"
          },
          "lastTook" : {
            "type" : "long"
          },
          "lastUid" : {
            "type" : "long"
          },
          "messageid" : {
            "type" : "string"
          },
          "uidValidity" : {
            "type" : "long"
          }
        }
      },
      "mail" : {
        "properties" : {
          "attachmentCount" : {
            "type" : "long"
          },
          "attachments" : {
            "properties" : {
              "attachmentType" : {
                "type" : "attachment",
                "path" : "full",
                "fields" : {
                  "attachmentType" : {
                    "type" : "string"
                  },
                  "author" : {
                    "type" : "string"
                  },
                  "title" : {
                    "type" : "string"
                  },
                  "name" : {
                    "type" : "string"
                  },
                  "date" : {
                    "type" : "date",
                    "format" : "dateOptionalTime"
                  },
                  "keywords" : {
                    "type" : "string"
                  },
                  "content_type" : {
                    "type" : "string"
                  },
                  "content_length" : {
                    "type" : "integer"
                  },
                  "language" : {
                    "type" : "string"
                  }
                }
              },
              "content" : {
                "type" : "string"
              },
              "contentType" : {
                "type" : "string"
              },
              "filename" : {
                "type" : "string"
              },
              "name" : {
                "type" : "string"
              },
              "size" : {
                "type" : "long"
              }
            }
          },
          "contentType" : {
            "type" : "string"
          },
          "flaghashcode" : {
            "type" : "integer"
          },
          "flags" : {
            "type" : "string"
          },
          "folderFullName" : {
            "type" : "string",
            "index" : "not_analyzed"
          },
          "folderUri" : {
            "type" : "string"
          },
          "from" : {
            "properties" : {
              "email" : {
                "type" : "string"
              },
              "personal" : {
                "type" : "string"
              }
            }
          },
          "headers" : {
            "properties" : {
              "name" : {
                "type" : "string"
              },
              "value" : {
                "type" : "string"
              }
            }
          },
          "mailboxType" : {
            "type" : "string"
          },
          "receivedDate" : {
            "type" : "date",
            "format" : "basic_date_time"
          },
          "sentDate" : {
            "type" : "date",
            "format" : "basic_date_time"
          },
          "size" : {
            "type" : "long"
          },
          "subject" : {
            "type" : "string"
          },
          "textContent" : {
            "type" : "string"
          },
          "to" : {
            "properties" : {
              "email" : {
                "type" : "string"
              },
              "personal" : {
                "type" : "string"
              }
            }
          },
          "uid" : {
            "type" : "long"
          }
        }
      }
    }
  }
}

I did restart elasticsearch after the change.

Thanks,
Gabriel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions