Skip to content

Commit

Permalink
AREG-106 - fix N+1 query for fts by catalog number
Browse files Browse the repository at this point in the history
  • Loading branch information
D-GopalKrishna committed May 9, 2024
1 parent b0ea4d4 commit 6a3dd45
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def fts_by_catalog_number(search: str, page, size, filters=None):
search=vector,
ranking=SearchRank(vector, search_query, normalization=Value(1)))
.filter(search=search_query, status=STATUS.CURATED, ranking__gte=MIN_CATALOG_RANKING)
)
).select_related("vendor").prefetch_related("species").prefetch_related("applications")

# if we match catalog_num or cat_alt, we return those results without looking for other fields
# as the match is a perfect match or a prefix match depending on the search word,
Expand Down

0 comments on commit 6a3dd45

Please sign in to comment.