Reputation: 45
i have user objects indexed with various fields in a ES index. I also have another services (not ES) telling me which of my users are currently online. It's a simple list of user ids. I can't index this "is_online" field cause it changing too regularly.
But i'd like to be able to perfom various query using this online status. For exemple, i'd like to be able to filter my results to get only users that are currently online. But i'd also like to be able to perform boost query based on this list of ids. For example, i'd like to be able to get a list of users, preferably thoose who are online. I dont know what is the best way to do that (performance POV).
Any help is welcome
Upvotes: 2
Views: 1159
Reputation: 14512
I think that a Terms Query could help:
GET /_search
{
"query" : {
"terms" : {
"user" : ["id1", "id2", "idn"]
}
}
}
Upvotes: 3