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

meet Err("missing field created ) when insert document. #145

Open
yaanhyy opened this issue Mar 20, 2020 · 0 comments
Open

meet Err("missing field created ) when insert document. #145

yaanhyy opened this issue Mar 20, 2020 · 0 comments

Comments

@yaanhyy
Copy link

yaanhyy commented Mar 20, 2020

Use the re-es like this, insert action success, but response say: Err("missing field created ):

pub fn insert_event(client: &mut Client, event_index: &str, event: event) -> Result<(), String>{
        let id = format!("{}{}", event.block_hash, event.extrinsic_index).as_str().to_string();
        let res = client
            .index(event_index, "event")
            .with_id(&id)
            .with_doc(&event)
            .with_op_type(OpType::Create)
            .send();
        match res {
            Ok(_) =>  return Ok(()),
            Err(e) => return Err(e.to_string()),
        }
    }

es info:

{
  "name" : "w7RhYin",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "7qlVzhX-TXC6MVkp7D5O0w",
  "version" : {
    "number" : "6.8.0",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "65b6179",
    "build_date" : "2019-05-15T20:06:13.172855Z",
    "build_snapshot" : false,
    "lucene_version" : "7.7.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

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

No branches or pull requests

1 participant