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,12 +19,9 @@
</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-body">
<div class="field"> <div class="field">
<div class="control is-expanded has-icons-left"> <div class="control is-expanded has-icons-left">
@ -38,19 +33,17 @@
<option value="week">Week</option> <option value="week">Week</option>
<option value="month">Month</option> <option value="month">Month</option>
<option value="6months">6 months</option> <option value="6months">6 months</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>
</span> </span>
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="field-label is-normal"> </div>
<div class="column">
<label class="label">Fields</label> <label class="label">Fields</label>
</div>
<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">
<label class="label">Results</label>
</div> </div>
<div class="column">
<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,35 +80,25 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
</div>
<div class="field is-horizontal">
<div class="field-label">
<!-- Left empty for spacing -->
</div>
<div class="field-body">
<div class="field"> <div class="field">
<div class="control"> <div class="control">
<button class="button is-primary"> <button class="button is-primary is-fullwidth">
Search Search
</button> </button>
</div> </div>
</div> </div>
</div>
</div>
</form> </form>
</div> </div>
<div class="block">
<table class="table">
{% 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> <thead>
<tr> <tr>
<th>TS</th> <th>TS</th>
@ -124,7 +109,6 @@
<th>net</th> <th>net</th>
</tr> </tr>
</thead> </thead>
{% endif %}
<tbody> <tbody>
{% for item in results %} {% for item in results %}
@ -140,8 +124,9 @@
</tbody> </tbody>
</table> </table>
</div> </div>
{% if results is not None %} </div>
<p>{{ card }} hits</p> <p>{{ card }} hits</p>
<p>{{ took }}ms</p> <p>{{ took }}ms</p>
{% endif %} {% endif %}
{% endblock %} {% endblock %}