I would like to fetch at list 1 document for each "adminId" i put into the array.
This is not a user index so i have multiple documents for each user.
Here is what i tried but i get multiple documents with the same adminId and some are missing:
{
size: 10,
query: {
bool: {
must: [
{
terms: {
adminId: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
}
}
]
}
}
}
How to tell ES "fetch a least 1 document for each value i am giving you"?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…