According to the documentation I've created class with some of my model fields to perform search later. Also I've created conection with default params. But I can't call init() for UserIndex
from elasticsearch_dsl import DocType, Text, Boolean, Date, Keyword
from elasticsearch_dsl.connections import connections
connections.create_connection(hosts=['localhost'], timeout=20)
class UserIndex(DocType):
pk = Text()
phone_number = Text()
nickname = Text()
name = Text()
birth_date = Date()
class Meta:
index = 'user'
After UserIndex.init() command I'm getting an error:
File ".../lib/python3.6/site-packages/elasticsearch_dsl/document.py", line 138, in init
i.save(using=using)
File ".../lib/python3.6/site-packages/elasticsearch_dsl/index.py", line 289, in save
current_settings = self.get_settings(using=using)[self._name]['settings']['index']
KeyError: '*'
What version of elasticsearch-dsl are you using? It looks like the latest version (6.3.0) is having issues (This posted issue seems similar).
Rolling back to 6.2.1 resolved this error for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With