0
votes

I want to create a index and here is my mapping.I want to create a multi field on field - 'findings' one with the default mapping(analzyed) and other one with 'orig'(not_analyzed).

PUT nto
{
   "mappings": {
      "_default_": {
         "properties": {
            "date": {
               "type": "string",
               "index": "not_analyzed"
            },
            "bo": {
               "type": "string",
               "index": "not_analyzed"
            },
            "pg": {
               "type": "string"
            },
            "rate": {
               "type": "float"
            },
            "findings": {
               "type": "multi_field",
               "fields": {
                  "findings": {
                     "type": "string",
                     "index": "analyzed"
                  },
                  "orig": {
                     "type": "string",
                     "index":"not_analyzed"
                  }
               }
            }
         }
      }
   }
}

Once I create the mapping I don't see the orig field being created. Here is the mapping that I see,

{
   "ccdn": {
      "aliases": {},
      "mappings": {
         "test": {
            "properties": {
               "bo": {
                  "type": "string",
                  "index": "not_analyzed"
               },
               "date": {
                  "type": "string",
                  "index": "not_analyzed"
               },
               "findings": {
                  "type": "string",
                  "fields": {
                     "orig": {
                        "type": "string",
                        "index": "not_analyzed"
                     }
                  }
               },
               "pg": {
                  "type": "string"
               },
               "rate": {
                  "type": "float"
               }
            }
         },
         "_default_": {
            "properties": {
               "bo": {
                  "type": "string",
                  "index": "not_analyzed"
               },
               "date": {
                  "type": "string",
                  "index": "not_analyzed"
               },
               "findings": {
                  "type": "string",
                  "fields": {
                     "orig": {
                        "type": "string",
                        "index": "not_analyzed"
                     }
                  }
               },
               "pg": {
                  "type": "string"
               },
               "rate": {
                  "type": "float"
               }
            }
         }
      },
      "settings": {
         "index": {
            "creation_date": "1454893575663",
            "uuid": "wJndGz1aSVSFjtidywsRPg",
            "number_of_replicas": "1",
            "number_of_shards": "5",
            "version": {
               "created": "2020099"
            }
         }
      },
      "warmers": {}
   }
}

I don't see the default field 'findings' - analyzed being created.

1
Which version of Elastic search are you using?Richa
Im using the latest version - 2.2user1050619

1 Answers

0
votes

Elasticsearch multi field has expired. See here. You might need something like this for your findings field :

"findings": {
    "type": "string",
    "index": "analyzed",
    "fields": {
        "orig":   { "type": "string", "index": "not_analyzed" }
    }
}