code | type | title | description |
---|---|---|---|
true |
page |
deleteByQuery |
Deletes documents matching query. |
Updates documents matching the provided search query.
Kuzzle uses the ElasticSearch Query DSL syntax.
:::: tabs ::: tab Java
public CompletableFuture<Int> updateByQuery(
String index,
String collection,
Map<String, Any?> searchQuery,
Map<String, Any?> changes,
Boolean waitForRefresh
) throws NotConnectedException, InternalException
public CompletableFuture<Int> updateByQuery(
String index,
String collection,
Map<String, Any?> searchQuery,
Map<String, Any?> changes,
) throws NotConnectedException, InternalException
Argument | Type | Description |
---|---|---|
index |
String |
Index name |
collection |
String |
Collection name |
searchQuery |
Map<String, Any?> |
JSON representing the query to match |
changes |
Map<String, Any?> |
JSON representing the changes to apply |
waitForRefresh |
Bool ( false ) |
If set to true, Kuzzle will not respond until the delete documents are indexed |
An Int
containing the number of updated documents.
<<< ./snippets/update-by-query-java.java
::: ::: tab Kotlin
fun updateByQuery(
index: String,
collection: String,
searchQuery: Map<String, Any?>,
waitForRefresh: Boolean? = null
): CompletableFuture<Int>
Argument | Type | Description |
---|---|---|
index |
String |
Index name |
collection |
String |
Collection name |
searchQuery |
Map<String, Any?> |
JSON representing the query to match |
changes |
Map<String, Any?> |
JSON representing the changes to apply |
waitForRefresh |
Boolean ( false ) |
If set to true, Kuzzle will not respond until the delete documents are indexed |
An Int containing the number of updated documents.
<<< ./snippets/update-by-query-kotlin.kt
::: ::::