Hello, world

edit

Create a property mapping using the new type attachment:

PUT /trying-out-mapper-attachments
{
  "mappings": {
    "person": {
      "properties": {
        "cv": { "type": "attachment" }
}}}}

Index a new document populated with a base64-encoded attachment:

POST /trying-out-mapper-attachments/person/1?refresh
{
  "cv": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="
}

Search for the document using words in the attachment:

POST /trying-out-mapper-attachments/person/_search
{
  "query": {
    "query_string": {
      "query": "ipsum"
}}}

If you get a hit for your indexed document, the plugin should be installed and working. It’ll look like:

{
  "timed_out": false,
  "took": 53,
  "hits": {
    "total": 1,
    "max_score": 0.25811607,
    "hits": [
      {
        "_score": 0.25811607,
        "_index": "trying-out-mapper-attachments",
        "_type": "person",
        "_id": "1",
        "_source": {
          "cv": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="
        }
      }
    ]
  },
  "_shards": ...
}