I wanted to delete an element from the Array, as shown below I inserted a testindiex with type test and document with an Array inside, in elasticsearch using elastic4s.
I wanted to delete a value ex: tony from members - how can I do this
val insert = client.execute {
indexInto("testindex"/"test") id 1 fields(
"members" -> Array(
"tony",
"salvidor",
"bobby"
),
"crews" -> Seq(
"gualtieri",
"baccalieri",
"barese",
"moltisanti"
)
)
}.await
Here what i did:
val deleted=client.execute {
deleteIn("testindex"/"test").by(termQuery("crews","gualtieri"))
}.await
but this deletes entire document instead of single record, help me on this.