2017-01-22 10 views
0

외부 소스에서 들어오는 데이터가 있고 내가 발견 한 키바나의 필드 중 하나가 'clearancetime'입니다. 이 필드 중 하나를 비어 있거나 다음과 같은 형식의 타임 스탬프가 : 나는 삼항 문에서 통관 시간을 사용하는 필드를 스크립트 한표현식에 사용 된 필드 []이 (가) 생성 후에도 매핑에 존재하지 않습니다 ...?

January 22nd 2017, 00:00:00.000 

합니다. 표현식에 사용 된 필드 클린 아트가 매핑에 존재하지 않는다는 것을 Discover에서 오류가 발생한다고 생각합니다. 그래서 나는 다음과 PUT 요청과 감각을 통해 추가 시도 :

PUT source*/_mappings/clearancetime 
{ 
    "properties": { 
     "data": { 
      "type": "date" 
     } 
    } 
} 

내가 응답을 다시 얻을 : { "acknowledge": true }

하지만 여전히 같은 필드가 매핑 오류가 존재하지 않습니다 얻을.

아이디어가 있으십니까?

UPDATE : (형식에 대한 죄송) 일부 addiitonal 오류 정보 ....

Error: Request to Elasticsearch failed: {"error": 
{"root_cause":[{"type":"script_exception", 
"reason":"Field [clearancetime] used in expression does not exist in mappings"}], 
"type":"search_phase_execution_exception","reason":"all shards failed", 
"phase":"query","grouped":true,"failed_shards": 
[{"shard:0,"index":"source-raw-2017.01","node":"dewddasOSada_0vJWA", 
"reason":{"type":"script_exception","reason":"Error during search with inline script 
[doc['clearancetime'].value > 0 ? doc['clearancetime'].value - doc['initialtime'].value : 0] using lang [expression]", 
"caused_by":{"type":"script_exception", 
"reason":"Field [clearancetime] used in expression does not exist in mappings"}}}]}} 

"기간"라는 스크립트 필드 다음 삼항 표현이 있습니다

doc['clearancetime'].value > 0 ? doc['clearancetime'].value - doc['initialtime'].value : 0 
+0

오류의 스냅 샷을 표시 할 수 있습니까? 스크립팅 된 필드를 만들 때 사용한 스크립트는 무엇입니까? – Kulasangar

+0

'source */_ mappings/cleartime' 위의 명령은'cleartime'이라는 새로운 매핑 유형을 생성하지 않습니다. – Val

+0

@Val 안녕하세요, 미안하지만 분명히 clearancetime에 대한 매핑이었습니다. 이 질문을 변경했습니다 ... 필드 클린 란 타임은 KIbana로 들어오는 실시간 데이터에 존재하며 Discovery에서 볼 수 있습니다. – noob

답변

0

어떤 경우를 index 매개 변수와 함께 mappingclearancetime을 입력하면 이라는 검색어를 :

로 만들 수 있습니다. clearancetime의 데이터 유형부터 16,
PUT source*/_mappings/clearancetime 
{ 
    "properties": { 
     "data": { 
      "type": "date", 
      "index": true 
     } 
    } 
} 

및 는 date 당신이 doc['clearancetime'].value로 얻는 것보다 값을 얻기 위해 Date Field API를 사용하지 않아야입니까?

+0

나는 이걸 시도했지만 근본 원인 유형 _ _ "_ _ _ _ _ _ _ _ _ _ _ _ 이유 _와 _ 매핑 _ 파싱 _ 예외 _ _ _ _"_ 값이 잘못되었습니다. 어떤 아이디어? 그리고 네, 그걸 사용해야합니다. 고마워요! – noob