Wiki page
[search function] by
mario
2015-02-04 01:51:50.
D 2015-02-04T01:51:50.413
L search\sfunction
N text/x-markdown
P 49e01ddbe5af82b8cb8c2913bda5cbb320edb7f1
U mario
W 1807
### Status: *obsolete*
There's now a built-in `/search` page in [Fossil 1.31 and later](http://fossil-scm.org/index.html/timeline?r=indexed-fts). It scans the current contents right away, includes Wiki pages, documents or all files, checkins and timeline events. Furthermore it can be configured vi `/srchsetup` to build and utilize a FTS (full text search) table.
### Old userland search function
The [Stackoverflow](wiki/Stackoverflow) and [GitHub](wiki/GitHub) themes already include this search feature. Its display is implemented as [TH1](wiki/th1x) script.
It requires a litte setup, but works with other themes as well.
* Use <b>[fossil-search-table.php](wiki/fossil-search-table.php)</b> to have your repositories updated with a [fx_search](wiki/fx_search) table. (Thanks go to Joel for pointing the `fx_` prefix feature out.)
* It traverses existing *.fossil repositories. But the `glob()` could point to just one repo.fossil of course. <br><br>
* Have it run as cron script. <br><br>
* Unless you use the `so-skin.txt` config, you have to manually import the `th1x.tcl` script as `th1-setup` to your repository configuration:
fossil setting th1-setup "$(cat th1x.tcl)"
* In your templates header add following invocation code at the bottom:
<th1> catch {ui::search_on_wiki} </th1>
* And following as your search box:
<form action="wiki">
<input name="name" size="28" placeholder="search wiki+files">
</form>
For the `so-skin` you could else still edit the old Google search box in, of course.
### Attachments
See [features/](wiki/features) for
* [fossil-search-table.php](wiki/fossil-search-table.php)
* [th1x.tcl](wiki/th1x)
Z 4d80f3c4921405e2959da9b0dff3e5a4