add small comment
This commit is contained in:
parent
9339443ddf
commit
47936b8be7
2 changed files with 7 additions and 1 deletions
|
@ -117,6 +117,7 @@ class SearchRSSFeed(Feed):
|
||||||
elif tag:
|
elif tag:
|
||||||
media = media.filter(tags__title=tag)
|
media = media.filter(tags__title=tag)
|
||||||
elif query:
|
elif query:
|
||||||
|
# same as on files.views.MediaSearch: move this processing to a prepare_query function
|
||||||
query = helpers.clean_query(query)
|
query = helpers.clean_query(query)
|
||||||
q_parts = [
|
q_parts = [
|
||||||
q_part.strip("y")
|
q_part.strip("y")
|
||||||
|
|
|
@ -732,8 +732,13 @@ class MediaSearch(APIView):
|
||||||
media = Media.objects.filter(state="public", is_reviewed=True)
|
media = Media.objects.filter(state="public", is_reviewed=True)
|
||||||
|
|
||||||
if query:
|
if query:
|
||||||
|
# move this processing to a prepare_query function
|
||||||
query = clean_query(query)
|
query = clean_query(query)
|
||||||
q_parts = [q_part for q_part in query.split() if q_part not in STOP_WORDS]
|
q_parts = [
|
||||||
|
q_part.strip("y")
|
||||||
|
for q_part in query.split()
|
||||||
|
if q_part not in STOP_WORDS
|
||||||
|
]
|
||||||
if q_parts:
|
if q_parts:
|
||||||
query = SearchQuery(q_parts[0] + ":*", search_type="raw")
|
query = SearchQuery(q_parts[0] + ":*", search_type="raw")
|
||||||
for part in q_parts[1:]:
|
for part in q_parts[1:]:
|
||||||
|
|
Loading…
Add table
Reference in a new issue