2017-02-22 9 views
0

elasticsearch 5.2을 사용하고 있지만 geo_point 필드의 [geohash : true] m 다음과 같은 오류 점점[location]에 대한 매핑 정의에 지원되지 않는 매개 변수가 있습니다. [geohash : true] : Elasticsearch 5.X

{ 
    "error": { 
    "root_cause": [ 
     { 
     "type": "mapper_parsing_exception", 
     "reason": "Mapping definition for [location] has unsupported parameters: [geohash : true]" 
     } 
    ], 
    "type": "mapper_parsing_exception", 
    "reason": "Failed to parse mapping [jdloc]: Mapping definition for [location] has unsupported parameters: [geohash : true]", 
    "caused_by": { 
     "type": "mapper_parsing_exception", 
     "reason": "Mapping definition for [location] has unsupported parameters: [geohash : true]" 
    } 
    }, 
    "status": 400 
} 

[geoshash] 감가 상각 또는 문서를 작성하는 동안 geo_point 필드 유형에서 다른 생성하는 방법 및 저장 geohash와이 된 경우 누군가가 말해 줄래?

답변

1

이제 documentation,

geo_point 필드를

처럼 숫자를 지오 포인트 필드 필드에 따옴표 새로운 BKD 트리 구조를 사용합니다. 이 구조는 기본적으로 다차원 공간 데이터에 대해 으로 설계되었으므로 다음 필드 매개 변수는 더 이상 필요하지 않거나 지원되지 않습니다 : geohash, geohash_prefix, geohash_precision, lat_lon. Geohashes는 여전히 API 에서 지원되며 .geohash 필드 확장을 사용하여 계속 액세스 할 수 있지만 더 이상 지리적 포인트 데이터를 인덱싱하는 데 사용되지 않습니다.

더 이상 지원되지 않거나 필요하지 않은 것 같습니다. here을 참조하십시오. 예제에 따르면 다음 매핑을 사용하는 geohash을 사용합니다.

{ 
    "mappings": { 
    "my_type": { 
     "properties": { 
     "location": { 
      "type": "geo_point" 
     } 
     } 
    } 
    } 
} 

PUT my_index/my_type/3 
{ 
    "text": "Geo-point as a geohash", 
    "location": "drm3btev3e86" 
} 

UPDATE :

내가 문서에서 이해하는 geohash하지 매핑에서 지원되지만 여전히 액세스 할 수 있다는 것입니다. 따라서 자동으로 계산되어야합니다.

따라서 다음과 같이 색인을 생성하면 geohash에 액세스 할 수 있어야합니다.

PUT my_index/my_type/1 
{ 
    "text": "Geo-point as an object", 
    "location": { 
    "lat": 41.12, 
    "lon": -71.34 
    } 
} 
+0

이것은 다른 소스를 사용하여 geohash를 생성하고이를 elasticsearch로 명시 적으로 저장하는 것과 같습니다. 하지만 자동으로 geohash를 geo_points로 저장해야합니다. –

+0

@AbhishekAdhikary는 업데이트 된 답변을 참조하십시오. –