hedy
hedy copied to clipboard
new approach in public-adventures
Fixes #5368 Fixes #5367
This PR changes the functionality of how we retrieve public adventures. It also encapsulates changes related to creating indexes and filters. As a result, we create two additional tables: public-adventure-filters
and public-adventure-indexes
.
The first table creates a combination of filters, creating field and value in each record. The field can, for instnace, be lang_level
and the value en_1
. These filters are updated regularly once public adventures are created.
The second table creates the indexes so that we get the adventure_ids of all public adventures based on what users filter by. The two main fields are field_value
and date_adventure_id
. As you can expect, the field_value
would hold the info that we retrieve from the filters table. For example, level_lang_2_ar
where level_lang
is the field and 2_ar
are the values, respectively. Then we can get the adventure ids of these adventures and list them to the user.
Thereby, we can paginate the adventures and have much fewer problems with the overload and download restriction of AWS.
NB: We need to run the scripts in the
migration_scripts
on alpha and beta.
Converting this to a draft, there are a few good ideas in this PR but we will separate them out (no need to do anything more @hasan-sh)
Converting this to a draft, there are a few good ideas in this PR but we will separate them out (no need to do anything more @hasan-sh)
Sure, it's actually done and I've satisfied all Rico's comments. Will keep an eye and see if anything needs to be clarified or changed as well:)