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