1
0
Fork 0
mirror of https://github.com/koniu/recoll-webui.git synced 2025-10-03 17:59:50 +02:00

py: allow limiting the number of results

This commit is contained in:
koniu 2012-12-21 14:44:22 +00:00
parent 56453c4503
commit b9b91f729f
2 changed files with 4 additions and 1 deletions

View file

@ -27,6 +27,7 @@ DEFAULTS = {
'timefmt': '%c',
'dirdepth': 3,
'maxchars': 500,
'maxresults': 100,
}
# sort fields/labels
@ -165,7 +166,7 @@ def recoll_search(q, sort, ascending):
nres = query.execute(q, int(config['stem']))
except:
nres = 0
for i in range(0, nres):
for i in range(0, min(nres, int(config['maxresults']))):
doc = query.fetchone()
d = {}
for f in FIELDS: