From cbe6429bf5feca14dda9d03e3eb0920653e82f82 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sat, 16 Nov 2024 14:20:02 +0100 Subject: 📝 update search documentation and search help with AND and OR notation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/fr/source/interface-utilisateur.rst | 19 +++++++++++++++++-- ishtar_common/templates/widgets/search_input.html | 12 ++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/docs/fr/source/interface-utilisateur.rst b/docs/fr/source/interface-utilisateur.rst index 05aab0e93..c598b64bf 100644 --- a/docs/fr/source/interface-utilisateur.rst +++ b/docs/fr/source/interface-utilisateur.rst @@ -120,8 +120,6 @@ Préfixer un terme par un « moins » : « ``-`` » permet d'exclure des ter **Exemple** : une recherche avec « ``ancre -amphore`` » permet d'obtenir la liste des ancres en excluant les lots de mobilier comprenant des amphores. -.. - TODO: Une recherche avec l'opérateur OU... pour l'instant cette recherche pose trop de problèmes Recherche par critère --------------------- @@ -162,6 +160,23 @@ Pour des recherches de type plus grand, plus petit (pour les champs de type num **Exemple** : la recherche « ``annee=>"2019"`` » permet d'obtenir tous les éléments de 2019 et après. + +Opérateur OU +++++++++++++ + +Un opérateur OU est disponible afin de faire une recherche incluant, par exemple, des critères différents. Cet opérateur utilise la notation «`` || ``». + +**Exemple** : la recherche « ``materiau="Métal" || type-objet="lingot" `` » incluera dans la recherche tout le mobilier métallique ainsi que tout le mobilier dont le type d'objet est lingot. + +Opérateur ET +++++++++++++ + +Un opérateur ET est disponible notamment afin de faire une recherche sur un même critère avec plusieurs valeurs. Cet opérateur utilise la notation «`` && ``». + +**Exemple** : la recherche « ``materiau="Métal" && matériau="Bois" `` » n'incluera dans la recherche que le mobilier qui a pour matériau métal et bois. + +.. warning:: Les opérateurs «`` && ``» et «`` || ``» ne fonctionnent que s'ils sont bien entourés d'espaces. + .. _bookmarks: Marques-pages et alertes diff --git a/ishtar_common/templates/widgets/search_input.html b/ishtar_common/templates/widgets/search_input.html index 832cfc20c..e6808833e 100644 --- a/ishtar_common/templates/widgets/search_input.html +++ b/ishtar_common/templates/widgets/search_input.html @@ -80,8 +80,16 @@

{% blocktrans %}Example: "material='*'" will return only all items with a material set, "-material='*'" return all items with material not set.{% endblocktrans %}

{% trans "Greater than, lower than, before, after" %}

-

{% blocktrans %}For searches such as larger, smaller (for numeric fields), before, after (for date fields), add the criterion from the form, then change the "=" sign to "=>" or "=<", depending on the desired result.{% endblocktrans %}

-

{% blocktrans %}Example: the search 'year=>"2019"' will return all items from 2019 and onwards.{% endblocktrans %}

+

{% blocktrans %}For searches such as larger, smaller (for numeric fields), before, after (for date fields), add the criterion from the form, then change the "=" sign to "=>" or "=<", depending on the desired result.{% endblocktrans %}

+

{% blocktrans %}Example: the search "year=>'2019'" will return all items from 2019 and onwards.{% endblocktrans %}

+ +

{% trans "OR operator" %}

+

{% blocktrans %}An OR operator is available for searches that include, for example, different criteria. This operator uses the notation " || ".{% endblocktrans %}

+

{% blocktrans %}Example: the search "material='Metal' || object-type='ingot'" will include in the search all metallic finds as well as all finds whose object type is ingot.{% endblocktrans %}

+ +

{% trans "AND operator" %}

+

{% blocktrans %}An AND operator is available to search on the same criterion with several values. This operator uses the notation " && ".{% endblocktrans %}

+

{% blocktrans %}Example: the search "material='Metal' && material='wood'" will only include finds made of metal and wood.{% endblocktrans %}

{% trans "Full documentation for searches." %}

-- cgit v1.2.3