11

I wanted to update / improve my answers to the most viewed questions that I answered (cause I think that would make more sense than improving the most upvoted ones), however to my (slight) disappointment it appears as though combining is:answer and views:N results in just views:N being acknowledged, and in only questions being displayed (i.e., it works the same as is:question views:N).

If someone wants to try that (adjusting 5000 to show only a limited number of results if needed):

user:me is:answer views:5000

I mean, I understand that the number of views per answer is probably not even stored, so I completely get why views:N would imply is:question and trump is:answer.

However I thought a semantic to is:answer and views:N could be implemented, such as:

Find answers to questions that have a number of views >= N

Honestly, I don't have a huge list of scenarios where this could be useful outside of what I'm trying to do, so I don't have a strong opinion on this, but I thought it was worth putting out for debate, maybe someone else will find better / more reasons why it would be useful (or why it would be detrimental, for reasons that I currently don't see).

3
  • 2
    The search help: How do I search is probably a little unclear on this. Under the section Range Operators, it should probably be: "To search for only posts" instead of "To search for only questions" because score applies to both and then also "will return questions with 500 to 1000 views" instead or " will return posts with 500 to 1000 views".
    – PeterJames
    Commented Oct 24 at 6:33
  • @PeterJames Agreed, you would infer score and views would apply to both by reading the help page alone
    – kos
    Commented Oct 24 at 6:39
  • Interestingly, the same thing happens with answers:5..10 is:answer which returns a list of questions instead of nothing. So they are ignoring is:answer there too.
    – PeterJames
    Commented Oct 24 at 6:44

1 Answer 1

10

This can be achieved with a SEDE query:

-- Getting list of answers for a user by question view
SELECT a.Id as [Post Link], 
       a.Score as "Answer Score",  
       q.ViewCount as "Views", 
       q.Score AS "Question Score"
  
FROM Posts a
JOIN Posts q ON a.ParentId = q.Id

WHERE a.OwnerUserId = ##UserId## AND 
      a.PostTypeId = 2

ORDER BY "Views" DESC

Not quite what you asked for, but considering that this is a niche request, I guess running this simple query should suffice until this is implemented in Search (if it ever gets implemented).

Borrowing these lines from rene:

Keep in mind SEDE is updated once a week on Sunday. Never forget that Monica Cellio created the awesome SEDE Tutorial. Say "Hi" in SEDE chat.

0

You must log in to answer this question.

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