Permalink
Browse files

Split up terms, as ES doesn't do that.

  • Loading branch information...
1 parent 4574540 commit b33914cf55dac115806a41db711bc01932376bcc @toastdriven committed Mar 1, 2012
@@ -35,6 +35,11 @@ def get_model(self):
def prepare(self, obj):
data = super(PackageIndex, self).prepare(obj)
+ # For ES, because it doesn't tokenize on ``_``, which causes problems
+ # on lots of searches.
+ if '_' in data['name']:
+ data['name'] += ' ' + data['name'].replace('_', '-')
+
if obj.latest:
data["summary"] = obj.latest.summary
data["author"] = obj.latest.author if obj.latest.author else None
@@ -1,5 +1,5 @@
<div class="result row">
- <div class="span9 package-name"><a href="{{ result.url }}">{{ result.name }}</a></div>
+ <div class="span9 package-name"><a href="{{ result.url }}">{{ result.object.name }}</a></div>
<div class="span3">
{% if result.author %}

0 comments on commit b33914c

Please sign in to comment.