We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Could you please provide an example on how to use the CreateIndexRequest API, particularly how to define the mappings?
CreateIndexRequest
I didn't catch how to use the CreateIndexRequest.Builder#mappings() API to do something like
CreateIndexRequest.Builder#mappings()
PUT /logs {"mappings": { "properties": { "@timestamp": { "type": "date" }, "message": { "type": "match_only_text" } } } }
The text was updated successfully, but these errors were encountered:
Good catch, match_only_text is missing from the API specification. I opened elastic/elasticsearch-specification#1548 to fix this.
match_only_text
If you use text instead, that would be:
text
client.indices().create(r -> r .index("logs") .mappings(m -> m .properties("@timestamp", p -> p.date(d -> d)) .properties("message", p -> p.text(t -> t)) ) );
Sorry, something went wrong.
This has been fixed in the API specification in elastic/elasticsearch-specification#1549 and in the Java client in 2b5f3d2.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Description
Could you please provide an example on how to use the
CreateIndexRequest
API, particularly how to define the mappings?I didn't catch how to use the
CreateIndexRequest.Builder#mappings()
API to do something likeThe text was updated successfully, but these errors were encountered: