To make a favorite system one solution is to store the data in a different index with blog_id
user_id
created_at
This way you can easily add remove and search.
I want multiple users to be able to mark some blog posts as favorite
User 1 click on the favorite link of blog 2, system will store in "favorite" index {"user_id":1, "blog_id": 2, "created_at": "2019-10-02 12:00:02", "blog_created_at": "2019-01-01 09:10:11"}
only the user that did the marking is able to see it as marked.
You can search with get by id if you concaten the user_id-blog_id or you can make a search with blog_id, user_id and you can know if the record exist if the blog you display is marked as favorite by the user who read.
Same for list page as you know the user_id and after you build the list of blog_ids you'll display you can make the search and retrieve a list that you will use when you'll display your list of blogs.
This solution will have good performance even for billions of posts.
If you have flag you can also flag your blog post the same way and put a category field.
Depends on how much flag and which kind of flag you'll have you can consider saving in the same index with a category field ['favorite', 'flag', ...] or save in different indices.
Also another thing to check about is using periodic index (monthly, weekly or daily) depend on the number of document you will store and how much update (add/remove favorite) you will have. You can rollup your index in yearly later if you have lass activity on them.
And a last thing, maybe consider using cache to handle frenetic click on favorite button that can lead to add/remove document which will increase the number of deleted document in your index, that can make your index slow.
Edit for the Edit in the question:
For example I want first (ordered by creation date) 10 blog posts
that are marked as favorite, or last 10 blog posts flagged.
You can add the blog creation date in your favorite records "blog_created_at" (I updated the example document). So you can sort by blog creation date and limit your aggregation at 10 if you want the 10 first.
For the other case in your comment:
If I want to get just 10 blog posts, ordered by date, which are not
marked as favorite or not flagged
You can add a field in your blog and set as True if you have a favorite, something like "has_favorite" or "has_flag".
You set as True when you first set as favorite, if it's already favorite you do nothing.
So you can search against this field to filter the blog that don't have favorite.
If somebody remove a favorite you can count how much this blog have favorite if 0 set has_favorite to False. <-- only this case can generate update but it's maybe 0.001% of case so better to focus on the 99% of case. If it increase, need to adapt the solution.