For example, I have 6 accounts (1,2,34,5,6)of transactions in index and I want to search transactions and sort by order by account 4,6,3,2,1,5(custom order ) then how I can use it .
SearchResponse<MyClass> esResponse = esClient.search((s -> s
.index("loans")
.size(pageSize)
.from(page)
.query(q -> q
.terms(t -> t
.field("ic_number.keyword")
.terms(tqf -> tqf.value(/* List<String> here */))
)
).sort(so -> so
.field(FieldSort.of(f -> f
.field("date_created")
.order(SortOrder.Desc)
))
)
), MyClass.class);