Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] update by query #72

Open
AlexRychkov opened this issue May 11, 2023 · 1 comment
Open

[FEAT] update by query #72

AlexRychkov opened this issue May 11, 2023 · 1 comment

Comments

@AlexRychkov
Copy link

Hello,
in the first version of the lib it was possible to run an update by query with a script,
but can't find similar functionality in current version

fun <T : Any> IndexRepository<T>.updateByQuery(
    esClient: RestHighLevelClient,
    script: Script,
    query: QueryBuilder,
) {
    val index = this.indexName
    val updateByQueryRequest = UpdateByQueryRequest(index)
    updateByQueryRequest.script = script
    updateByQueryRequest.setQuery(query)
    esClient.updateByQuery(
        updateByQueryRequest,
        RequestOptions.DEFAULT,
    )
}
@jillesvangurp
Copy link
Owner

Interesting. I've never used this myself. Shouldn't be too hard to add if you want to do a pull request for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants