我用作 elastic4s 库与 ElasticSearch 进行通信。我想做一个相当于“SELECT * FROM WHERE MY_INDEX MY_FIELD IN (VALUE_1, VALUE_2, ....)”
我产生了那个查询
val req = search in indexName -> {query indexType
{bool
must (
termsQuery ("myField" transformed (myListOfValues))
)
}
}
方法 termsQuery 在 elastis4s 中定义如下
def termsQuery (field: String, capital gains: AnyRef *): TermsQueryDefinition
如何将 myListOfValues 列表转换为 AnyRef *
谢谢您的帮助。