Current implementation is O(n^2) or worse... Not sustainable at all. Here are the changes that should happen:
for each word in querystring: query Tags with word as argument using __icontains
for each Tag result in the queryset, query for TagInstances with the corresponding ForeignKey and get the GIF with which the TagInstance is associated
Consideration: handling synonyms in GIF tags. Currently they're removed, but that wouldn't happen with this implementation. I think that's fine; results might actually be better this way.
Current implementation is O(n^2) or worse... Not sustainable at all. Here are the changes that should happen:
Consideration: handling synonyms in GIF tags. Currently they're removed, but that wouldn't happen with this implementation. I think that's fine; results might actually be better this way.
Should be log(n) efficiency.