-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
+
-
- {% if results is not None %}
-
-
- TS |
- msg |
- host |
- nick |
- channel |
- net |
-
-
- {% endif %}
+
+ {% if results is not None %}
+
+
+ TS |
+ msg |
+ host |
+ nick |
+ channel |
+ net |
+
+
+ {% endif %}
-
- {% for item in results %}
-
- {{ item.ts }} |
- {{ item.msg }} |
- {{ item.host }} |
- {{ item.nick }} |
- {{ item.channel }} |
- {{ item.net }} |
-
- {% endfor %}
-
-
+
+ {% for item in results %}
+
+ {{ item.ts }} |
+ {{ item.msg }} |
+ {{ item.host }} |
+ {{ item.nick }} |
+ {{ item.channel }} |
+ {{ item.net }} |
+
+ {% endfor %}
+
+
-
{{ card }} hits
+ {% if results is not None %}
+
{{ card }} hits
+ {% endif %}
{% endblock %}
-
diff --git a/core/ui/views/drilldown.py b/core/ui/views/drilldown.py
index 530be1d..34123ac 100644
--- a/core/ui/views/drilldown.py
+++ b/core/ui/views/drilldown.py
@@ -18,20 +18,24 @@ class Drilldown(LoginRequiredMixin, View):
def get(self, request):
if not request.user.has_plan(self.plan_name):
return render(request, "denied.html")
- return render(request, self.template_name)
+ context = {"fields": settings.OPENSEARCH_MAIN_SEARCH_FIELDS}
+ return render(request, self.template_name, context)
def post(self, request):
if not request.user.has_plan(self.plan_name):
return render(request, "denied.html")
fields = None
if "fields" in request.POST:
- fields = request.POST["fields"]
+ fields = request.POST.getlist("fields")
print("FIELD", fields)
+ if "results" in request.POST:
+ results = request.POST["results"]
+ print("RESULTS", results)
if "query" in request.POST:
query = request.POST["query"]
# field = results.POST["field"]
# print("FIELD ", field)
- results = run_main_query(client, query, fields)
+ results = run_main_query(client, query, fields, results)
pp.pprint(results)
results_parsed = []
if "hits" in results.keys():