DokuWiki

It's better when it's simple

User Tools

Site Tools


search

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
search [2012-08-09 13:22] – [The OR operator (|)] added example usage, also to clarify OR vs. not-given XOR; made also "either or" to "either or both" for clarification hh lohmannsearch [2023-11-29 05:23] (current) – [Some Background on the Searchindex] state that numbering starts at 0 in page.idx schplurtz
Line 2: Line 2:
  
 Search is done through the Search box in top row (when using the default [[template]]). Search is done through the Search box in top row (when using the default [[template]]).
 +
 ===== Syntax ===== ===== Syntax =====
  
Line 10: Line 11:
 ==== Terms you want to exclude (-) ==== ==== Terms you want to exclude (-) ====
  
-You can attach a dash ''-'' immediately before a keyword to exclude pages that contain this keyword from your search results. For example the query ''[ dokuwiki -plugin ]'' will find pages which contain "DokuWiki" but not contain "plugin".+You can attach a minus sign ''-'' immediately before a keyword to exclude pages that contain this keyword from your search results. For examplethe query ''[ dokuwiki -plugin ]'' will find pages which contain "DokuWiki" but do not contain "plugin".
  
 You can use this syntax ''-'' not just for a keyword, but also for a partial matching, a phrase search, a namespace search and a grouping search described below. For example, you can use the query ''%%[ -"phrase you want to exclude" ]%%'' to exclude exact phrase.  You can use this syntax ''-'' not just for a keyword, but also for a partial matching, a phrase search, a namespace search and a grouping search described below. For example, you can use the query ''%%[ -"phrase you want to exclude" ]%%'' to exclude exact phrase. 
Line 18: Line 19:
 You can perform a partial matching by prefixing and/or suffixing an asterisk ''*'' to a keyword. For example, searching for ''[ wiki ]'' will only find "wiki", but searching for ''[ *wiki ]'' will also find "DokuWiki" (suffix matching). You can also perform ''[ doku* ]'' (prefix matching) and ''[ *okuwik* ]'' (partial matching). You can perform a partial matching by prefixing and/or suffixing an asterisk ''*'' to a keyword. For example, searching for ''[ wiki ]'' will only find "wiki", but searching for ''[ *wiki ]'' will also find "DokuWiki" (suffix matching). You can also perform ''[ doku* ]'' (prefix matching) and ''[ *okuwik* ]'' (partial matching).
  
-Note that ''*'' is not a "wildcard". You can't use it within a keyword, i.e. searching ''[ doku*iki ]'' will not find anything for you.+Note that ''*'' is not a "wildcard". You can't use it within a keyword, i.e. searching ''[ doku*iki ]'' will not find anything for you.  
  
 ==== Phrase search ("") ==== ==== Phrase search ("") ====
Line 49: Line 50:
 ===== OpenSearch ===== ===== OpenSearch =====
  
-{{ :opensearch.png|OpenSearch in Firefox}}+{{ :opensearch2.png|OpenSearch in Firefox}}
  
 [[http://www.opensearch.org/|OpenSearch]] is a standard to make it easy to integrate a website's search into your browser. It is supported by all modern browsers. DokuWiki is OpenSearch enabled. [[http://www.opensearch.org/|OpenSearch]] is a standard to make it easy to integrate a website's search into your browser. It is supported by all modern browsers. DokuWiki is OpenSearch enabled.
  
-Here is how to add your Wiki's search to Firefox (other browsers probably handle it in a similar way):+Here is how to add your wiki's search to Firefox (other browsers probably handle it in a similar way):
  
   - open your wiki in the browser   - open your wiki in the browser
-  - click the little arrow on the left of your search field +  - click the magnifying glass on the left of your browser'search field 
-  - choose "Add DokuWiki" ((It might be named different if your Wiki is named different))+  - choose "Add <your wiki's title>", e.g. "Add DokuWiki"
  
 ===== Some Background on the Searchindex ===== ===== Some Background on the Searchindex =====
Line 63: Line 64:
 DokuWiki now uses an index to search even big wikis very fast, to be able to find anything the index needs to be filled with current data. Information about a page's content is added and updated when a page is viewed by a user. Each page includes an invisible image ([[wp>webbug]]) which calls the index update process if needed.((Note that the webbug is used for other tasks, too.  See http://forum.dokuwiki.org/post/3116))  (That is, if the timestamp of the page is newer than the timestamp of the index file.) DokuWiki now uses an index to search even big wikis very fast, to be able to find anything the index needs to be filled with current data. Information about a page's content is added and updated when a page is viewed by a user. Each page includes an invisible image ([[wp>webbug]]) which calls the index update process if needed.((Note that the webbug is used for other tasks, too.  See http://forum.dokuwiki.org/post/3116))  (That is, if the timestamp of the page is newer than the timestamp of the index file.)
  
-The index consists of files called ''page.idx'', ''w//[n]//.idx'' and ''i//[n]//.idx'' located in the index directory. ''w//[n]//.idx'' contains a list of all words (except stopwords) with a length of //n// that appear on the wiki pages. For every line in ''w//[n]//.idx'' there is a line in the corresponding ''i//[n]//.idx'' file that contains page references in the form of ''pn*freq''. ''pn'' is a line number for ''page.idx'', ''freq'' denotes how often the word appears on the page. Multiple page references are separated with a colon.+The index consists of files called ''page.idx'', ''w//[n]//.idx'' and ''i//[n]//.idx'' located in the index directory. ''w//[n]//.idx'' contains a list of all words (except stopwords) with a length of //n// that appear on the wiki pages. For every line in ''w//[n]//.idx'' there is a line in the corresponding ''i//[n]//.idx'' file that contains page references in the form of ''pn*freq''. ''pn'' is a line offset for ''page.idx'', ''freq'' denotes how often the word appears on the page. Multiple page references are separated with a colon. 
 + 
 +The [[taskrunner|indexer]] uses a language specific stopword file which contains a list of very common words which will never be indexed (e.g. the word ''the'' in English). Searching for such a word will not return any hits. This stopword file is located in language folder of the DokuWiki installation, that is ''<dokuwiki>/inc/lang/<language>/stopwords.txt'' so you can edit the file in proper folder for adding or removing words not indexed for that language (Unfortunately, these edits are not kept on upgrades of DokuWiki). 
 + 
 +If you upgraded your wiki from an older version without an index, your search won't return anything until the index is built. You can either wait until this happens by browsing your wiki or install the [[plugin:searchindex]] plugin. You can also use the provided [[cli|commandline script]] for updating the index. 
 + 
 +===== See also =====
  
-The [[indexer]] uses a language specific stopword file which contains a list of very common words which will never be indexed (e.g. the word ''the'' in English). Searching for such a word will not return any hits. This stopword file is located in language folder of the DokuWiki installation, that is <dokuwiki>/inc/lang/<language>/stopwords.txt so you can edit the file in proper folder for adding or removing words not indexed for that language.+  * [[faq:searchindex|Search Index Issues]] 
 +  * [[config:search_fragment|Configuration Setting: search_fragment]] 
 +  * [[config:search_nslimit|Configuration Setting: search_nslimit]] 
 +  * [[config:readdircache|Configuration Setting: readdircache]] 
 +  * [[plugintag>search|Plugins tagged with "search"]]
  
-If you upgraded your wiki from an older version without an index, your search won't return anything until the index is built. You can either wait until this happens by browsing your wiki or use the provided [[cli|commandline script]] for updating the index. 
search.1344511355.txt.gz · Last modified: 2012-08-09 13:22 by hh lohmann

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki