search: make order:random truly random; add random:N metatag.
Make the `order:random` metatag truly randomize the search. Add a `random:N` metatag that returns up to N random posts, like what `order:random` did before. `order:random` now returns the entire search in random order. Before it just returned a pageful of pseudorandom posts. This will be more accurate for small searches, but slower for large searches. If `order:random` times out, try `random:N` instead. The `random:N` metatag returns up to N pseudorandom posts. This is faster than `order:random` for large searches, but for small searches, it may return less than N posts, and the randomness may be biased. Some posts may be more likely than others to appear. N must be between 0 and 200. Also, `/posts?tags=touhou&random=1` now redirects to `/posts?tags=touhou+random:N`. Before the `random=1` param acted like a free `order:random` tag; now it redirects to a `random:N` search, so it counts against your tag limit.
This commit is contained in:
@@ -36,7 +36,5 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% unless post_set.is_random? %>
|
||||
<%= numbered_paginator(post_set.posts) %>
|
||||
<% end %>
|
||||
<%= numbered_paginator(post_set.posts) %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user