AO3-5367 Bookmarks of unrevealed works appear in search results#5550
AO3-5367 Bookmarks of unrevealed works appear in search results#5550ReverM wants to merge 11 commits intootwcode:masterfrom
Conversation
|
To note, this will require reindexing |
|
Could you explain why it doesn't work to use a filter in the bookmarkable query similar to hidden_filter? otwarchive/app/models/search/bookmarkable_query.rb Lines 282 to 287 in b23fe62 |
This will work for making sure we cannot search using the information on the work that is not visible. However, this would also make it so that it is impossible to search for the visible information on the bookmark. The second step of the added test would fail as this would just exclude every bookmark that is of an unrevealed bookmarkable. |
Bilka2
left a comment
There was a problem hiding this comment.
Thank you for the explanation! I reconfirmed that we indeed want to keep the bookmarks themselves searchable, so this current approach is good
For the reindexing, this doesn't change the mapping so we we don't need to rebuild the whole index. So, ideally we would update only the bookmarkables that are unrevealed works, without needing downtime. Could you add a rake task that does that? reindex_hidden_unrevealed_tags is an example of a similar task
Bilka2
left a comment
There was a problem hiding this comment.
For the reindexing, this doesn't change the mapping so we don't need to rebuild the whole index. So, ideally we would update only the bookmarkables that are unrevealed works, without needing downtime. Could you add a rake task that does that? reindex_hidden_unrevealed_tags is an example of a similar task
Oh sorry about that. It totally slipped out of my mind. Going to do this today. I see that |
That seems like a temporary file, so you shouldn't modify it, no. The real task you can use for reference is in after_tasks.rake, which is also where the task for this PR should be added |
Got it! One last question, if a work is reindexed as a bookmarkable, does it need to be reindex as a work as well? |
No, only the bookmarks needs to be reindexed by this task, since we're not changing the work index. Basically, I think we can get all unrevealed works, similar to what |
Issue
https://otwarchive.atlassian.net/browse/AO3-5367
Purpose
This makes it so it is impossible to search for hidden (via unrevealed) information with bookmarks by making the json returned for the bookmarked item be empty if the item is unrevealed.
Credit
Danaël / Rever ( they / he )
Danaël Villeneuve on jira