Skip to content

Commit

Permalink
update search logic
Browse files Browse the repository at this point in the history
  • Loading branch information
iandday committed Aug 15, 2024
1 parent 8616481 commit 0228665
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plant_tracker/tracker/api/view_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ def search_entry(request: HttpRequest, response: HttpResponse, query: str = None
results = Entry.objects.filter(**data_query)
if query:
results = Entry.objects.filter(
Q(search_vector__icontains=query) |
Q(user=user) &
(Q(search_vector__icontains=query) |
Q(plant__name__icontains=query) |
Q(activities__name=query)
Q(activities__name=query))
).distinct()


Expand Down

0 comments on commit 0228665

Please sign in to comment.