summaryrefslogtreecommitdiff
path: root/server/szurubooru/search/executor.py
AgeCommit message (Collapse)Author
2025-03-30server: prevent cache key collision for unsafe postsIlia Tetin
2021-08-06server: update ' to "Hunternif
2021-08-04Merge remote-tracking branch 'origin/master' into hunternifHunternif
# Conflicts: # client/css/post-content-control.styl # client/css/post-list-view.styl # client/html/post_edit_sidebar.tpl # client/js/controllers/post_list_controller.js # client/js/controllers/post_main_controller.js # client/js/controllers/post_upload_controller.js # client/js/controllers/tag_controller.js # client/js/controllers/user_list_controller.js # client/js/controls/expander_control.js # client/js/controls/post_content_control.js # client/js/controls/post_edit_sidebar_control.js # client/js/controls/post_readonly_sidebar_control.js # client/js/controls/tag_input_control.js # client/js/main.js # client/js/models/abstract_list.js # client/js/models/post.js # client/js/models/post_list.js # client/js/models/settings.js # client/js/models/tag.js # client/js/models/tag_list.js # client/js/tags.js # client/js/util/search.js # client/js/util/touch.js # client/js/util/uri.js # client/js/util/views.js # client/js/views/post_main_view.js # client/js/views/post_upload_view.js # client/js/views/posts_header_view.js # client/js/views/posts_page_view.js # client/js/views/settings_view.js # client/js/views/tag_view.js # client/package-lock.json # client/package.json # server/config.yaml.dist # server/szurubooru/api/__init__.py # server/szurubooru/api/post_api.py # server/szurubooru/api/tag_api.py # server/szurubooru/func/posts.py # server/szurubooru/func/tags.py # server/szurubooru/model/__init__.py # server/szurubooru/model/post.py # server/szurubooru/model/tag.py # server/szurubooru/search/configs/__init__.py # server/szurubooru/search/configs/post_search_config.py # server/szurubooru/search/executor.py # server/szurubooru/tests/api/test_post_retrieving.py # server/szurubooru/tests/api/test_post_updating.py # server/szurubooru/tests/api/test_tag_updating.py # server/szurubooru/tests/conftest.py # server/szurubooru/tests/func/test_posts.py # server/szurubooru/tests/func/test_tags.py # server/szurubooru/tests/search/configs/test_post_search_config.py
2020-06-06client+server: implement code autoformatting using prettier and blackShyam Sunder
2019-05-01server: implement median of post metricsHunternif
2019-04-29server: fix random post in around query when other sorting is presentHunternif
2019-04-29server: when sorting randomly, around next&prev ignores the random tokenHunternif
2019-04-26server: metric sorting without aliasesHunternif
2019-04-10server/post/around: random post idHunternif
2019-04-07Prevent caching when searching randomHunternif
2017-10-01remove tags.jsonrr-
2017-04-24server: lintrr-
2017-04-24server/search: fix errors on negative page offsetsrr-
2017-02-09server: use index-based paging (#123)rr-
2017-02-05server: refactor + add type hintingrr-
- Added type hinting (for now, 3.5-compatible) - Split `db` namespace into `db` module and `model` namespace - Changed elastic search to be created lazily for each operation - Changed to class based approach in entity serialization to allow stronger typing - Removed `required` argument from `context.get_*` family of functions; now it's implied if `default` argument is omitted - Changed `unalias_dict` implementation to use less magic inputs
2017-02-03server: make linters happierrr-
2016-10-22server: drop old style class declarationsrr-
2016-10-02client+server/posts: reverse next/prev post rolerr-
In the post list, when we navigate to the page with ">" button, we navigate to older posts. In the post view, when we navigate to the page with ">" button, we navigate to older posts as well. However, in the post list, the ">" button is called "next page". At the same time, in the post view, the ">" button was called "previous post". Now it's called "next post". The difference isn't visible to normal users nor even API consumers as the "get posts around post X" request isn't documented. The change is motivated not only by consistency, but to also improve compatibility with Vimperator's `[[` and `]]`. Vimperator assumes the word "next" refers to ">" and the word "previous" refers to "<".
2016-08-27server/search: fix sort:random breaking tagsrr-
Using sqlalchemy's subqueryload to fetch tags works like this: 1. Get basic info about posts with query X 2. Copy query X 3. SELECT all tags WHERE post_id IN (SELECT post_ids FROM query X) 4. Associate the resulting tags with the posts When original query contains .order_by(func.random()), it looks like this: 1. SELECT post.* FROM post ORDER BY random() LIMIT 10 2. Copy "ORDER BY random() LIMIT 10" 3. SELECT tag.* FROM tag WHERE tag.post_id IN ( SELECT id FROM post ORDER BY random() LIMIT 10) 4. Disaster! Each post now has completely arbitrary tags! To circumvent this, we replace eager loading with lazy loading. This generates one extra query for each result row, but it has no chance of producing such anomalies. This behavior is activated only for queries containing "sort:random" and derivatives so it shouldn't hit performance too much.
2016-08-26server/search: fix sort:randomrr-
2016-08-16server/search: fix negative offsets causing ISErr-
2016-08-14server/general: embrace most of PEP8rr-
Ignored only the rules about continuing / hanging indentation. Also, added __init__.py to tests so that pylint discovers them. (I don't buy pytest's BS about installing your package.)
2016-06-14server/posts: optimize 'posts around' queryrr-
2016-06-08server/posts: add getting posts around idrr-
Leave undocumented since it add almost no value for the client applications.
2016-06-03server/search: fix caching special tokensrr-
special:liked was being reused between users. Now the cache internally caches object similar to liked:USER.
2016-06-03server/search: cache by query rather than its textrr-
2016-06-03server/search: refactor, extract parsingrr-