fix(search): include name field in EventListAPI full-text search
title__icontains only searched the optional title column; most events are stored in the required name field, so Thrissur Pooram and similar events were invisible to the q= search filter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -244,9 +244,9 @@ class EventListAPI(APIView):
|
|||||||
if pincode_qs.count() >= MIN_EVENTS_THRESHOLD:
|
if pincode_qs.count() >= MIN_EVENTS_THRESHOLD:
|
||||||
qs = pincode_qs
|
qs = pincode_qs
|
||||||
|
|
||||||
# Priority 3: Full-text search on title / description
|
# Priority 3: Full-text search on title / name / description
|
||||||
if q:
|
if q:
|
||||||
qs = qs.filter(Q(title__icontains=q) | Q(description__icontains=q))
|
qs = qs.filter(Q(title__icontains=q) | Q(name__icontains=q) | Q(description__icontains=q))
|
||||||
|
|
||||||
if per_type > 0 and page == 1:
|
if per_type > 0 and page == 1:
|
||||||
type_ids = list(qs.values_list('event_type_id', flat=True).distinct())
|
type_ids = list(qs.values_list('event_type_id', flat=True).distinct())
|
||||||
|
|||||||
Reference in New Issue
Block a user