Commit 7f189034 authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

Try to use doc["abstract"] if makedocabstract() is empty

parent 739de8d9
...@@ -329,10 +329,14 @@ def recoll_search(q): ...@@ -329,10 +329,14 @@ def recoll_search(q):
d['time'] = timestr(d['mtime'], config['timefmt']) d['time'] = timestr(d['mtime'], config['timefmt'])
if 'snippets' in q and q['snippets']: if 'snippets' in q and q['snippets']:
if 'highlight' in q and q['highlight']: if 'highlight' in q and q['highlight']:
d['snippet'] = query.makedocabstract( d['snippet'] = query.makedocabstract(doc, highlighter)
doc, highlighter)
else: else:
d['snippet'] = query.makedocabstract(doc) d['snippet'] = query.makedocabstract(doc)
if not d['snippet']:
d['snippet'] = doc['abstract']
#for n,v in d.items(): #for n,v in d.items():
# print("type(%s) is %s" % (n,type(v))) # print("type(%s) is %s" % (n,type(v)))
results.append(d) results.append(d)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment