Make the Drilldown form even better

This commit is contained in:
Mark Veidemanis 2022-07-21 13:49:22 +01:00
parent aec3e2c408
commit dfabddb6b1
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
2 changed files with 70 additions and 86 deletions

View File

@ -38,19 +38,18 @@ def construct_query(query, fields, results):
"fuzzy_transpositions": True,
"fuzzy_max_expansions": 50,
"fuzzy_prefix_length": 0,
"minimum_should_match": 1,
# "minimum_should_match": 1,
"default_operator": "or",
"analyzer": "standard",
"lenient": False,
"lenient": True,
"boost": 1,
"allow_leading_wildcard": True,
"enable_position_increments": False,
# "enable_position_increments": False,
"phrase_slop": 3,
"max_determinized_states": 10000,
"time_zone": "-08:00",
# "max_determinized_states": 10000,
"quote_field_suffix": "",
"quote_analyzer": "standard",
"analyze_wildcard": True,
"analyze_wildcard": False,
"auto_generate_synonyms_phrase_query": True,
}
},

View File

@ -2,13 +2,11 @@
{% load static %}
{% block content %}
<div class="block">
<div class="box">
<form method="POST">
{% csrf_token %}
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">Search</label>
</div>
<div class="field">
<label class="label">Search</label>
<div class="field-body">
<div class="field">
<div class="control is-expanded has-icons-left">
@ -21,36 +19,31 @@
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-normal">
<div class="columns">
<div class="column">
<label class="label">Timescale</label>
</div>
<div class="field-body">
<div class="field">
<div class="control is-expanded has-icons-left">
<div class="select is-fullwidth">
<select name="timescale">
<option value="minute">Minute</option>
<option value="hour">Hour</option>
<option value="day">Day</option>
<option value="week">Week</option>
<option value="month">Month</option>
<option value="6months">6 months</option>
</select>
<span class="icon is-small is-left">
<i class="fas fa-magnifying-glass"></i>
</span>
<div class="field-body">
<div class="field">
<div class="control is-expanded has-icons-left">
<div class="select is-fullwidth">
<select name="timescale">
<option value="minute">Minute</option>
<option value="hour">Hour</option>
<option value="day">Day</option>
<option value="week">Week</option>
<option value="month">Month</option>
<option value="6months">6 months</option>
</select>
<span class="icon is-small is-left">
<i class="fas fa-magnifying-glass"></i>
</span>
</div>
</div>
</div>
</div>
<div class="field-label is-normal">
<label class="label">Fields</label>
</div>
</div>
<div class="column">
<label class="label">Fields</label>
<div class="field">
<div class="control is-expanded has-icons-left">
@ -66,10 +59,9 @@
</div>
</div>
</div>
<div class="field-label is-normal">
<label class="label">Results</label>
</div>
</div>
<div class="column">
<label class="label">Results</label>
<div class="field">
<div class="control is-expanded has-icons-left">
<div class="select is-fullwidth">
@ -78,6 +70,9 @@
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
</select>
<span class="icon is-small is-left">
<i class="fas fa-magnifying-glass"></i>
@ -85,63 +80,53 @@
</div>
</div>
</div>
</div>
</div>
<div class="field">
<div class="control">
<div class="field is-horizontal">
<div class="field-label">
<!-- Left empty for spacing -->
</div>
<div class="field-body">
<div class="field">
<div class="control">
<button class="button is-primary is-fullwidth">
Search
</button>
<button class="button is-primary">
Search
</button>
</div>
</div>
</div>
</div>
</form>
</div>
<div class="block">
<table class="table">
{% if results is not None %}
<thead>
<tr>
<th>TS</th>
<th>msg</th>
<th>host</th>
<th>nick</th>
<th>channel</th>
<th>net</th>
</tr>
</thead>
{% endif %}
<tbody>
{% for item in results %}
<tr>
<td>{{ item.ts }}</td>
<td>{{ item.msg }}</td>
<td>{{ item.host }}</td>
<td>{{ item.nick }}</td>
<td>{{ item.channel }}</td>
<td>{{ item.net }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if results is not None %}
<div class="box">
<div class="table-container">
<table class="table is-striped is-hoverable is-fullwidth">
<thead>
<tr>
<th>TS</th>
<th>msg</th>
<th>host</th>
<th>nick</th>
<th>channel</th>
<th>net</th>
</tr>
</thead>
<tbody>
{% for item in results %}
<tr>
<td>{{ item.ts }}</td>
<td>{{ item.msg }}</td>
<td>{{ item.host }}</td>
<td>{{ item.nick }}</td>
<td>{{ item.channel }}</td>
<td>{{ item.net }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<p>{{ card }} hits</p>
<p>{{ took }}ms</p>
{% endif %}
{% endblock %}