I have noticed this on all sorted routes.
The min/max say that they are context sensitive to the sort type yet are documented as date.
How is a date min/max valid when sorting by, for instance votes?
I have noticed this on all sorted routes.
The min/max say that they are context sensitive to the sort type yet are documented as date.
How is a date min/max valid when sorting by, for instance votes?
todate and fromdate always refer to creation date.
min and max are with respect to the current sort. So, where sort=votes they place upper and lower bounds on the score of returned answers/questions.
They can overlap, but do not always do so.
Documentation has been updated to reflect that min and max can be of any number of types.
/search for example.
We try and do "what's expected" given a sort value.
sort can be of some set of values depending (and documented on) the route in question. Common values are creation, activity, name, and the like.
Generally, the value of sort corresponds to a field in the returned objects to sort by:
creation -> creation_datename -> display_nameactivity -> last_activity_dateIn rare cases the sorted field is something that is not exposed by the API - generally as a consequence of being hidden on the site, or only shown to logged in user - such as added on users/{id}/favorites.
added sorts returned questions by the date the user in question "favorited" them. As we don't display such information anywhere on the site, its not returned by the API.
While the possible types of min and max is (now) documented, the range can be inferred based on context. Namely, if the field being sorted has a certain range (votes for instance being positive and negative integers, creation_date being >= Jan 1 1970, etc.) then min and max must fall in the same range.
hot, week, and month sorts are strange beasts. The ordering of the returned results is dependent on the "hotness" - an intentionally undocumented algorithm, subject to change, which drives the front page of the sites - of a set of questions. min and max on these sorts restricts questions by last_activity_date. This is something of a compromise. The API can't really take in "hotness" values, since we can't/won't document them, but it we do acknowledge that they are in some way influenced by last_activity_date; so we let you pass those in for a range.
int?min/max params - how are other developers going to discover this information. just sayin. – Sky Sanders Jun 27 '10 at 18:01week,hot, andmonthcorrespond to the front page sorts. Those aren't documented explicitly because they are subject to change should the front page behavior change. Think of them as "windows" onto the site. The sort is not guaranteed to be stable in those cases though, so its not quite 1 -> 1. Technically the sort isn't stable on the front page either, but due to caching and session magic you get the appearance that they are. – Kevin Montrose Jul 09 '10 at 01:42hotand its derivative sorts (month, andweek) usemin&maxas limits onlast_activity_date. I'll update my answer, along with a bit of rational. – Kevin Montrose Jul 09 '10 at 02:08hot,week, andmonthreturn the questions on those tabs of the site. For those sorts,minandmaxfilter out questions that have not had any activity (as defined bylast_activity_date) in their range.minandmaxdon't behave any differently on the "front page sorts" than they do elsewhere, they still just filter on a single field (conceptually anyway, there's a lot of optimization around front page things that makes the code more complicated than you might suspect). – Kevin Montrose Jul 09 '10 at 05:09now. The min/max may further limit those results, if set properly, in a way that is ephemeral and will not be further codified. In no case may you specify an arbitrary time period, say last week's 'hot' questions. yes? – Sky Sanders Jul 09 '10 at 06:19minandmaxfilter based on thelast_activity_date. How is that ephemeral? And no, if a question is not considered "hot" (as in, appears on the hot, week, or month tab) in the present there is no way to get its "older hot" status; that information is not present in the API. The only thing here that is not documented is the "hotness formula," which determines where a question appears on the relevant tab (and thus the equivalentsort). – Kevin Montrose Jul 09 '10 at 06:26sorttomonthand [min,max] to "the last two days" and you get all the questions that appear on themonthtab and also have alast_activity_datein the last two days.minandmaxcan be any valid date (>= unix epoch, that is to say), and there is no statement is made about whatlast_activity_dates may appear on questions returned by a a simplesort=month(ie. nominormax) query. – Kevin Montrose Jul 09 '10 at 07:17