Skip to content
New issue

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

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

Already on GitHub? # to your account

Support ES 7.x-style mappings with no document type #32

Closed
bnewbold opened this issue May 20, 2020 · 5 comments
Closed

Support ES 7.x-style mappings with no document type #32

bnewbold opened this issue May 20, 2020 · 5 comments

Comments

@bnewbold
Copy link

When trying to index documents into an Elasticsearch 6.x index with no document type (eg, created with include_type_name=false and mappings is directly the schema, not a JSON object with key _doc), I got the following esbulk error:

2020/05/20 13:46:39 using 1 servers
2020/05/20 13:46:39 {[http://localhost:9200] dev_scholar_fulltext default 200 true key http  }
panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 1 [running]:
main.main()
        /home/tir/go/src/github.com/miku/esbulk/cmd/esbulk/esbulk.go:189 +0x1aed

This might be an issue with using ES 6.x in this way, but from the panic text I suspect this is due to esbulk not supporting this newer single-document-type mapping format.

@miku
Copy link
Owner

miku commented May 20, 2020

Thanks, I'll look into it!

@zazi
Copy link

zazi commented Feb 22, 2021

bump. "document type" has been removed in Elasticsearch 7.x, see Removal of mapping types. Using esbulk with a (provided) mapping without "document type" causes an error message á la

failed to apply mapping with 400 Bad Request: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."}],"type":"illegal_argument_exception","reason":"Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."},"status":400}

@miku
Copy link
Owner

miku commented Feb 22, 2021

Yes, that issue has been dangling (along with some better testing setup for various es versions).

@miku
Copy link
Owner

miku commented Mar 25, 2021

As a first measure, in 0.7.0 the docType is set to the empty string and will not be included in the bulk request, if not provided.

@miku miku closed this as completed in 8d1c2a6 Mar 25, 2021
@miku
Copy link
Owner

miku commented Mar 25, 2021

Ok, thanks for all the patience - the issue should be gone with 0.7.1.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants