Skip to content

Commit

Permalink
[#2844] Fix error in simple search
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Aug 13, 2012
1 parent 873f03d commit 419e839
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ckan/lib/search/sql.py
@@ -1,4 +1,4 @@
from sqlalchemy import or_, and_
from sqlalchemy import or_
from ckan.lib.search.query import SearchQuery
import ckan.model as model

Expand All @@ -17,7 +17,7 @@ def run(self, query):
# no support for faceting atm
self.facets = {}
limit = min(1000, int(query.get('rows', 10)))

q = query.get('q')
ourq = model.Session.query(model.Package.id).filter_by(state='active')

Expand All @@ -34,7 +34,7 @@ def makelike(field):
ourq = ourq.filter(subq)
self.count = ourq.count()
ourq = ourq.limit(limit)
self.results = [r[0] for r in ourq.all()]
self.results = [{'id': r[0]} for r in ourq.all()]

return {'results': self.results, 'count': self.count}

0 comments on commit 419e839

Please sign in to comment.