diff --git a/app/corpora/events.py b/app/corpora/events.py index 4cf2c583..1fa74fe4 100644 --- a/app/corpora/events.py +++ b/app/corpora/events.py @@ -45,7 +45,7 @@ def corpus_analysis(message): # Prepare and execute a query corpus_name = 'CORPUS' query = str(message['query']) - result_len = 100 + result_len = 200 context_len = int(message['context']) result_offset = 0 client.select_corpus(corpus_name) @@ -60,19 +60,20 @@ def corpus_analysis(message): context_len=context_len, result_offset=result_offset) result_offset += result_len # initial offfset is plus result len because client.show_query_results has been already executed once + socketio.emit('corpus_analysis', results, room=request.sid) while result_offset < client.total_nr_matches: logger.warning('====== While loop start for {} ======'.format(query)) logger.warning('result_offset: {}'.format(result_offset)) - results_append = client.show_query_results(result_len=result_len, - context_len=context_len, - result_offset=result_offset) - results['matches'].extend(results_append['matches']) - results['cpos_lookup'].update(results_append['cpos_lookup']) - results['text_lookup'].update(results_append['text_lookup']) + results = client.show_query_results(result_len=result_len, + context_len=context_len, + result_offset=result_offset) + # results['matches'].extend(results_append['matches']) + # results['cpos_lookup'].update(results_append['cpos_lookup']) + # results['text_lookup'].update(results_append['text_lookup']) result_offset += result_len result_offset = min(result_offset, client.total_nr_matches) logger.warning('result_offset end of while loop: {}'.format(result_offset)) - socketio.emit('corpus_analysis', results, room=request.sid) + socketio.emit('corpus_analysis', results, room=request.sid) @socketio.on('inspect_match') diff --git a/app/static/js/ResultList.js b/app/static/js/ResultList.js new file mode 100644 index 00000000..c08e7624 --- /dev/null +++ b/app/static/js/ResultList.js @@ -0,0 +1,3 @@ +class JobList extends List { + +} diff --git a/app/templates/corpora/analyse_corpus.bak.html.j2 b/app/templates/corpora/analyse_corpus.bak.html.j2 new file mode 100644 index 00000000..e5f38982 --- /dev/null +++ b/app/templates/corpora/analyse_corpus.bak.html.j2 @@ -0,0 +1,543 @@ +{% extends "full_width.html.j2" %} + +{% block page_content %} + + + +
+ + + + + ++ +
+Title | +Left context | +Match | +Right Context | +
---|