Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我只想使用 elastic4s 库删除 elasticsearch 中的一个特定字段和值。但是,我到处看到的只是删除整个文档的不同机制。任何人都可以帮忙吗?这支持吗?
当您进行更新时,您必须使用更新脚本来删除字段,例如
"script" : "ctx._source.remove(\"name_of_field\")" }'
我可以在 elatic4s(版本 6.5.1)中使用以下命令解决此问题:
client.execute { deleteByQuery("myindex", "mytype", matchQuery("key", "valuexy")) }
这将删除包含“key -> valuexy”条目的文档。