7

I can search a particular user's posts by:

user:555

I tried to search multiple users' posts at the same time, like:

user:555 or user:666

But only user 666's posts come back.

Is there any work around?

4
  • 2
    Use SEDE: data.stackexchange.com/stackoverflow/query/…
    – rene
    Mar 7, 2021 at 8:48
  • 1
    As far as I know the or only works with tags - so you can do [tag-a] or [tag-b] but not anything else. Not even "word a" or "word b"
    – VLAZ
    Mar 7, 2021 at 8:59
  • Cross-site duplicate: Search posts of multiple users
    – Tomerikoo
    Mar 7, 2021 at 9:24
  • @VLAZ The "Posts" table is too big for a LIKE-based pattern search, but it might work if it is pre-filtered by a tag or user id, and t-sql is enough smart today, to this filter first. For such things I would use google (the whole SO/SE is very well cached by google). Google is very weak in or/and expressions, more weak than the top search bar, but anyways it tends to give good results.
    – peterh
    Mar 11, 2021 at 16:08

1 Answer 1

2

It does not work with the top search bar. The top search bar can only handle only AND relations.

But SEDE does what you want. The query

SELECT Id AS [Post Link], Score, OwnerUserId AS [User Link], CreationDate 
FROM Posts 
WHERE OwnerUserId IN (555, 666) 
ORDER BY Id DESC;

is roughly what you want to have.

4
  • @Tomerikoo It supports, your dictionary-tagged posts and your upvoted posts.
    – peterh
    Mar 11, 2021 at 15:57
  • @Tomerikoo As the answer states, there is no way to search for 2 users, because it would be an OR relation. Only SEDE can do that.
    – peterh
    Mar 11, 2021 at 15:59
  • @rene English is tricky, "only" belongs semantically to the "AND relations" and not to the verb. I always screw it up :-) Thanks the fix.
    – peterh
    Mar 11, 2021 at 16:01
  • @Tomerikoo Filtering also for tags requires more complex query. PostTags is a bridge table between the Tags table and the questions in the Posts table. In the Posts table, answers have their question id in the ParentId column. So you need to left join posts with itself, and inner join it with PostTags and then with Tags.
    – peterh
    Mar 11, 2021 at 16:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .