From d9665cab55078aa6e0c6ca4dce4a2c7ea8c4177d Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Fri, 24 Dec 2021 10:16:36 +0100 Subject: Add support for search_aliases in the settings file. Refs: https://todo.sr.ht/~valhalla/lesana/11 --- docs/source/user/search.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'docs/source/user/search.rst') diff --git a/docs/source/user/search.rst b/docs/source/user/search.rst index 41746a3..d14f37f 100644 --- a/docs/source/user/search.rst +++ b/docs/source/user/search.rst @@ -22,3 +22,21 @@ xapian for details. .. _`Query Parser`: https://getting-started-with-xapian.readthedocs.io/en/latest/concepts/search/queryparser.html +.. _search aliases: + +Search templates and ``search_aliases`` +======================================= + +In some contexts, search queries are rendered as jinja2 templates with +the contents of the ``search_aliases`` property as set in +``settings.yaml``. + +The values of those search aliases should be valid search snippets with +the syntax documented above; it's usually a good idea to wrap them in +parenthesis, so that they are easier to use in complex queries; e.g.:: + + my_alias: '(name:object OR name:thing)' + +can correctly be used in a query like:: + + {{ my_alias }} AND description:shiny -- cgit v1.2.3