Plume/templates/search/index.html.tera
fdb-hiroshima 449641d158
Add a search engine into Plume (#324)
* Add search engine to the model

Add a Tantivy based search engine to the model
Implement most required functions for it

* Implement indexing and plm subcommands

Implement indexation on insert, update and delete
Modify func args to get the indexer where required
Add subcommand to initialize, refill and unlock search db

* Move to a new threadpool engine allowing scheduling

* Autocommit search index every half an hour

* Implement front part of search

Add default fields for search
Add new routes and templates for search and result
Implement FromFormValue for Page to reuse it on search result pagination
Add optional query parameters to paginate template's macro
Update to newer rocket_csrf, don't get csrf token on GET forms

* Handle process termination to release lock

Handle process termination
Add tests to search

* Add proper support for advanced search

Add an advanced search form to /search, in template and route
Modify Tantivy schema, add new tokenizer for some properties
Create new String query parser
Create Tantivy query AST from our own

* Split search.rs, add comment and tests

Split search.rs into multiple submodules
Add comments and tests for Query
Make user@domain be treated as one could assume
2018-12-02 17:37:51 +01:00

51 lines
1.9 KiB
Plaintext

{% extends "base" %}
{% import "macros" as macros %}
{% block title %}
Search
{% endblock title %}
{% block head %}
<script>
window.onload = function(evt) {
var form = document.getElementById('form');
form.addEventListener('submit', function () {
for (var input of form.getElementsByTagName('input')) {
if (input.name === '') {
input.name = input.id
}
if (input.name && !input.value) {
input.name = '';
}
}
});
}
</script>
{% endblock head %}
{% block content %}
<h1>search</h1>
<form method="get" id="form">
<input id="q" name="q" placeholder="Your query" type="search">
<details>
<summary>Advanced search</summary>
{{ macros::input(name="title", label="Title matching these words", props='placeholder="Title"') }}
{{ macros::input(name="subtitle", label="Subtitle matching these words", props='placeholder="Subtitle"') }}
{{ macros::input(name="content", label="Content matching these words", props='placeholder="Content"') }}
{{ macros::input(name="after", label="From this date", type="date", props='max=' ~ now) }}
{{ macros::input(name="before", label="To this date", type="date", props='max=' ~ now) }}
{{ macros::input(name="instance", label="Sent from one of these instance", props='placeholder="Instance domain"') }}
{{ macros::input(name="author", label="Sent by one of these author", props='placeholder="Authors"') }}
{{ macros::input(name="tag", label="Containing these tags", props='placeholder="Tags"') }}
{{ macros::input(name="blog", label="In blog", props='placeholder="Blog title"') }}
{{ macros::input(name="lang", label="Language used", props='placeholder="Language"') }}
{{ macros::input(name="license", label="Using license", props='placeholder="License"') }}
</details>
<input type="submit" value="Search"/>
</form>
{% endblock content %}