|
a/webui.py |
|
b/webui.py |
|
... |
|
... |
151 |
def recoll_search(q, sort, ascending):
|
151 |
def recoll_search(q, sort, ascending):
|
152 |
config = get_config()
|
152 |
config = get_config()
|
153 |
tstart = datetime.datetime.now()
|
153 |
tstart = datetime.datetime.now()
|
154 |
results = []
|
154 |
results = []
|
155 |
db = recoll.connect()
|
155 |
db = recoll.connect()
|
156 |
db.setAbstractParams(contextwords=int(config['context']), maxchars=config['maxchars'])
|
156 |
db.setAbstractParams(int(config['context']), config['maxchars'])
|
157 |
query = db.query()
|
157 |
query = db.query()
|
158 |
query.sortby(sort, int(ascending))
|
158 |
query.sortby(sort, int(ascending))
|
159 |
try:
|
159 |
try:
|
160 |
nres = query.execute(q, stemming=int(config['stem']))
|
160 |
nres = query.execute(q, int(config['stem']))
|
161 |
except:
|
161 |
except:
|
162 |
nres = 0
|
162 |
nres = 0
|
163 |
for i in range(0, nres):
|
163 |
for i in range(0, nres):
|
164 |
doc = query.fetchone()
|
164 |
doc = query.fetchone()
|
165 |
d = {}
|
165 |
d = {}
|