about summary refs log tree commit diff
path: root/app/models/tag.rb
AgeCommit message (Collapse)Author
2023-02-20Autofix Rubocop remaining Layout rules (#23679)Nick Schonning
2023-02-18Autofix Rubocop Style/Lambda (#23696)Nick Schonning
2023-01-04Fix ・ detection in hashtag regex to construct hashtag correctly (#22888)Partho Ghosh
* Fix ・ detection in hashtag regex to construct hashtag correctly * Fixed rubocop liniting issues * More rubocop linting fix
2022-11-10Improve performance by avoiding regex construction (#20215)James Tucker
```ruby 10.times { p /#{FOO}/.object_id } 10.times { p FOO_RE.object_id } ```
2022-07-22Fix unicode regression in #18809 (#18863)Eugen Rochko
2022-07-17Add ability to follow hashtags (#18809)Eugen Rochko
2022-07-13Change how hashtags are normalized (#18795)Eugen Rochko
* Change how hashtags are normalized * Fix tests
2021-11-26Fix error on trending hashtags/links pages in admin UI due to missing ↵Eugen Rochko
constant (#17044)
2021-11-25Add trending links (#16917)Eugen Rochko
* Add trending links * Add overriding specific links trendability * Add link type to preview cards and only trend articles Change trends review notifications from being sent every 5 minutes to being sent every 2 hours Change threshold from 5 unique accounts to 15 unique accounts * Fix tests
2021-11-18Bump chewy from 5.2.0 to 7.2.3 (supports Elasticsearch 7.x) (#16915)Takeshi Umeda
* Bump chewy from 5.2.0 to 7.2.2 * fix style (codeclimate) * fix style * fix style * Bump chewy from 7.2.2 to 7.2.3
2021-05-07Change trending hashtags to be affected be reblogs (#16164)Eugen Rochko
If a status with a hashtag becomes very popular, it stands to reason that the hashtag should have a chance at trending Fix no stats being recorded for hashtags that are not allowed to trend, and stop ignoring bots Remove references to hashtags in profile directory from the code and the admin UI
2021-04-25Improve tag search query (#16104)abcang
2020-11-12Fix possible inconsistencies in tag search (#14906)ThibG
Do not downcase the queried tag before passing it to postgres when searching: - tags are not downcased on creation - `arel_table[:name].lower.matches(pattern)` generates an ILIKE anyway - if Postgres and Rails happen to use different case-folding rules, downcasing before query but not before insertion may mean that some tags with some casings are not searchable
2020-09-07Changed tag most_used to recently_used (#14760)abcang
2019-12-17Fixes featured hashtag setting page erroring out instead of rejecting ↵ThibG
invalid tags (#12436) * Revert "Fix ignoring whole status because of one invalid hashtag (#11621)" This reverts commit dff46b260b2f7d765d254c84a4b89105c7de5e97. * Fix statuses being rejected because of invalid hashtag names * Add spec for invalid hashtag names in statuses * Add test for featured tags controller
2019-10-10Fix admin setting to auto-approve hashtags not affecting query (#12130)Eugen Rochko
Follow-up to #12122
2019-10-09Add admin setting to auto-approve hashtags (#12122)Eugen Rochko
Change inaccurate labels on other admin settings
2019-10-01Fix records not being indexed sometimes (#12024)Eugen Rochko
It's possible that after commit callbacks were not firing when exceptions occurred in the process. Also, the default Sidekiq strategy does not push indexing jobs immediately, which is not necessary and could be part of the issue too.
2019-09-28Add `exclude_unreviewed` param to `GET /api/v2/search` REST API (#11977)Eugen Rochko
Make it so normal search returns even unreviewed matches, but autosuggestions do not. Fix #11960
2019-09-17Fix the sample account icon of Profile directory to local only (#11872)mayaeh
2019-09-16Add search and sort functions to hashtag admin UI (#11829)mayaeh
* Add search and sort functions to hashtag admin UI * Move scope processing from tags_controller to tag_filter * Fix based on method naming conventions * Fixed not to get 500 errors for invalid requests
2019-09-13Fix hashtags being split by ZWNJ character (#11821)Eugen Rochko
Fix #11761
2019-09-02Change trending hashtags to not disappear instantly after midnight (#11712)Eugen Rochko
2019-08-19Fix ignoring whole status because of one invalid hashtag (#11621)Eugen Rochko
Fix #11618
2019-08-18Add more accurate hashtag search (#11579)Eugen Rochko
* Add more accurate hashtag search Using ElasticSearch to index hashtags with edge n-grams and score them by usage within the last 7 days since last activity. Only hashtags that have been reviewed and are listable can appear in searches, unless they match the query exactly * Fix search analyzer dropping non-ascii characters
2019-08-07Fix trending tags returning less items than requested sometimes (#11513)Eugen Rochko
Add better sorting defaults to the hashtags admin UI Add "not reviewed" filter to hashtags admin UI
2019-08-07Fix account tags not being saved correctly (#11507)Eugen Rochko
* Fix account tags not being saved correctly Regression from f371b32 Fix Tag#discoverable not returning tags where listable is nil instead of true Add notice when saving hashtags in admin UI Change public hashtag and directory pages to return 404 for forbidden tags * Remove unused locale string
2019-08-05Change admin UI for hashtags and add back whitelisted trends (#11490)Eugen Rochko
Fix #271 Add back the `GET /api/v1/trends` API with the caveat that it does not return tags that have not been allowed to trend by the staff. When a hashtag begins to trend (internally) and that hashtag has not been previously reviewed by the staff, the staff is notified. The new admin UI for hashtags allows filtering hashtags by where they are used (e.g. in the profile directory), whether they have been reviewed or are pending reviewal, they show by how many people the hashtag is used in the directory, how many people used it today, how many statuses with it have been created today, and it allows fixing the name of the hashtag to make it more readable. The disallowed hashtags feature has been reworked. It is now controlled from the admin UI for hashtags instead of from the file `config/settings.yml`
2019-07-30Change hashtag search to only return results that have trended in the past ↵Eugen Rochko
(#11448) * Change hashtag search to only return results that have trended in the past A way to eliminate typos and other one-off "junk" results * Fix excluding exact matches that don't have a score * Fix tests
2019-07-30Add hashtag score for better sorting of autosuggestions (#11427)Eugen Rochko
* Add hashtag score for better sorting of autosuggestions * Do not use `~<~` operator with no text_pattern_ops index
2019-07-29Fix tag normalization and migration not removing duplicate tags (#11441)Eugen Rochko
Fix #11428
2019-07-28Change hashtags to preserve first-used casing (#11416)Eugen Rochko
2019-07-19Disallow numeric-only hashtags (#11363)ThibG
* Add spec covering numeric-only hashtags * Fix hashtag regex
2019-07-18Fix only one middle dot being recognized in hashtags (#11345)Eugen Rochko
Fix #10934
2019-03-13Fix `tagged` param not being normalized before querying tags (#10249)Eugen Rochko
2019-02-26Add type, limit, offset, min_id, max_id, account_id to search API (#10091)Eugen Rochko
* Add type, limit, offset, min_id, max_id, account_id to search API Fix #8939 * Make the offset work on accounts and hashtags search as well * Assure brakeman we are not doing mass assignment here * Do not allow paginating unless a type is chosen * Fix search query and index id field on statuses instead of created_at
2019-02-04Add featured hashtags to profiles (#9755)Eugen Rochko
* Add hashtag filter to profiles GET /@:username/tagged/:hashtag GET /api/v1/accounts/:id/statuses?tagged=:hashtag * Display featured hashtags on public profile * Use separate model for featured tags * Update featured hashtag counters on-write * Limit featured tags to 10
2018-12-08Cache hashtag sample accounts, and exclude ineligible ones (#9465)Eugen Rochko
2018-12-07Fix various things in the directory (#9449)Eugen Rochko
* Fix missing variable in directory page title * Order hashtags by number of people instead of alphabetically * Add icon to OpenGraph preview of directory page * Prevent line breaks in hashtags and ensure lowercase in the table
2018-12-06Add profile directory (#9427)Eugen Rochko
Fix #5578
2018-05-27Track trending tags (#7638)Eugen Rochko
* Track trending tags - Half-life of 1 day - Historical usage in daily buckets (last 7 days stored) - GET /api/v1/trends Fix #271 * Add trends to web UI * Don't render compose form on search route, adjust search results header * Disqualify tag from trends if it's in disallowed hashtags setting * Count distinct accounts using tag, ignore silenced accounts
2018-04-23Update dependencies for Ruby (2018-04-23) (#7237)Yamagishi Kazutoshi
* Update annotate to version 2.7.3 * Update aws-sdk-s3 to version 1.9.2 * Update browser to version 2.5.3 * Update capistrano to version 3.10.2 * Update domain_name to version 0.5.20180417 * Update http to version 3.2.0 * Update lograge to version 0.10.0 * Update oj to version 3.5.1 * Update parallel_tests to version 2.21.3 * Update puma to version 3.11.4 * Update rubocop to version 0.55.0 * Update scss_lint to version 0.57.0 * Update simplecov to version 0.16.1 * Update tty-command to version 0.8.0 * Update tty-prompt to version 0.16.0 * Update pkg-config to version 1.3.0 * Update fog-local to version 0.5.0 * Update fog-openstack to version 0.1.25 * Update devise-two-factor to version 3.0.3 * bundle update
2018-03-11Fix #6715: Make catalan words with the L geminate letter work in hashtags ↵Eugen Rochko
(#6741)
2017-12-10Fix account and tag searches with leading/trailing spaces (#5965)Andrea Scarpino
* Strip leading & trailing spaces from account query * Strip leading & trailing spaces from tag search
2017-11-18Lists (#5703)Eugen Rochko
* Add structure for lists * Add list timeline streaming API * Add list APIs, bind list-account relation to follow relation * Add API for adding/removing accounts from lists * Add pagination to lists API * Add pagination to list accounts API * Adjust scopes for new APIs - Creating and modifying lists merely requires "write" scope - Fetching information about lists merely requires "read" scope * Add test for wrong user context on list timeline * Clean up tests
2017-11-12Update model annotations to use BIGINT for IDs (#5461)Daniel Hunsaker
All the migrations have been updated to use BIGINTs for ID fields in the DB, but ActiveRecord needs to be told to treat those values as BIGINT as well. This PR does that.
2017-07-14add validation to tag name (#4194)masarakki
2017-07-13Make tag search case insensitive again (#4184)unarist
2017-06-06Fix tag search order and not to use tsvector (#3611)unarist
* Sort results by the name * Switch search method to simple `LIKE` matching instead of tsvector/tsquery Previously we used scores from ts_rank_cd() to sort results, but it didn't work because the function returns same score for all results. It's not for calculate similarity of single words. Sometimes this bug even push out exact matching tag from results. Additionally, PostgreSQL supports prefix searching with standard btree index. Using it offers simpler code, but also less index size and some speed.
2017-05-02annotate models (#2697)yhirano
* add annotate to Gemfile * rails g annotate:install * configure annotate_models * add schema info to models * fix rubocop to add frozen_string_literal