question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it a good idea to add mapping of a doctype before saving it?

See original GitHub issue

Is it a good idea to add mapping of a doctype before saving it? Because if it is I don’t see why we should be using .init() method before saving a Doctype object. In this case my suggestion is to add an automatic .init() before saving it in the DocType class like the following ideally in line 405 of elasticsearch_dsl/document.py

self.init(using=using, index=index)

@HonzaKral what do you think about it?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
honzakralcommented, Jun 27, 2017

Hi @WisdomPill, currently there is no direct support for index templates, but it shouldn’t be too hard (famous last words) and it makes perfect sense as the next addition.

In the meantime you can do it semi manually by taking the output of Index.to_dict() and storing it as a template by using the indices.put_template method of elasticsearch-py

0reactions
honzakralcommented, Jul 4, 2017

For IndexTemplate implementation you can check fb830eb - any and all feedback is welcome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Elasticsearch Mapping Basics & Examples (After Create Index)
Two main alternatives to mapping types are recommended: 1) to index per document type, OR 2) to create a customer type field.
Read more >
How to Define Efficient Mapping in Elasticsearch - Opster
The default is true. Static mapping: With static mapping, the mapping is defined before the document is indexed. All new fields are added...
Read more >
Should create multiple document types or multiple indexes?
What I would do is to create several indices and one mapping/document type per index, then you'd simply group all indices belonging to...
Read more >
Mapping | Elasticsearch Guide [8.5] | Elastic
Dynamic mapping allows you to experiment with and explore data when you're just getting started. Elasticsearch adds new fields automatically, just by indexing...
Read more >
4 Quick Steps To Make An Image Map In HTML (With Code ...
Image maps are used hyperlink parts of an image to different destination. Add in a jQuery plugin and image maps render beautifully on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found