I'm getting an error when trying to post a document. The error I think is that the format I used for a date property is incorrect. I initially used YYYY-MM-DD'T'hh:mm:ssZ, but since then I have made like 10 calls to update the template, and deleted the template and created it again to have a format of yyyy-MM-dd'T'HH:mm:ssZ. But the problem is that no matter what I do to update the template, when I try to post a document, elastic is still using the initial format I used. I can see it in the error message I get.
When I make the call to get all templates, I see that the template has the right format. So why is elastic still using the original format I used? What can I do to apply the new format?
Did you also recreated the index with a name that matches the index_pattern?
As asked, you need to share your template and a sample of the document and also check if there is another template that could match the same index_pattern and override it.
The template is too big to share, but I fetched all the templates in our cluster by calling /_template. There are only two templates that we created. The rest seem to be default templates that elastic uses. One template has pattern:
I updated the template for "transcription_documents_*". I can see the right format when I fetched the templates. When I post documents to that index, I use:
Yeah I found the issue. It looks like although the documents fail to be indexed, for whatever reason an index transcription_documents_20221006 is still created. I got that by calling /_cat/indices. So I guess any document that tries to be indexed with that index uses the format that was used for that index that failed. So I had to run DELETE /transcription_documents_20221006 and that worked.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.