Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensureIndexTemplate and indexTemplate not working #203

Open
yacineBR opened this issue Sep 22, 2021 · 11 comments · May be fixed by #235
Open

ensureIndexTemplate and indexTemplate not working #203

yacineBR opened this issue Sep 22, 2021 · 11 comments · May be fixed by #235

Comments

@yacineBR
Copy link
Contributor

yacineBR commented Sep 22, 2021

I want to add mappings to the index using indexTemplate .
i set ensureIndexTemplate to true and i put indexTemplate: { mappings: { properties: { co: { index: true, type: "keyword", }, age: { type: "integer", }, }, }, }
but nothing happened.

@ivan901229
Copy link

I have the same problem.

@asmafakhfakh
Copy link

same issue

@zeinMch
Copy link

zeinMch commented Sep 26, 2021

same problem :(

@SondessLarbi
Copy link

I have the same issue

@vanthome
Copy link
Owner

vanthome commented Oct 4, 2021

are you using data streams (dataStream: true ) and what means "but nothing happened."? Does that mean the template is not created?

@yacineBR
Copy link
Contributor Author

yacineBR commented Oct 5, 2021

are you using data streams (dataStream: true ) and what means "but nothing happened."? Does that mean the template is not created?

Yes the template is not created, I'm not using data streams .

@thiago-negri
Copy link

Which version of ES are you running?

I am trying to upgrade my plugin version, and I just found out 0.14.0 introduced a breaking change that only works on ES 7.8+. The new index template was introduced on ES 7.8, and those running 7.7- are bound to the legacy index template API calls.

@vanthome
Copy link
Owner

vanthome commented Dec 8, 2021

I have added more debug code for this. So please try with the latest release and enable debug output.

@vanthome
Copy link
Owner

Can someone follow up on this? Is this an issue with the ES version you are running?

@ishtanzar
Copy link

ishtanzar commented Jul 18, 2023

I have the same issue with current 0.17.2 (@elastic/elasticsearch 8.8.1, running with ES 8.7.0)
Tracking down in debug, I noticed that within the bulk_writer.js:206:

  debug('Checking tpl name', tmplCheckMessage);
  thiz.client.indices.existsIndexTemplate(tmplCheckMessage).then(
    (res) => {
      if (res.statusCode && res.statusCode === 404) {

For some reason res is false, so the template isn't created.
Current workaround is to manually check & create the template but please fix this :/

@lenchv
Copy link

lenchv commented Sep 12, 2023

@vanthome the issue happens because to get statusCode from existsIndexTemplate you have to pass the 2nd parameter with enabled meta:
existsIndexTemplate(tmplCheckMessage, { meta: true })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants