I have an Activity model and ActivityOccurrence Model where Activity has_many :activity_occurrences
Activity
: This model will have all the meta data required by ActivityOccurrence
AcitvityOccurrence
: attrs - occurrence(datetime), completed.
Now we have new requirement where we have to show all occurrences of activity in search results when user searches for activities in a particular range.
Previously we used to show only one record in case of repeating activities.
So as per new requirement we have decided to move search from Activity
to ActivityOccurrence
.
Now, I don't want to index the Meta information of Activity
in each of my ActivityOccurrence as my activity has 10 fields more than ActivityOccurrence
,
eg:
if I have Activity
with 1000 AcitivityOccurrence
then I will be indexing all my activity informations in 1000 AcitivityOccurrence
records.
This will take huge space as app grows if we index this way
Hence, my major concern is the amount of indexing I have to do.
So I am thinking to avoid activity indexes in ActivityOccurrence
.
So is there a way to search Activity based on its filters first and then search ActivityOccurrence
in the range based on the results from activities?
Note: Also we have never ending occurrences.
Any ideas?
Thanks in advance.