2017-03-13 3 views
0

인덱스 만들기 :RequestError : TransportError (400, u'mapper_parsing_exception ', 구문 분석 u'failed')

def create_index(index_name): 
    es=create_elastic_search_object() 
    entry_mapping = { 
    'entry-type': { 
     'properties': { 
      'text': {'type': 'string'}, 
      'coordinates': {'type': 'geo_point'}, 
      'username':{'type': 'string'} } 
      } 
      } 
    es.indices.create(index_name,body={'mappings':entry_mapping}) 

인덱스

coordinates= str(tweet[0][0])+","+str(tweet[0][1]) 
es.index(index=index_name, doc_type=keyword, id=start_id+ind, body={'text': tweet[1],'coordinates': coordinates,'username': tweet[2]}) 

오류로 삽입 :

*** RequestError: TransportError(400, u'mapper_parsing_exception', u'failed to parse') 

디버깅 :

(Pdb) body={'text': tweet[1],'coordinates': coordinates,'username': tweet[2]} 
(Pdb) print body 
{'username': 'csd', 'text': 'RT @funder: Court Doc:Trump evicted a disabled US Veteran because he had a therapy dog\n\[email protected] #trumprussia #resist #theresistance #russ...', 'coordinates': '-117.1304909,32.7211149'} 

모든 형식이 맞습니다. 무엇이 누락 되었습니까? 사용

라이브러리 : 나는 그래서 그냥 데이터를 확인하거나에 값을 캐스팅해야 할, 내 경우에는, 내 딕셔너리에서 NULL 값을 가지고, 같은 문제가 있었다

from elasticsearch import Elasticsearch 

https://elasticsearch-py.readthedocs.io/en/master/

+0

동일한 문제가 있습니다. 현재 ES 버전 5.1을 사용하고 있습니다. – DonerKebab

답변

0

읽기 전에 str.

관련 문제