...
| Bloc de code |
|---|
(django_pod3) pod@pod:/usr/share/elasticsearch$ cd ~/django_projects/podv3
(django_pod3) pod@pod:~/django_projects/podv3$ python manage.py create_pod_index
DELETE http://127.0.0.1:9200/pod [status:404 request:0.140s]
An error occured during index video deletion: 404-index_not_found_exception : no such index
Successfully create index Video
(django_pod3) pod@pod:~/django_projects/podv3$ curl -XGET "127.0.0.1:9200/pod/_search"
{"took":35,"timed_out":false,"_shards":{"total":2,"successful":2,"skipped":0,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}} |
Si la commande python ne fonctionne pas, créez d'abord l'index à la main avec un `curl -XPUT "http://127.0.0.1:9200/pod"` (options `-k --noproxy -u <user>:<pwd>` à prévoir si ES8 en mode security)
Si vous déportez l'elastic search sur une autre machine, rajoutez dans le fichier settings_local.py son URL d'accès :
...
| Bloc de code |
|---|
ES_URL = ['http://elastic.domaine.fr:9200/'] |
Avec le mode security et ES8, vous devrez parametrer les éléments suivants dans votre settings_local.py :
| Bloc de code | ||
|---|---|---|
| ||
ES_URL = ['https://127.0.0.1:9200/'] # ou votre instance déportée
ES_OPTIONS = {'verify_certs' : False, 'basic_auth' : ('es_user', 'password')} |
Installation des dépendances
...