Skip to content

Commit

Permalink
remove one letter words from search to avoid never ending mysql queries
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalfox committed Oct 8, 2023
1 parent 2d7a601 commit 3de0ede
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def search(request):

words = request.GET.get("q", "")
words = words.split()[:10] # limits search to 10 words
words = [w for w in words if len(w) > 1] # remove one letter words
consultants = companies = contacts = leads = active_missions = archived_missions = bills = tags = None
max_record = 50
more_record = False # Whether we have more records
Expand Down

0 comments on commit 3de0ede

Please sign in to comment.