Skip to content
This repository has been archived by the owner on May 22, 2022. It is now read-only.

Commit

Permalink
Cloudsearch: Force related query to unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
kemitche committed May 13, 2015
1 parent e1ad028 commit 00fbdcb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion r2/r2/lib/providers/search/cloudsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from r2.lib import amqp, filters
from r2.lib.db.operators import desc
from r2.lib.db.sorts import epoch_seconds
from r2.lib.filters import _force_unicode
from r2.lib.providers.search import SearchProvider
from r2.lib.providers.search.common import (
InvalidQuery,
Expand Down Expand Up @@ -820,7 +821,7 @@ def run_changed(self, drain=False, min_size=int(getattr(g, 'SOLR_MIN_BATCH', 500

def get_related_query(self, query, article, start, end, nsfw):
'''build related query in cloudsearch syntax'''

query = _force_unicode(query)
query = query[:1024]
query = u"|".join(query.split())
query = u"title:'%s'" % query
Expand Down

0 comments on commit 00fbdcb

Please sign in to comment.