You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first of all thank you very much for this wonderful library, it has been an amazing experience developing with library.
My current version: 6.3.1
I am facing problems while trying to dynamically give Index-Name (and Meta-data) to a Document Class. I am basically trying to do this by creating a decorator. Here is my code,
# my decorator, which I want to use to decorate the Document Class
def init_index_name(Cls):
# some logic to dynamically derive the index-name
indexName = 'dynamic_index_name'
# initize an object of class Index, with the derived index-name
idxObj = Index(name=indexName))
#add Index property to the decorated Class
idxObj.document(Cls)
# initialize the Index in ES
Cls.init()
return Cls
# my document class
@init_index_name
class tempIndex(Document):
tag = Keyword(multi=True)
value = Integer()
Using this code, I am unable to set my Index-Name, and I get the following Error,
File "/home/gpatel/anaconda3/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: '*'
Hi,
first of all thank you very much for this wonderful library, it has been an amazing experience developing with library.
My current version: 6.3.1
I am facing problems while trying to dynamically give Index-Name (and Meta-data) to a Document Class. I am basically trying to do this by creating a decorator. Here is my code,
Using this code, I am unable to set my Index-Name, and I get the following Error,
Also, could you tell me how can I dynamically add "meta-data" to the Index I am creating. For example, if I want to add the version of my software that created the Index. Just to be on the same page, I am refering to this https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-meta-field.html.
Once again, thank you very much for the library and also, for your help with all the Issues.
The text was updated successfully, but these errors were encountered: