--- a/webui.py
+++ b/webui.py
@@ -153,7 +153,7 @@
     tstart = datetime.datetime.now()
     results = []
     db = recoll.connect()
-    db.setAbstractParams(int(config['context']), config['maxchars'])
+    db.setAbstractParams(int(config['maxchars']), int(config['context']))
     query = db.query()
     query.sortby(sort, int(ascending))
     try: