diff --git a/core/lib/opensearch.py b/core/lib/opensearch.py index 34cc0ae..89555b4 100644 --- a/core/lib/opensearch.py +++ b/core/lib/opensearch.py @@ -29,9 +29,29 @@ def construct_query(query, fields, results): query = { "size": results, "query": { - "multi_match": { + "query_string": { "query": query, "fields": fields, + # "default_field": "msg", + # "type": "best_fields", + "fuzziness": "AUTO", + "fuzzy_transpositions": True, + "fuzzy_max_expansions": 50, + "fuzzy_prefix_length": 0, + "minimum_should_match": 1, + "default_operator": "or", + "analyzer": "standard", + "lenient": False, + "boost": 1, + "allow_leading_wildcard": True, + "enable_position_increments": False, + "phrase_slop": 3, + "max_determinized_states": 10000, + "time_zone": "-08:00", + "quote_field_suffix": "", + "quote_analyzer": "standard", + "analyze_wildcard": True, + "auto_generate_synonyms_phrase_query": True, } }, } diff --git a/core/templates/ui/drilldown.html b/core/templates/ui/drilldown.html index f4278b5..c0ed052 100644 --- a/core/templates/ui/drilldown.html +++ b/core/templates/ui/drilldown.html @@ -142,5 +142,6 @@ {% if results is not None %}
{{ card }} hits
+{{ took }}ms
{% endif %} {% endblock %} diff --git a/core/ui/views/drilldown.py b/core/ui/views/drilldown.py index 34123ac..9ebbb69 100644 --- a/core/ui/views/drilldown.py +++ b/core/ui/views/drilldown.py @@ -46,6 +46,7 @@ class Drilldown(LoginRequiredMixin, View): "query": query, "results": results_parsed, "card": results["hits"]["total"]["value"], + "took": results["took"], "fields": settings.OPENSEARCH_MAIN_SEARCH_FIELDS, } return render(request, self.template_name, context)