Commit Graph

23 Commits

Author SHA1 Message Date
evazion
a7dc05ce63 Enable frozen string literals.
Make all string literals immutable by default.
2021-12-14 21:33:27 -06:00
evazion
ed302fdf4d docs: add documentation for various classes in app/logical. 2021-06-23 06:23:29 -05:00
evazion
69f005a89c gems: remove cityhash gem.
This gem uses a native extension that requires a C++ compiler to build.
Removing this gem removes the need to have a C++ toolchain to install Danbooru.
2019-11-09 14:42:30 -06:00
evazion
6dd331745a Rewrite related tags implementation.
Rewrite the implementation of related tags to be simpler, faster, and
more accurate:

* The related tags are now calculated by taking a random sample of 1000
  posts, finding the top 250 most frequent tags among those posts, then
  ordering those tags by cosine similarity.

* Related tags can generally be calculated in 50-300ms at these sample
  sizes. Very high sample sizes (25000+ posts) are still relatively fast
  (1-3 seconds), but generally they don't improve accuracy much.

* Related tags are now cached in redis rather than in the tags table.
  The related_tags column in the tags table is no longer used.

* Only the related tags in the search taglist are cached. The related
  tags returned by the 'Related tags' button are not cached.

* The cache lifetime is a fixed 4 hours.

* The 'Related tags' button now works with metatags.

* The /related_tag page now works with metatags and multitag searches.

Fixes #4134, #4146.
2019-08-30 20:03:36 -05:00
r888888888
b769b83262 use Cache.hash instead of Cache.sanitize 2017-08-24 15:43:38 -07:00
r888888888
023c488bd5 fixes #3199 2017-07-12 16:47:28 -07:00
evazion
c0e5c400a7 tests: fix tests for Rails.cache. 2017-04-16 16:48:36 -05:00
evazion
904abc2787 cache.rb: implement Cache in terms of Rails.cache. 2017-04-16 16:48:35 -05:00
evazion
941bcff743 cache.rb: remove unused incr, decr methods. 2017-04-16 16:48:35 -05:00
r888888888
5de9adf0f5 work on saved searches embedded in user profiles 2016-08-19 17:33:42 -07:00
r888888888
df4979dba9 revert memcached ttl changes 2015-08-24 23:36:21 -07:00
r888888888
3f3c86c49b fix forum post test 2015-07-15 14:59:22 -07:00
r888888888
71347ae5f0 fixes #2439: Bug with memcached expiration 2015-07-15 14:51:07 -07:00
r888888888
e74dd4613a fix Cache.delete 2013-10-21 11:07:15 -07:00
r888888888
60b214f4d0 switch to dalli for memcache adapter, related to #1906 2013-08-01 15:02:45 -07:00
albert
3a96bb0811 fixes for tag subs 2013-04-03 14:36:28 -04:00
albert
2ac22d07cd implement api limiting 2013-03-20 16:35:35 -07:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
d9a17d2378 add new tag alias correction helper 2013-03-05 22:08:48 -05:00
albert
bbb8767b29 make forum post quoting regexp nongreedy 2013-02-22 12:24:10 -05:00
albert
f48000a8b5 got rid of removedpost, restore classic is_deleted mechanics 2011-02-12 17:37:48 -05:00
albert
ad39553aac updated tests, switched to rails 3.0.0rc2 2010-08-26 14:36:02 -04:00
albert
694b6f0813 sync 2010-08-18 18:44:18 -04:00