28

How can I search for interactions between two users? Example hits would be:

  • user123 asked a question which user456 answered (or vice versa)
  • user123 and user456 have both have an answer on the same question

Attempts that didn't work:

user:123 user:456      # result was equivalent to searching just "user:456"
user:123 or user:456   # result was equivalent to searching "or user:456"
user:123 and user:456  # result was equivalent to searching "and user:456"

The advanced search help page seemed promising, but I couldn't figure it out. Answers using Data Explorer or API are welcome.

8
  • 1
    You can't using the builtin search. You'd have to do something in SEDE or via the API.
    – Jon Clements Mod
    Commented May 19, 2018 at 18:04
  • 2
    Added the sede tag to draw those experts' attention to the Q. Except rene or someone to answer in 6 - 8 somethings...
    – TylerH
    Commented May 19, 2018 at 18:17
  • 1
    @YvetteColomb Bah, it's early... somewhere... I think
    – TylerH
    Commented May 19, 2018 at 18:25
  • 2
    This question has the same problem so many SO questions have today. It assumes a solution but does not state the problem that needs to be solved. So we are forced to post blind guesses: this is only practical to detect users that create a fake account to post questions the answer already knows the solution to. I root it out by looking at a handful of recent posts. Commented May 19, 2018 at 19:09
  • 4
    @HansPassant I don't buy that comment. Questions asking if a feature is possible (not assuming it is) don't need to state a problem in the way you mean. The only relevant problem here is that OP is trying to do something in the system and doesn't know how or if it's possible.
    – TylerH
    Commented May 19, 2018 at 19:28
  • 3
    @HansPassant Why should it be necessary to know the motivation for asking the question in order to answer the question? As long as the problem is stated clearly, isn't that enough?
    – wim
    Commented May 19, 2018 at 19:31
  • @HansPassant If I were the one asking, it would be to see how many questions I had accepted over user Y (for fun). For someone else, the SEDE may be required for a more just cause... either way, the solution is the same, the use case isn't relevant.
    – cs95
    Commented May 21, 2018 at 5:55
  • A related question on Meta Stack Exchange: How deep can the dive into user's interaction data be?
    – Martin
    Commented Jun 5, 2022 at 11:03

2 Answers 2

32

There is no such functionality in the search engine.

I instead use the Stack Exchange Data Explorer (SEDE) for this, with a query aptly named Have they met?

The query takes two userids and then finds all question/answer pairs between two users, questions they have in common, as well as comments from one user left on posts by the other or left as a reply to another user (the latter is a bit fuzzy, text matching on @displayname, so be watchful for false-positives).

Remember, the SEDE dataset is not live, it is updated once a week (on Sundays), and does not include enough information to cover deleted posts for the above query to find interactions that have since been deleted.

For example, you and I have met on 173 occasions up until Sunday morning May 13, the last time the SEDE dataset was updated.

6
  • Nice one. It would be cool also to see aggregations of "who answered X's questions" and "who's questions did X answer"
    – wim
    Commented May 19, 2018 at 18:44
  • @wim: I felt the query was in need of some changes anyway, so I refactored it into a 'have they met' query and added common questions.
    – Martijn Pieters Mod
    Commented May 19, 2018 at 19:27
  • I've been looking for this for ages, this is great!
    – cs95
    Commented May 19, 2018 at 19:36
  • 6
    It's possible the actual number is greater than 173, since you're an invisible ninja.
    – wim
    Commented May 19, 2018 at 19:50
  • 3
    @wim: fair enough. 173 times I choose to be seen then ;-)
    – Martijn Pieters Mod
    Commented May 19, 2018 at 22:14
  • would be nice to add some info for chat search as well. Ex. search for messages including one user's name, sent by the other user
    – starball
    Commented Mar 8 at 20:52
9

This forked query will give you a list of all questions that have either been asked or answered by one or other or answered by both parties.

So a query on Commonswares and myself shows we've both answered the same question and I've answered one of his questions and includes no comments.

How to migrate a project to another machine

Under What Conditions Does ART Compact the Heap?

enter image description here

This forked query will give any question asked and answered by a pair of users, not questions both users have answered.

Same two users in query.

enter image description here

You must log in to answer this question.

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