2014-07-23 1 views

답변

1

필드의 매핑을 변경 한 다음 데이터의 색인을 다시 생성해야합니다. 데이터를 색인화 한 후에는 필드의 매핑을 변경할 수 없습니다. 여기

http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/mapping-intro.html

과 : 당신이 Elasticsearch 내에서 매핑의 개념이나 넣고 매핑 API에 익숙하지 않은 경우

, 여기 읽기 시작 했죠

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-put-mapping.html

가정 바이너리로 필드를 만들려면 다음과 같이하십시오.

$ curl -XPUT 'http://localhost:9200/yourindex/yourtype/_mapping' -d ' 
{ 
    "yourtype" : { 
     "properties" : { 
      "yourbigstring" : {"type" : "binary", "store" : true } 
     } 
    } 
} 
' 

하고 문자열로 떠나고 싶어하지만 분석하지 않는 경우 :

$ curl -XPUT 'http://localhost:9200/yourindex/yourtype/_mapping' -d ' 
{ 
    "yourtype" : { 
     "properties" : { 
      "yourbigstring" : {"type" : "string", "store" : true, "index" : "not_analyzed"} 
     } 
    } 
} 
' 
+0

매우 도움이! Java API 호출을 통해 인덱스 매핑을 설정하는 방법을 어디에서 찾을 수 있는지 알고 있습니까? 나는 ES 사이트에서 아무 것도 찾을 수 없다. – Adrian

+0

두 가지 예 : http://stackoverflow.com/questions/22071198/adding-mapping-to-a-type-from-java-how-do-i-do-it and http://stackoverflow.com/ 질문/17292668/elasticsearch-adding-manual-mapping-using-java –

+0

@John Petrone 큰 문자열에 대해 "not_analyzed"(두 번째 예)를 설정하는 것이 왜 지금 문제의 원인일까요? – SerG

관련 문제