2017-11-17 6 views
0

値および5.6.3をelasicsearch:弾性検索5+クエリの複数の正確な私のpython 3.5を使用しています

deplist = ['A', 'B'] 
body = {"query": { 
      "bool": { 
       "must": { 
        "terms": { 
         "Department": deplist}}}}} 
res = es.search(index=self.index, doc_type='data', body=body) 

しかし、私は結果持っているならば、私は、その結果を持っていけない:

body = {"query": { 
      "bool": { 
       "must": { 
        "match": { 
         "Department": 'A'}}}}} 
res = es.search(index=self.index, doc_type='data', body=body) 
+0

私はデータを摂取しながら、あなたは 'json.load'を使用する必要がありますね。 https://github.com/hkulekci/es-presentation-examples/blob/master/twitter/stream.py#L17-L21 – hkulekci

答えて

0

変換を検索前にJSONエンコーディングへのクエリjson.dumps(body)を使用してください。

関連する問題