search-simpler-query-fix-2-3
All checks were successful
Deploy to core / deploy (push) Successful in 1m47s
All checks were successful
Deploy to core / deploy (push) Successful in 1m47s
This commit is contained in:
parent
c061e5cdb3
commit
30a281a693
|
@ -336,16 +336,21 @@ async def load_shouts_search(_, _info, text, limit=50, offset=0):
|
|||
results_dict = {r['slug']: r for r in results}
|
||||
found_keys = list(results_dict.keys())
|
||||
|
||||
q = select(Shout).where(
|
||||
shouts_data = []
|
||||
with local_session() as session:
|
||||
results = (
|
||||
session.query(Shout)
|
||||
.where(
|
||||
and_(
|
||||
Shout.deleted_at.is_(None),
|
||||
Shout.slug.in_(found_keys),
|
||||
)
|
||||
)
|
||||
.limit(limit)
|
||||
.offset(offset)
|
||||
.all()
|
||||
)
|
||||
|
||||
shouts_data = []
|
||||
with local_session() as session:
|
||||
results = set(session.execute(q).all())
|
||||
# print(results)
|
||||
logger.debug(f'search found {len(results)} results')
|
||||
for x in results:
|
||||
|
|
Loading…
Reference in New Issue
Block a user