HandWiki:Help/Search

From HandWiki

Searches of words in HandWiki

Here we explain several types of serach engines used in Handwiki. You can add them to you users home area.

HandWiki uses two search engines:

  • Standard search based on Elasticsearch. This engine is used by Wikipedia and Mediawiki. The advantage of this engine is that its index is updated in real time. This search box is located in the top menu.
  • Fast and significantly more optimized search engine (Handwiki proprietorial). It is about a factor 10 faster than Elasticsearch, but its index is updated every few days. This engine is used inthe main HandWiki page and on the left side menu.

Below we will explain how to use such engines and how to customize search boxes.

Fast search

You can add search boxes like this:

Using the following code.

<hwsearch>Computing</hwsearch>

The passed arguments are namespace name. "Computing" or Main" means "main namespace". You can also pass "All" (all namespaces), "Titles" (titles) or "Contents" (content).

Elastic search

Alternatively, you can use a slower search based on Elasticsearch. The database of this engine is updated in real time. Here is an example:

You can pass multiple namespaces.

It is programmed as this

type=search
bgcolor=#ffffff
break=yes
width=50%
inline=false
namespaces=Main**, Physics
placeholder=Search in Computers

Such searches are implemented in [Search in namespaces].

Search with suggestions

You can add "auto-complete" feature to the search based on Elasticsearch:

<html>

<form action="/wiki/index.php" id="searchform" class="mw-search"> <input type="search" name="search" placeholder="Search in all HandWiki topics" title="Search [alt-shift-f]" accesskey="f" id="searchInput" autocomplete="on" >

<button id="searchGoButtonM" type="submit" value="Go" name="Go">Go</button> <button id="searchTextM" type="submit" value="Search" name="fulltext">Search</button>

</form>

</html>

It is codded as this:

<html>
<center>
<form action="/wiki/index.php" id="searchform" class="mw-search">
<input type="search" name="search" placeholder="Search in all HandWiki topics" title="Search [alt-shift-f]" accesskey="f" id="searchInput" autocomplete="on" > 
<div class="flexbntsearch">
<button id="searchGoButtonM" type="submit" value="Go" name="Go">Go</button>
<button id="searchTextM" type="submit" value="Search" name="fulltext">Search</button>
</div>
</form>
</center>
</html>


One can use the autocomplete feature with fast search too. Simply replace the line /wiki/index.php with /wiki/search/form.php, and change "name" from "search" to "query":

<html>

<form action="/wiki/search/form.php" id="searchform" class="mw-search"> <input type="search" name="query" placeholder="Search in all HandWiki topics" title="Search [alt-shift-f]" accesskey="f" id="searchInput" autocomplete="on" >

<button id="searchGoButtonM" type="submit" value="Go" name="Go">Go</button> <button id="searchTextM" type="submit" value="Search" name="fulltext">Search</button>

</form>

</html>

Such searches are implemented in [Find terms].