elastic4s icon indicating copy to clipboard operation
elastic4s copied to clipboard

Update `doc` with `NestedFieldValue`

Open euronymous opened this issue 2 years ago • 2 comments

Hi,

Long story short:

Documentation: https://github.com/sksamuel/elastic4s/blob/master/docs/update.md#updates

client.execute {
  updateById("scifi", "14").docAsUpsert(
    NestedFieldValue("captain", Seq(SimpleFieldValue("james", "kirk")))
  )
}

Code: https://github.com/sksamuel/elastic4s/blob/a7f80c710a911b763c0fdc408f1c8cd23780976a/elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/update/UpdateRequest.scala#L54

  // Sets the field to use for updates when a script is not specified.
  //def doc(value: FieldValue): UpdateDefinition = copy(documentSource = Seq(value))

There is only one function that I could apply FieldValue and it is commented out. But maybe I'm just blind. Am I missing sth?

Cheers

euronymous avatar Apr 14 '22 13:04 euronymous

Was removed in later version and docs out of date I guess.

sksamuel avatar Jun 12 '22 20:06 sksamuel

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 12 '22 04:08 stale[bot]