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

make 'maxchars' configurable

This commit is contained in:
koniu 2012-12-18 12:18:44 +00:00
parent 813304bed2
commit bddbc00900
2 changed files with 4 additions and 1 deletions

View file

@ -8,6 +8,8 @@
<hr>
<b>Context words</b> <small class="gray">(number of words shown in search results)</small>
<input name="context" value={{context}}><br><br>
<b>Context characters</b> <small class="gray">(max characters in a snippet)</small>
<input name="maxchars" value={{maxchars}}><br><br>
<b>Time</b> <small class="gray">(time format string)</small>
<input name="timefmt" value={{timefmt}}><br><br>
<b>Folder depth</b> <small class="gray">(number of levels of the folder dropdown)</small>

View file

@ -26,6 +26,7 @@ DEFAULTS = {
'stem': 1,
'timefmt': '%c',
'dirdepth': 3,
'maxchars': 500,
}
# sort fields/labels
@ -152,7 +153,7 @@ def recoll_search(q, sort, ascending):
tstart = datetime.datetime.now()
results = []
db = recoll.connect()
db.setAbstractParams(contextwords=int(config['context']), maxchars=5000)
db.setAbstractParams(contextwords=int(config['context']), maxchars=config['maxchars'])
query = db.query()
query.sortby(sort, int(ascending))
try: