Can we search for posts by length using the normal search interface?

Is there a way to search for questions and answers by length? I recall that the system has some checks for excessively long answers, and I expect there's something for very short answers as well. Is any of the post length size available through search? (I'd imagine something like size:>300 or an option to order by length.)

If the answer is no, I'll probably follow this up with a feature request with a bit more justification of why this would be useful, but the short version is that I'm active in some relatively low view tags, and if I'm looking for my "best" posts, ordering by votes isn't a great metric, but length would be fairly useful.

Related Questions

I am aware of Add ability to search for/sort answers by length, of which this might be a duplicate; it's aimed at Careers, but the justification is about the same as here. (Since it's moderator election time, people might be looking for ways to demonstrate patience and communication ability, too.)

When adding questions to my SO Careers profile, I found that votes was not a very reliable way for me to find answers that I wanted to highlight. Often highly voted answers tended to be short and/or for very simple, common questions. For my careers page, I wanted to find answers that I had spent some time on, for hard questions, or that demonstrated my abilities in a positive way. Short answers to common questions seem to be upvoted more often than lengthy answers to, perhaps, esoteric or difficult questions.

The answer there, though, just points to https://data.stackexchange.com/; it provides a workaround, but it doesn't actually answer whether or not this is available in the normal search (and even if it wasn't then, it might have been added in the past two years). I'm specifically asking whether this functionality is available through the normal search.

  • No, not via the normal interface. Feb 13, 2014 at 13:44
  • Would you measure the pre-rendered length or the rendered length? Because I imagine rendering every post to count the number of characters would be a prohibitively expensive.
    – JDB
    Feb 13, 2014 at 13:45
  • Also, I don't think there's a firm correlation between "patience" and post length. Case in point.
    – JDB
    Feb 13, 2014 at 13:48
  • @JDB Quite right; it's not a firm correlation, but as I said, I'm looking for some of mine own posts, and I know what some of my answers are like. :) Looking at the number of comments on posts could be useful, too… Maybe this really is a task for data.stackexchange… Feb 13, 2014 at 13:54

1 Answer 1


If you ran this against the Data Explorer, would this work?

    Qus.Title, Qus.Body, Ans.Body 
FROM Posts as Qus
LEFT JOIN Posts as Ans
ON Qus.ID = Ans.ParentID
WHERE Qus.OwnerUserId = ##UserId##
    AND Qus.PostTypeId = 1
    AND Ans.PostTypeID = 2
    -- XXX is whatever your desired length is
    AND LEN(Qus.Body) > XXX  

You could also check the length of Ans.Body by substituting that field into the above code.

  • This looks like what I want, but I think I may be missing something about the data explorer site. I've logged in using Google as OpenID provider (as I do with other StackExchange sites), but I'm not getting the UserID auto population described on the help page, nor profile data (aside from a gravatar), and even when I manually provide 1281433, the query executes without error, but with no results. I haven't used Data Explorer before; maybe I'm missing something about getting started with it. Feb 13, 2014 at 15:55
  • Oh, part of that is answered: in "I already have a Stack Exchange account, why am I jon.doe#### here? Data Explorer doesn't participate in the Stack Exchange network authentication scheme, so your account here is completely separate. Don't worry though, you can update your name in your profile at any time!" I'm still not sure why I'm getting no results, though. Feb 13, 2014 at 15:57
  • I'm not sure what the problem was, but I ended up getting it working. I used a somewhat simpler query that just shows my posts, ordered by length: data.stackexchange.com/stackoverflow/query/167272/…. Feb 13, 2014 at 16:32

You must log in to answer this question.

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