Как мне сделать такой запрос?
REST API Query
{ "query": { "must_not": [ {"match": {"foreignId": 1}}, {"match": {"foreignId": 2}}, ... ] }
Kotlin code
fun searchWithExclude(foreignIdsForMustNot: List<Int>) {
val q = QueryBuilders.boolQuery()
.mustNot(QueryBuilders.matchQuery("id", foreignIdsForMustNot[0]))
.mustNot(QueryBuilders.matchQuery("id", foreignIdsForMustNot[1]))
...
}
searchWithExclude(listOf(1, 2, ...))