plugin:searchtext
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:searchtext [2010-01-25 10:54] – hansel | plugin:searchtext [2023-09-02 20:33] (current) – Similar to elasticsearch, docsearch michaelsy | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
---- plugin ---- | ---- plugin ---- | ||
- | description: | + | description: |
- | author | + | author |
- | email : todd@rollerorgans.com | + | email : michael@content-space.de |
- | type : action, render | + | type : action |
- | lastupdate : 2008-02-28 | + | lastupdate : 2015-04-19 |
- | compatible : devel > | + | compatible : Hogfather, Greebo, Frusterrick Manner, Elenor of Tsort, Detritus |
depends | depends | ||
- | conflicts | + | conflicts |
- | similar | + | similar |
tags : search | tags : search | ||
+ | downloadurl: | ||
+ | bugtracker : https:// | ||
+ | sourcerepo : https:// | ||
+ | donationurl: | ||
---- | ---- | ||
Line 17: | Line 21: | ||
This plugin displays search result snippets from text. | This plugin displays search result snippets from text. | ||
- | :!: This plugin **requires**: | + | :!: This plugin **requires** |
- | -A text renderer, such as the [[plugin: | + | |
- | -A slight modification to add a FULLTEXT_SNIPPET_GETTEXT event to inc/ | + | |
- | + | ||
- | :!: You will need a recent [[devel: | + | |
- | + | ||
- | ===== Download ===== | + | |
- | + | ||
- | * [[http:// | + | |
- | * 2008-02-28, initial upload | + | |
===== Usage ===== | ===== Usage ===== | ||
- | There are two checkbox configuration items which appear | + | There are two checkbox configuration items which appear |
-Search in rendered text | -Search in rendered text | ||
-Display search result snippets from rendered text | -Display search result snippets from rendered text | ||
- | You __must__ edit the function [[xref> | ||
- | < | ||
- | |||
- | [Allow plugin to insert search snippet text | ||
- | Todd Augsburger < | ||
- | | ||
- | Allow plugin to insert search snippet text | ||
- | ] { | ||
- | hunk ./ | ||
- | - $text = rawWiki($id); | ||
- | + $text = trigger_event(' | ||
- | } | ||
- | |||
- | </ | ||
- | |||
- | Actual row in code may vary, for //DokuWiki 2009-02-14// | ||
- | |||
- | ===== Other plugins ===== | ||
- | This plugin requires a text renderer, such as [[plugin: | ||
===== Discussion ===== | ===== Discussion ===== | ||
- | The [[devel:develonly]] version already has a similar event, so then it's better to patch the plugin. | + | :!: Please report any bugs on the [[https://github.com/michitux/dokuwiki-plugin-searchtext/ |
- | + | ||
- | Replace | + | |
- | <code php> | + | |
- | function register(& | + | |
- | $controller-> | + | |
- | $controller-> | + | |
- | } | + | |
- | + | ||
- | . | + | |
- | . | + | |
- | . | + | |
- | + | ||
- | function _getSnippet(& | + | |
- | if($this-> | + | |
- | global $ID; | + | |
- | + | ||
- | $prevID = $ID; | + | |
- | $ID = $event-> | + | |
- | $event-> | + | |
- | $ID = $prevID; | + | |
- | $event-> | + | |
- | } | + | |
- | } | + | |
- | </ | + | |
- | + | ||
- | with | + | |
- | <code php> | + | |
- | function register(& | + | |
- | $controller-> | + | |
- | $controller-> | + | |
- | } | + | |
- | + | ||
- | . | + | |
- | . | + | |
- | . | + | |
- | + | ||
- | function _getSnippet(& | + | |
- | if($this-> | + | |
- | global $ID; | + | |
- | + | ||
- | $prevID = $ID; | + | |
- | $ID = $event-> | + | |
- | $event-> | + | |
- | $ID = $prevID; | + | |
- | $event-> | + | |
- | } | + | |
- | } | + | |
- | </code> | + | |
- | | + | |
- | + | ||
- | The latest DokuWiki (dokuwiki-2009-12-25c) almost works out of the box with the modification described by HåkanS: just remove $event-> | + | |
- | <code php> | + | |
- | function _getSnippet(& | + | |
- | if($this-> | + | |
- | global $ID; | + | |
- | $prevID = $ID; | + | |
- | $ID = $event-> | + | |
- | $event-> | + | |
- | $ID = $prevID; | + | |
- | } | + | |
- | } | + | |
- | </ | + | |
- | --- // | + |
plugin/searchtext.1264413263.txt.gz · Last modified: 2010-01-25 10:54 by hansel