-
Notifications
You must be signed in to change notification settings - Fork 40
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
Index document without id #308
Comments
Hi @sevagh! Yeh this is a bit of an oversight, the high-level use elastic::prelude::*;
#[derive(ElasticType, Serialize, Deserialize)]
struct MyType { ... }
// Serialize the document as json
let body = serde_json::to_string(&doc)?;
// Send an `IndexRequest` manually, using the index and type
// The response is then deserialized as an `IndexResponse`
let response = client
.request(IndexRequest::for_index_ty("some-index", MyType::name(), body))
.send()?
.into_response::<IndexResponse>()?;
let indexed_id = response.id(); |
Alrighty, in the next breaking version of client.document_index(index("some-index", doc)).send()?; |
This solution not worked for elastic >= 6.x #308 (comment)
Do you plan to support elastic >= 6.x ? |
We've got a prerelease build for |
Hello,
I've been digging through the docs (and I'm not too familiar with elasticsearch) - apologies if this is a trivial question.
It seems that it should be possible to index a document without specifying the ID, but the only examples I can find require an Id: https://github.com/elastic-rs/elastic/blob/master/src/elastic/examples/index.rs#L50
Is there a way to put a document without an id?
The text was updated successfully, but these errors were encountered: