I have some problem with es sort option.
I’m using two different index for the result.
In my case, i’m using 2step for search.
First step: Aggregate for calculating specific number (1st index)
// First step's result object is like this
// result is List<Result> and sorted by count desc
public record Result (
String id,
Integer count
){}
Second step: Make second search’s filter query using id list from List. And then merge with another filters and search.(2st index).
Finally what i want to do is using count desc from List in second search sort option. But it seems impossible to use not indexed field.
Is there any solution to solve this problem?
More Example is like this
// First step's aggregation result count desc List example
resultList = [
{
id: 3,
count: 10
},
{
id: 1,
count: 7
},
{
id: 2,
count: 6
}
]
// Second step's search result what i want
// Search in resultList but preserve sort
results = [
{
id: 3,
count: 10
},
{
id: 2,
count: 6
}
]
//
I searched Es official docs and similar ES github issue but, i didn’t find solution.
Gunyoung Park is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.