| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| wiki:search [2026/02/10 15:56] – [Phrase search ("")] bobbyk | wiki:search [2026/02/18 15:13] (current) – [Grouping search] 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. |
| |
| --- | --- |
| | |
| ### Phrase search ("") | ### Phrase search ("") |
| |
| {{:wiki:searchsample\_1.jpg?400|}} | {{:wiki:searchsample\_1.jpg?400|}} |
| |
| \-- | --- |
| - | |
| ### Excluding Terms (-) | ### Excluding Terms (-) |
| |
| |
| 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.) |
| |
| 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. | "OR" searching is done by including ''|'' or ''or'' as a separator between your search terms. |
| |
| 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\]''. | For example, the query ''\[ event | show \]'' will find pages which contain either "event" or "show" or both. |
| |
| | The query ''\[ event _or_ show \]'' will do the same thing. |
| | |
| | #### Examples: |
| | |
| | Suppose we are looking for volunteer Mary Magathan and Representative Duane Droge (both of Kansas) |
| | |
| | A search using the default "and" search of the two last names, `[ Droge magathan ]` , brings up only one result. |
| | |
| | {{:wiki:search\_droge\_magathan.jpg?300|}} |
| | |
| | * mary\_magathan\_s\_district\_page\_txt\_pages\_20882 |
| | |
| | A search using an "or" search, `[ Droge | magathan ]`, returns six results. |
| | |
| | {{:wiki:search\_droge\_or\_magathan.jpg?300|}} |
| | |
| | * mary\_magathan\_s\_district\_page\_txt\_pages\_20882 |
| | * mary\_magathan\_is\_convention\_of\_states\_txt\_blogposts\_28290 |
| | * kansas\_district\_13\_txt\_pages\_16778 |
| | * 2024\_general\_election\_candidate\_list\_txt\_pages\_25882 |
| | * april\_2025\_newsletter\_txt\_blogposts\_29033 |
| | * cos\_gains\_support\_from\_kansans\_for\_constitutional\_integrity\_txt\_blogposts\_19416 |
| | |
| | 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 \]''. |
| | |
| | |
| | But, if you needed to search for (gun show) or for (gun event), you could _not_ write it as ''\[ gun (show | event) \]''. |
| | |
| | Instead, use a _grouping search_ — as described below. |
| ### Grouping search | ### Grouping search |
| |
| You can group search terms by enclosing terms with parentheses ''( ... )''. Having the highest precedence, parentheses may be used to force precedence. | You can group search terms by enclosing terms with parentheses ''( ... )''. Having the highest precedence, parentheses may be used to force precedence. |
| |
| For example, the query ''\[ dokuwiki -(plugin | @plugin) \]'' will find pages which contain a word "DokuWiki" but not contain a word "plugin" and also are not within a namespace "plugin". | For example, let's say we want to find Robert Cahaly mentioned, but not in the context of John Birch Society _nor_ in the context of Georgia. |
| | |
| | The query would be ''\[ Cahaly -(JBS | Georgia) \]'', and it will find pages which do contain the word "Cahaly" but not contain the word "JBS" and also not contain the word "Georgia". |