如何运行pip安装的elasticsearch?

时间:2018-04-21 13:28:36

标签: python django linux elasticsearch django-haystack

我正在尝试使用Django + Haystack + Elasticsearch。

所以我用pip安装了Elasticsearch 2.4,因为Django给了我关于它无法导入Elasticsearch的错误。现在它可以,我可以在我的Django项目中运行./manage.py rebuild_index,它给出了这个输出:

Indexing 23 journal entrys
GET /haystack/_mapping [status:404 request:0.006s]

但是,只有我有时会运行elasticsearch。所以我也安装了AUR包中的elsasticsearch2并运行它。但正如我怀疑当我尝试通过运行curl -X GET "localhost:9200/_cat/indices?v"来获取所有文档时返回:

health status index    pri rep docs.count docs.deleted store.size pri.store.size 
yellow open   haystack   5   1          0            0       795b           795b

如果我理解正确,那就是空的。 我去了pip installs packages(/usr/lib/python3.6/site-packages)并发现了两个与Elasticsearch相关的文件夹:

elasticsearch
├── client
│   ├── cat.py
│   ├── cluster.py
│   ├── indices.py
│   ├── ingest.py
│   ├── __init__.py
│   ├── nodes.py
│   ├── __pycache__
│   │   ├── cat.cpython-36.pyc
│   │   ├── cluster.cpython-36.pyc
│   │   ├── indices.cpython-36.pyc
│   │   ├── ingest.cpython-36.pyc
│   │   ├── __init__.cpython-36.pyc
│   │   ├── nodes.cpython-36.pyc
│   │   ├── snapshot.cpython-36.pyc
│   │   ├── tasks.cpython-36.pyc
│   │   └── utils.cpython-36.pyc
│   ├── snapshot.py
│   ├── tasks.py
│   └── utils.py
├── compat.py
├── connection
│   ├── base.py
│   ├── http_requests.py
│   ├── http_urllib3.py
│   ├── __init__.py
│   ├── pooling.py
│   └── __pycache__
│       ├── base.cpython-36.pyc
│       ├── http_requests.cpython-36.pyc
│       ├── http_urllib3.cpython-36.pyc
│       ├── __init__.cpython-36.pyc
│       └── pooling.cpython-36.pyc
├── connection_pool.py
├── exceptions.py
├── helpers
│   ├── __init__.py
│   ├── __pycache__
│   │   ├── __init__.cpython-36.pyc
│   │   └── test.cpython-36.pyc
│   └── test.py
├── __init__.py
├── __pycache__
│   ├── compat.cpython-36.pyc
│   ├── connection_pool.cpython-36.pyc
│   ├── exceptions.cpython-36.pyc
│   ├── __init__.cpython-36.pyc
│   ├── serializer.cpython-36.pyc
│   └── transport.cpython-36.pyc
├── serializer.py
└── transport.py

elasticsearch-2.4.1.dist-info
├── DESCRIPTION.rst
├── INSTALLER
├── METADATA
├── metadata.json
├── pbr.json
├── RECORD
├── top_level.txt
└── WHEEL

我没有看到start_elasticsearch.shbin/elasticsearch所以我该如何开始呢?

0 个答案:

没有答案