pip install elasticsearch python from elasticsearch import Elasticsearch es = Elasticsearch( ) python es.indices.create(index='my_index', ignore=400) python es.index(index='my_index', id=1, body={ 'title': 'Python Elasticsearch Tutorial', 'content': 'This is a tutorial on using Elasticsearch-py library in Python.' }) python res = es.search(index='my_index', body={'query': {'match': {'title': 'Tutorial'}}}) python es = Elasticsearch( )


上一篇:
下一篇:
切换中文