elasticsearch-dsl 0.0.9 ライブラリを使用したいのですが、その例は古くなっています。最新バージョンをインストールしましたが、整数型とブール型はもう存在しません。
したがって、彼らの例は機能していません。
from datetime import datetime
#There is no 'Integer' in elasticsearch_dsl
from elasticsearch_dsl import DocType, String, Date, Integer
from elasticsearch_dsl.connections import connections
# Define a default Elasticsearch client
connections.create_connection(hosts=['localhost'])
class Article(DocType):
title = String(analyzer='snowball', fields={'raw': String(index='not_analyzed')})
body = String(analyzer='snowball')
tags = String(index='not_analyzed')
published_from = Date()
lines = Integer() ############################## HERE
整数フィールドを宣言する方法を知っている人はいますか?
ありがとう。
編集
このドキュメントhttps://media.readthedocs.org/pdf/elasticsearch-dsl/latest/elasticsearch-dsl.pdfによると、整数型は 0.0.9 でも利用できるはずです
なぜそれが見つからないのかわかりません。
私の pip 出力からわかるように、私は 0.0.9 をインストールしました:Downloading elasticsearch_dsl-0.0.9-py2.py3-none-any.whl