mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 03:29:23 +02:00
Revert "Fix #994: use PostgreSQL full-text-search"
This reverts commit b3d8d6a4da
.
This commit is contained in:
parent
b3d8d6a4da
commit
7b0db234e2
6 changed files with 5 additions and 148 deletions
|
@ -1,6 +1,5 @@
|
|||
import re
|
||||
|
||||
from django.contrib.postgres.search import SearchQuery
|
||||
from django.db.models import Q
|
||||
|
||||
|
||||
|
@ -57,17 +56,6 @@ def get_query(query_string, search_fields):
|
|||
return query
|
||||
|
||||
|
||||
def get_fts_query(query_string):
|
||||
if not query_string.startswith('"') and not query_string.endswith('"'):
|
||||
parts = query_string.split(" ")
|
||||
parts = ["{}:*".format(p) for p in parts if p]
|
||||
if not parts:
|
||||
return Q(pk=None)
|
||||
|
||||
query_string = "&".join(parts)
|
||||
return Q(body_text=SearchQuery(query_string, search_type="raw"))
|
||||
|
||||
|
||||
def filter_tokens(tokens, valid):
|
||||
return [t for t in tokens if t["key"] in valid]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue