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_transpositions": True,
"fuzzy_max_expansions": 50, "fuzzy_max_expansions": 50,
"fuzzy_prefix_length": 0, "fuzzy_prefix_length": 0,
"minimum_should_match": 1, # "minimum_should_match": 1,
"default_operator": "or", "default_operator": "or",
"analyzer": "standard", "analyzer": "standard",
"lenient": False, "lenient": True,
"boost": 1, "boost": 1,
"allow_leading_wildcard": True, "allow_leading_wildcard": True,
"enable_position_increments": False, # "enable_position_increments": False,
"phrase_slop": 3, "phrase_slop": 3,
"max_determinized_states": 10000, # "max_determinized_states": 10000,
"time_zone": "-08:00",
"quote_field_suffix": "", "quote_field_suffix": "",
"quote_analyzer": "standard", "quote_analyzer": "standard",
"analyze_wildcard": True, "analyze_wildcard": False,
"auto_generate_synonyms_phrase_query": True, "auto_generate_synonyms_phrase_query": True,
} }
}, },

View File

@ -2,13 +2,11 @@
{% load static %} {% load static %}
{% block content %} {% block content %}
<div class="block"> <div class="box">
<form method="POST"> <form method="POST">
{% csrf_token %} {% csrf_token %}
<div class="field is-horizontal"> <div class="field">
<div class="field-label is-normal"> <label class="label">Search</label>
<label class="label">Search</label>
</div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
<div class="control is-expanded has-icons-left"> <div class="control is-expanded has-icons-left">
@ -21,36 +19,31 @@
</div> </div>
</div> </div>
<div class="columns">
<div class="field is-horizontal"> <div class="column">
<div class="field-label is-normal">
<label class="label">Timescale</label> <label class="label">Timescale</label>
</div> <div class="field-body">
<div class="field">
<div class="field-body"> <div class="control is-expanded has-icons-left">
<div class="field"> <div class="select is-fullwidth">
<div class="control is-expanded has-icons-left"> <select name="timescale">
<div class="select is-fullwidth"> <option value="minute">Minute</option>
<select name="timescale"> <option value="hour">Hour</option>
<option value="minute">Minute</option> <option value="day">Day</option>
<option value="hour">Hour</option> <option value="week">Week</option>
<option value="day">Day</option> <option value="month">Month</option>
<option value="week">Week</option> <option value="6months">6 months</option>
<option value="month">Month</option> </select>
<option value="6months">6 months</option> <span class="icon is-small is-left">
<i class="fas fa-magnifying-glass"></i>
</select> </span>
<span class="icon is-small is-left"> </div>
<i class="fas fa-magnifying-glass"></i>
</span>
</div> </div>
</div> </div>
</div>
<div class="field-label is-normal">
<label class="label">Fields</label>
</div> </div>
</div>
<div class="column">
<label class="label">Fields</label>
<div class="field"> <div class="field">
<div class="control is-expanded has-icons-left"> <div class="control is-expanded has-icons-left">
@ -66,10 +59,9 @@
</div> </div>
</div> </div>
</div> </div>
<div class="field-label is-normal"> </div>
<label class="label">Results</label> <div class="column">
</div> <label class="label">Results</label>
<div class="field"> <div class="field">
<div class="control is-expanded has-icons-left"> <div class="control is-expanded has-icons-left">
<div class="select is-fullwidth"> <div class="select is-fullwidth">
@ -78,6 +70,9 @@
<option value="10">10</option> <option value="10">10</option>
<option value="15">15</option> <option value="15">15</option>
<option value="20">20</option> <option value="20">20</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
</select> </select>
<span class="icon is-small is-left"> <span class="icon is-small is-left">
<i class="fas fa-magnifying-glass"></i> <i class="fas fa-magnifying-glass"></i>
@ -85,63 +80,53 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="field">
<div class="control">
<div class="field is-horizontal"> <button class="button is-primary is-fullwidth">
<div class="field-label"> Search
<!-- Left empty for spacing --> </button>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<button class="button is-primary">
Search
</button>
</div>
</div>
</div> </div>
</div> </div>
</form> </form>
</div> </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 %} {% 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>{{ card }} hits</p>
<p>{{ took }}ms</p> <p>{{ took }}ms</p>
{% endif %} {% endif %}
{% endblock %} {% endblock %}