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:
parent
56453c4503
commit
b9b91f729f
2 changed files with 4 additions and 1 deletions
3
webui.py
3
webui.py
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue