From 98d54c784478d247e46c81664084c2aa0eafbff2 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Fri, 9 Aug 2024 13:38:56 +0300 Subject: Improve markdown formatting in XAPIAN search docs. Signed-off-by: Munyoki Kilyungi --- general/search/xapian_syntax.md | 88 ++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 46 deletions(-) (limited to 'general/search') diff --git a/general/search/xapian_syntax.md b/general/search/xapian_syntax.md index e849f65..aba28b8 100644 --- a/general/search/xapian_syntax.md +++ b/general/search/xapian_syntax.md @@ -1,100 +1,96 @@ -Global Search Queries ---------------------- +# Global Search Queries This page documents search queries as understood by our xapian search engine (aka "the global search"). -General xapian search query syntax is documented on the xapian website. +General xapian search query syntax is documented on the xapian website: [https://getting-started-with-xapian.readthedocs.io/en/latest/concepts/search/queryparser.html](https://getting-started-with-xapian.readthedocs.io/en/latest/concepts/search/queryparser.html). -* [https://getting-started-with-xapian.readthedocs.io/en/latest/concepts/search/queryparser.html](https://getting-started-with-xapian.readthedocs.io/en/latest/concepts/search/queryparser.html) - -The specifics of GeneNetwork's use of xapian differs slightly in the choice of prefixes and special syntax such as the synteny search. The examples below may help to illustrate it. +The specifics of GeneNetwork's use of xapian differs slightly in the choice of prefixes and special syntax such as the synteny search. The examples below may help to illustrate it. ### Free text search Search for the term "cytochrome" in the free text. -cytochrome +`cytochrome` -Search for the term "cytochrome" and the term "P450" in the free text. Only results that have both are shown. +Search for the term "cytochrome" and the term "P450" in the free text (only results that have both are shown): -cytochrome AND P450 +`cytochrome AND P450` -Search for occurrences of the term "cytochrome" near the term "P450" in the free text. +Search for occurrences of the term "cytochrome" near the term "P450" in the free text: -cytochrome NEAR P450 +`cytochrome NEAR P450` -Search for the term "cytochrome" in the free text but exclude results that have the term "P450". +Search for the term "cytochrome" in the free text but exclude results that have the term "P450": -cytochrome -P450 -cytochrome NOT P450 +`cytochrome -P450` +`cytochrome NOT P450` ### Boolean filtering -Search for results pertaining to the human species. +Search for results pertaining to the human species: + +`species:human` -species:human +Search for results pertaining to the BXD group: -Search for results pertaining to the BXD group. +`group:BXD` -group:BXD +or +`group:bxd` -Search for results pertaining to chromosome 11. +The above search is case-insensitive. -chr:11 +Search for results pertaining to chromosome 11: -Search for results pertaining to the BXD group and chromosome 11. +`chr:11` -group:BXD AND chr:11 +Search for results pertaining to the BXD group and chromosome 11: + +`group:BXD AND chr:11` ### Boolean filtering using numerical ranges -Search for results with mean between 5 and 7. +Search for results with mean between 5 and 7: -mean:5..7 +`mean:5..7` -Search for results with mean less than 5. +Search for results with mean less than 5: -mean:..5 +`mean:..5` -Search for results with mean greater than 7. +Search for results with mean greater than 7: -mean:7.. +`mean:7..` ### Synteny search -Search for results near (+/- 50 kbases) base 9930021 of chromosome 4 of the human species and syntenic locations in other species. +Search for results near (+/- 50 kbases) base 9930021 of chromosome 4 of the human species and syntenic locations in other species: -Hs:chr4:9930021 +`Hs:chr4:9930021` -Search for results near (+/- 50 kbases) base 9930021 of chromosome 4 of the human species and syntenic locations in mouse alone. +Search for results near (+/- 50 kbases) base 9930021 of chromosome 4 of the human species and syntenic locations in mouse alone: -Hs:chr4:9930021 species:mouse +`Hs:chr4:9930021 species:mouse` -Search for results between base 9130000 and 9980000 of chromosome 4 of the human species and syntenic locations in mouse alone. +Search for results between base 9130000 and 9980000 of chromosome 4 of the human species and syntenic locations in mouse alone: -Hs:chr4:9130000..9980000 species:mouse +`Hs:chr4:9130000..9980000 species:mouse` -Alternatively, this same query may be expressed using kilo or mega suffixes. +Alternatively, this same query may be expressed using kilo or mega suffixes: +``` Hs:chr4:9130k..9980k species:mouse Hs:chr4:9.13M..9.98M species:mouse +``` ### Gotchas #### Pure \`NOT\` queries are not supported -Due to - -* [performance reasons,](https://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html#ae96a58a8de9d219ca3214a5a66e0407eacafc7c8cf7c90adac0fc07d02125aed0) - -pure \`NOT\` queries are not supported. - -A search such as: - -NOT author:hager +Due to [performance reasons,](https://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html#ae96a58a8de9d219ca3214a5a66e0407eacafc7c8cf7c90adac0fc07d02125aed0) pure `NOT` queries are not supported. -will fail. +A search such as: `NOT author:hager` will fail. You will need to add something to the query to prevent the error, e.g. -species:mouse NOT author:hager +`species:mouse NOT author:hager` -- cgit v1.2.3