]> git.ipfire.org Git - ipfire.org.git/blobdiff - src/backend/util.py
search: Use PostgreSQL's websearch_to_tsquery()
[ipfire.org.git] / src / backend / util.py
index a39abd9ecae310efd4641520f3510be7dfa59b61..04bde507a4480f6a91a2938a7fd7b94435028b96 100644 (file)
@@ -10,25 +10,6 @@ import re
 import string
 import unicodedata
 
-def parse_search_query(query):
-       q = []
-       for word in query.split():
-               # Is this lexeme negated?
-               negated = word.startswith("!")
-
-               # Remove any special characters
-               word = re.sub(r"\W+", "", word, flags=re.UNICODE)
-               if not word:
-                       continue
-
-               # Restore negation
-               if negated:
-                       word = "!%s" % word
-
-               q.append(word)
-
-       return " & ".join(q)
-
 def format_size(s, max_unit=None):
        units = ("B", "kB", "MB", "GB", "TB")