2014-11-18 4 views
-1

mt 노드 응용 프로그램에서 나는 백엔드로 Elastic-search를 사용하고 있습니다. 그 다음 쿼리를 사용하여 "템플릿"을 만들었습니다.ElasticSearch 필드 매핑

나는 위의 템플릿이 적용되도록 색인 이름 "Temp"을 만들었습니다. 잘 작동합니다.

을하지만 고려 :

curl -XPOST "192.168.1.107:9200/temp/place" -d'{ "xx" : "asdfg", 
"yy":34, 
"zz":67, 
"aa":78, 
"locaiton":'78.80, 10.89' }' 

그것은 작업 :

curl -XPOST "192.168.1.107:9200/temp/place" -d'{ "xx" : "asdfg", 
"yyyyyyyyyy":34,------------------------> changing the field name is also accepting. 
"zz":67, 
"aa":78, 
"locaiton":'78.80, 10.89' }' 

내가 원하는

다음과 같이 내 데이터가 고려 :하지만 난이 제출 한 이름 매핑으로 정확하게 할 여기서 오류 메시지. 그것은 Elasticsearch에서 가능합니까? 아이디어를 공유하십시오. 미리 감사드립니다. 엄격한 동적 속성을 설정 인덱스 템플릿을 작성하는 동안

: 그것의 가능한

+0

왜 downvote을 ?? – Subburaj

답변

0

네, 해결책을 발견이 질문에 대한

{ 

        "template" : "*", 
        "settings" : { 
         "index.number_of_shards" : 3, 
         "index.number_of_replicas" : 1 
        }, 
        "mappings" : { 
         "_default_" : { 
          "_source" : { "enabled" : true, 
              "compress" : true }, 
          "_all" : { "enabled" : false }, 
          "dynamic":"strict", 
          "properties" : { 
           "xx": { "type": "string", "index": "not_analyzed" }, 
           "yy": { "type": "integer", "index": "not_analyzed" }, 
           "zz": { "type": "integer", "index": "not_analyzed" }, 
           "aa": { "type": "integer", "index": "not_analyzed" }, 
           "locaiton": { "type": "geo_point", "index": "not_analyzed" } 
          } 
         } 
        } 
      }