0
我有以下索引和查詢彈簧elasticsearch濾波器術語消耗列表
@Document(indexName="idx", type="worker")
public class Worker {
@Id
@Field(type = FieldType.Long)
private Long id;
@Field(type = FieldType.String)
private String firstName;
@Field(type = FieldType.String)
private String lastName;
--getter--setter
}
public interface WRepo extends ElasticsearchRepository<Worker, Long> {
@Query("{
"query": {"match": {"firstName": "?0"}},
"filter": {"terms" : {"id" : ***ids***}}
}")
Page<Worker> searchWorker(String firstName, List<Long> ids, Pageable pageable);
}
ID數是多變的,當加入IDS靜態像
{ 「ID」:[101,102,103 ]}
它按預期工作,我的問題是如何從方法簽名傳遞ID列表像的firstName場
{ 「名字」: 「0」}