Skip to content

Latest commit

 

History

History
89 lines (64 loc) · 2.81 KB

File metadata and controls

89 lines (64 loc) · 2.81 KB
code type title description
true
page
deleteByQuery
Deletes documents matching query.

updateByQuery

Updates documents matching the provided search query.

Kuzzle uses the ElasticSearch Query DSL syntax.

:::: tabs ::: tab Java

Arguments

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

Return

An Int containing the number of updated documents.

Usage

<<< ./snippets/update-by-query-java.java

::: ::: tab Kotlin

Arguments

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

Return

An Int containing the number of updated documents.

Usage

<<< ./snippets/update-by-query-kotlin.kt

::: ::::