| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| wiki:search [2026/02/10 14:30] – bobbyk | wiki:search [2026/02/10 16:47] (current) – [The OR operator (|)] bobbyk |
|---|
| |
| | |
| \[from dokuwiki.org @ 25-08-20\] {{ :wiki:search-box.png?300|}} | {{ :wiki:search-box.png?300|}} |
| |
| A search can be started from any page, using the Search box in upper right of each page. | A search can be started from any page, using the Search box in upper right of each page. |
| |
| In this section, we'll use square brackets ''\[ ... \]'' to represent characters entered in the query. | In this section, we'll use square brackets ''\[ ... \]'' to represent characters entered in the query. |
| | |
| | --- |
| |
| ### Phrase search ("") | ### Phrase search ("") |
| |
| You can search for exact phrases by putting double quotes around a set of words, e.g. ''\[ "Cornell Law Review" \]''. | You can search for exact phrases by putting double quotes around a set of words, e.g. ''\[ "Cornell Law Review" \]''. |
| | |
| | {{:wiki:searchsample\_1.jpg?400|}} |
| | |
| | --- |
| |
| ### Excluding Terms (-) | ### Excluding Terms (-) |
| |
| But, [searching](https://wikipreview.qacos.com/doku.php?do=search&id=wiki%3Asearch&sf=1&q=%22Cornell+Law+Review%22+-Humbertson) for ''\[ "Cornell Law Review" -Humbertson \]'' | But, [searching](https://wikipreview.qacos.com/doku.php?do=search&id=wiki%3Asearch&sf=1&q=%22Cornell+Law+Review%22+-Humbertson) for ''\[ "Cornell Law Review" -Humbertson \]'' |
| | |
| | {{:wiki:cornell-humbertson.jpg?500|}} |
| |
| * will find only the 2 pages — | * will find only the 2 pages — |
| * briefing\_book\_pdf\_files\_4014 | * briefing\_book\_pdf\_files\_4014 |
| * problems\_with\_the\_testimony\_of\_robert\_brown\_pdf\_files\_16269 | * problems\_with\_the\_testimony\_of\_robert\_brown\_pdf\_files\_16269 |
| | |
| | --- |
| |
| ### Partial matching (\*) | ### Partial matching (\*) |
| |
| You can also perform ''\[ doku**\*** \]'' (prefix matching) and \[\*okuwik\*\] (partial matching). | You can also perform ''\[ doku**\*** \]'' (prefix matching) and \[\*okuwik\*\] (partial matching). |
| | . |
| Note that ''**\***'' is not a "wildcard". You can't use it _inside_ of a word. For example, searching ''\[ doku\*iki \]'' will not find anything for you. | Note that ''**\***'' is not a "wildcard". You can't use it _inside_ of a word. For example, searching ''\[ doku\*iki \]'' will not find anything for you. |
| |
| ### The OR operator (|) | ### The OR operator (|) |
| |
| By default DokuWiki performs a logical AND search, but you can also use a logical OR search by using ''|'' or ''or'' as a separator of your search terms. For example, the query ''\[ plugin | template \]'' will find pages which contain either "plugin" or "template" or both. The query ''\[ plugin or template \]'' will do the same thing. You may use OR as a simple alternative to \[\[#Partial matching (\*)\]\], e.g. in finding pages about people with spelling variations as ''\[ Frank | Fränk \]''. | By default, DokuWiki searches for _all_ the words in your search, but you can also search for _any_ of your search terms. (This is called a logical OR search.) |
| | |
| | OR searching is done by including ''|'' or ''or'' as a separator between your search terms. |
| | |
| | For example, the query ''\[ event | show \]'' will find pages which contain either "plugin" or "template" or both. |
| | |
| | The query ''\[ event or show \]'' will do the same thing. |
| | |
| | You can make use of OR as a way to find search terms with spelling variations, for example ''\[ capitol | capital \]'', or, ''\[ state capitol | state capital \]''. |
| | |
| | \_ |
| | |
| | The OR operator has a lower 'precedence' than the default AND operator. |
| | |
| | That is, the query |
| | |
| | ''\[ gun show | event \]'' |
| | |
| | is the same as |
| | |
| | ''\[ (gun show) | event \]''. |
| | |
| | _**$$$ include some actual hits pages $$$**_ |
| | |
| | _**$$$ add a screen print of the sample search $$$**_ |
| |
| The OR operator has a lower precedence than the default AND operator. That is, the query ''\[ dokuwiki plugin | template \]'' can be represented as ''\[ (dokuwiki plugin) | template \]'', not as ''\[ dokuwiki (plugin | template) \]''. Instead, use a grouping syntax as described below. | . |
| | But, if you needed to search for (gun show) or for (gun event), you could _not_ write it as ''\[ gun (show | event) \]''. |
| |
| If you want to \[\[#Search within a namespace (@) |restrict your search on a namespace\]\], you **have** to group your search with "()", otherwise a search ''\[ plugin | template @plugin\]'' will behave as ''\[ (plugin) | (template @plugin)\]'', i.e. searching for "plugin" OR "template @plugin" over //all// namespaces, but not as you may intend searching "plugin" OR "template" over the //plugin// namespace, the latter being correctly expressed as ''\[ (plugin | template) @plugin\]''. | Instead, use a _grouping search_ — as described below. |
| |
| ### Grouping search | ### Grouping search |