Remove non-Postgres search codepath

(imported from commit ebc71defce2f075ee224f17a40088ccda9fab931)
This commit is contained in:
Zev Benjamin
2013-12-02 14:29:57 -05:00
parent 6c96561624
commit 8142646938

View File

@@ -189,7 +189,6 @@ class NarrowBuilder(object):
(self.pQ(sender=self.user_profile) & self.pQ(recipient=narrow_recipient))) (self.pQ(sender=self.user_profile) & self.pQ(recipient=narrow_recipient)))
def do_search(self, query, operand): def do_search(self, query, operand):
if "postgres" in settings.DATABASES["default"]["ENGINE"]:
tsquery = "plainto_tsquery('zulip.english_us_search', %s)" tsquery = "plainto_tsquery('zulip.english_us_search', %s)"
where = "search_tsvector @@ " + tsquery where = "search_tsvector @@ " + tsquery
content_matches = "ts_match_locs_array('zulip.english_us_search', rendered_content, " \ content_matches = "ts_match_locs_array('zulip.english_us_search', rendered_content, " \
@@ -212,11 +211,6 @@ class NarrowBuilder(object):
'subject_matches': subject_matches}, 'subject_matches': subject_matches},
where=[where], where=[where],
select_params=[operand, operand], params=[operand]) select_params=[operand, operand], params=[operand])
else:
for word in operand.split():
query = query.filter(self.pQ(content__icontains=word) |
self.pQ(subject__icontains=word))
return query
def highlight_string(string, locs): def highlight_string(string, locs):
highlight_start = '<span class="highlight">' highlight_start = '<span class="highlight">'