Skip to content

Commit

Permalink
Update tests to help speed up fulltext
Browse files Browse the repository at this point in the history
  • Loading branch information
mitechie committed Aug 15, 2011
1 parent 540b723 commit df201bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bookie/models/fulltext.py
Expand Up @@ -119,6 +119,10 @@ def _mysql_postgres_search(phrase, content=False, username=None):
if username:
qry = qry.filter(Bmark.username == username)

bid_filter = DBSession.query(Bmark.bid.distinct()).\
filter(or_(*filters))
qry = qry.filter(Bmark.bid.in_(bid_filter))

if content:
LOG.debug('searching with content')
readable = aliased(Readable)
Expand All @@ -128,10 +132,6 @@ def _mysql_postgres_search(phrase, content=False, username=None):

filters.append(readable.content.match(phrase))

bid_filter = DBSession.query(Bmark.bid.distinct()).\
filter(or_(*filters))
qry = qry.filter(Bmark.bid.in_(bid_filter))

qry = qry.join(Bmark.tags).\
options(contains_eager(Bmark.tags))

Expand Down

0 comments on commit df201bd

Please sign in to comment.