2017-02-06 10 views
0

私はelasticsearch 2.2.0を使用して、以下のようにデータマッピングを作成しました:再インデックスデータなしでElasticSearchマッピングを更新するにはどうすればよいですか?

{ 
"DOCU": { 
    "_source": { "excludes" : ["fileAttachment.fileContent", "fileAttachmentFr.fileContent", "fileAttachmentEn.fileContent", "contentBody", "contentBodyFr", "contentBodyEn", "geoLocations.boundaries"] }, 
    "properties":{ 
     "id" : { "type" : "string", "store" : "true" }, 

     "categoryId" : { "type" : "string", "store" : "true" } , 
     "categoryCode" : { "type" : "string", "store" : "true" } , 
     "categoryDesc" : { "type" : "string", "store" : "true" } , 

     "typeId" : { "type" : "string", "store" : "true" } , 
     "typeCode" : { "type" : "string", "store" : "true" } , 
     "typeDesc" : { "type" : "string", "store" : "true" } , 

     "domainId" : { "type" : "string", "store" : "true" } , 
     "domainCode" : { "type" : "string", "store" : "true" } , 
     "domainDesc" : { "type" : "string", "store" : "true" } , 

     "groupId" : { "type" : "string", "store" : "true" } , 
     "groupCode" : { "type" : "string", "store" : "true" } , 
     "groupDesc" : { "type" : "string", "store" : "true" } , 

     "title" : { "type" : "string", "store" : "true" } , 
     "titleFr" : { "type" : "string", "store" : "true" } , 
     "titleEn" : { "type" : "string", "store" : "true" } , 

     "subTitle" : { "type" : "string", "store" : "true" } , 
     "subTitleFr" : { "type" : "string", "store" : "true" } , 
     "subTitleEn" : { "type" : "string", "store" : "true" } , 

     "summary" : { "type" : "string", "store" : "true" } , 
     "summaryFr" : { "type" : "string", "store" : "true" } , 
     "summaryEn" : { "type" : "string", "store" : "true" } , 

     "body" : { "type" : "string", "store" : "true" } , 
     "bodyFr" : { "type" : "string", "store" : "true" } , 
     "bodyKh" : { "type" : "string", "store" : "true" } , 

     "contentBody" : { 
      "type" : "attachment", 
      "fields": { 
        "content": { "type": "string", "term_vector":"with_positions_offsets", "store": true, "analyzer" : "english"} 
      } 
     }, 
     "contentBodyFr" : { 
      "type" : "attachment", 
      "fields": { 
        "content": { "type": "string", "term_vector":"with_positions_offsets", "store": true, "analyzer" : "french"} 
      } 
     }, 
     "contentBodyEn" : { 
      "type" : "attachment", 
      "fields": { 
        "content": { "type": "string", "term_vector":"with_positions_offsets", "store": true, "analyzer" : "english"} 
      } 
     }, 

     "wkfStatusId" : {"type" : "integer", "store" : "true"}, 

     "owner" : {"type" : "string", "store" : "true"}, 
     "createdDate": { "type" : "date", "store" : "true", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"}, 
     "modifiedDate":{ "type" : "date", "store" : "true", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"}, 

     "rank" : { "type" : "float", "store" : "true" }, 
     "nbViewed" : { "type" : "integer", "store" : "true" }, 
     "nbDownloaded" : { "type" : "integer", "store" : "true" }, 
     "avgRating" : { "type" : "float", "store" : "true" }, 
     "nbComment" : { "type" : "integer", "store" : "true" }, 

     "contributors" : { 
      "properties":{ 
       "id" : { "type" : "string", "store" : "true" }, 
       "type" : { "type" : "string", "store" : "true" } , 
       "contributorId" : { "type" : "string", "store" : "true" } , 
       "contributorName" : { "type" : "string", "store" : "true" } , 
       "orgCatId" : { "type" : "string", "store" : "true" } , 
       "orgTypeId" : { "type" : "string", "store" : "true" } , 
       "orgId" : { "type" : "string", "store" : "true" } , 
       "orgName" : { "type" : "string", "store" : "true" } 
      } 
     }, 

     "projectES" : { 
      "properties":{ 
       "id" : { "type" : "string", "store" : "true" }, 
       "orgId" : { "type" : "string", "store" : "true" } , 
       "orgName" : { "type" : "string", "store" : "true" } , 
       "startDate": { "type" : "date", "store" : "true", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"}, 
       "endDate":{ "type" : "date", "store" : "true", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"}, 
       "website" : { "type" : "string", "store" : "true" }, 
       "budget" : { "type" : "string", "store" : "true" }, 
       "funders" : { "type" : "string", "store" : "true", "term_vector": "with_positions_offsets" } 
      } 
     }, 

     "organizationES" : { 
      "properties":{ 
       "id" : { "type" : "string", "store" : "true" }, 
       "categoryId" : { "type" : "string", "store" : "true" } , 
       "categoryDesc" : { "type" : "string", "store" : "true" } , 
       "typeId" : { "type" : "string", "store" : "true" } , 
       "typeDesc" : { "type" : "string", "store" : "true" } , 
       "shortName" : { "type" : "string", "store" : "true" }, 
       "website" : { "type" : "string", "store" : "true" }, 
       "email" : { "type" : "string", "store" : "true" }, 
       "tel" : { "type" : "string", "store" : "true" }, 
       "address" : { "type" : "string", "store" : "true" } 
      } 
     }, 

     "employeeES" : { 
      "properties":{ 
       "id" : { "type" : "string", "store" : "true" }, 
       "categoryId" : { "type" : "string", "store" : "true" } , 
       "categoryDesc" : { "type" : "string", "store" : "true" } , 
       "genderId" : { "type" : "string", "store" : "true" } , 
       "genderDesc" : { "type" : "string", "store" : "true" } ,  
       "email" : { "type" : "string", "store" : "true" }, 
       "tel" : { "type" : "string", "store" : "true" }, 
       "country" : { "type" : "string", "store" : "true" }, 
       "city" : { "type" : "string", "store" : "true" }, 
       "bio" : { "type" : "string", "store" : "true" } 
      } 
     }, 

     "memberES" : { 
      "properties":{ 
       "id" : { "type" : "string", "store" : "true" }, 
       "memberTypeId" : { "type" : "string", "store" : "true" } , 
       "memberTypeDesc" : { "type" : "string", "store" : "true" } , 
       "isOnline" : { "type" : "string", "store" : "true" } , 
       "isPrivate" : { "type" : "string", "store" : "true" } , 
       "individu" : { 
         "properties":{ 
          "id" : { "type" : "string", "store" : "true" }, 
          "categoryId" : { "type" : "string", "store" : "true" } , 
          "categoryDesc" : { "type" : "string", "store" : "true" } , 
          "genderId" : { "type" : "string", "store" : "true" } , 
          "genderDesc" : { "type" : "string", "store" : "true" } ,  
          "email" : { "type" : "string", "store" : "true" }, 
          "tel" : { "type" : "string", "store" : "true" }, 
          "country" : { "type" : "string", "store" : "true" }, 
          "city" : { "type" : "string", "store" : "true" }, 
          "bio" : { "type" : "string", "store" : "true" } 
         } 
        } 
      } 
     }, 

     "urlContent" : {"type" : "string", "store" : "true"}, 

     "isParsing" : { "type" : "boolean", "store" : "true" } , 
     "isSelfPublished" : { "type" : "boolean", "store" : "true" } , 

     "isPublished" : { "type" : "boolean", "store" : "true" } , 
     "publicationDate" : { "type" : "date", "store" : "true", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"} , 

     "isPublic" : { "type" : "boolean", "store" : "true" } , 
     "isVisible" : { "type" : "boolean", "store" : "true" } , 
     "isLocked" : { "type" : "boolean", "store" : "true" } , 

     "tagNames" : { "type" : "string", "store" : "true", "term_vector": "with_positions_offsets" }, 

     "geoLocationsNames": { "type" : "string", "store" : "true", "term_vector": "with_positions_offsets" }, 
     "geoLocations" :{ 
      "properties":{ 
       "id"    : { "type" : "integer", "store" : "true" }, 
       "code"   : { "type" : "string", "store" : "true" }, 
       "desc"   : { "type" : "string", "store" : "true" }, 
       "descEn"   : { "type" : "string", "store" : "true" }, 
       "point"   : { "type" : "geo_point"}, 
       "boundaries"  : { "type" : "geo_shape"} 
      }, 
      "type" : "nested" 
     }, 

     "fileAttachment" : { 
      "properties":{ 
        "fileContent" : { 
         "type" : "attachment", 
         "fields": { 
           "content": { "type": "string", "term_vector":"with_positions_offsets", "store": true, "analyzer" : "english"} 
         } 
        }, 
        "contentType" : { "type" : "string", "store" : "true", "index" : "not_analyzed" }, 
        "lastModifiedDate":{ "type" : "date", "store" : "true", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"}, 
        "indexing_date": { "type" : "date", "store" : "true", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"}, 
        "filesize": { "type" : "long", "store" : "true" }, 
        "indexed_chars": { "type" : "long", "store" : "true"}, 
        "filename": { "type" : "string", "store" : "true", "index" : "not_analyzed" }, 
        "url": { "type" : "string", "store" : "true", "index" : "no" } 
      } 
     }, 

     "fileAttachmentEn" : { 
      "properties":{ 
        "fileContent" : { 
         "type" : "attachment", 
         "fields": { 
           "content": { "type": "string", "term_vector":"with_positions_offsets", "store": true, "analyzer" : "english"} 
         } 
        }, 
        "contentType" : { "type" : "string", "store" : "true", "index" : "not_analyzed" }, 
        "lastModifiedDate":{ "type" : "date", "store" : "true", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"}, 
        "indexing_date": { "type" : "date", "store" : "true", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"}, 
        "filesize": { "type" : "long", "store" : "true" }, 
        "indexed_chars": { "type" : "long", "store" : "true"}, 
        "filename": { "type" : "string", "store" : "true", "index" : "not_analyzed" }, 
        "url": { "type" : "string", "store" : "true", "index" : "no" } 
      } 
     }, 

     "fileAttachmentFr" : { 
      "properties":{ 
        "fileContent" : { 
         "type" : "attachment", 
         "fields": { 
           "content": { "type": "string", "term_vector":"with_positions_offsets", "store": true, "analyzer" : "english"} 
         } 
        }, 
        "contentType" : { "type" : "string", "store" : "true", "index" : "not_analyzed" }, 
        "lastModifiedDate":{ "type" : "date", "store" : "true", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"}, 
        "indexing_date": { "type" : "date", "store" : "true", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"}, 
        "filesize": { "type" : "long", "store" : "true" }, 
        "indexed_chars": { "type" : "long", "store" : "true"}, 
        "filename": { "type" : "string", "store" : "true", "index" : "not_analyzed" }, 
        "url": { "type" : "string", "store" : "true", "index" : "no" } 
      } 
     } 
    } 

}} 

マッピングから(以下のように)フィールドを除外を削除する方法:

"_source": { "excludes" : ["fileAttachment.fileContent", "fileAttachmentFr.fileContent", "fileAttachmentEn.fileContent", "contentBody", "contentBodyFr", "contentBodyEn", "geoLocations.boundaries"] } 

私は再したくありません私のデータにインデックスを付けるのは、終日に一日かかるからです。 お願いします。

+0

でインデックスを再作成する方法を示しているhttps://www.elastic.co/blog/changing-mapping-with-zero-downtime

を見てみることができますが、フィールドは、マッピングから削除することはできません。残念なことに、インデックスの再作成は唯一の選択肢です。 – Val

+0

@Valありがとうございました – Mankeomorakort

答えて

1

インデックスを再作成せずにElasticSearchマッピングを変更することはできません。

あなたは一度作成した事実上のゼロダウンタイム

+0

ありがとう、私はチェックします – Mankeomorakort

関連する問題