for details) which indicate how much the service <em>thinks</em> it
can address the "question" and how much it <em>thinks</em> it was able
to answer it. Given the wanted simplistic (non-scientific) nature of
services it is extremely important to consider the score very
carefully, and compare it with existing services when designing a new
service. Failing to do so might lead to hide more relevant answers
provided by other services with non-relevant information. </p>
<p> Services are designed to provide unobtrusive and useful
information to the user. To that end some measure are taken to cut
possible verbosity introduced by the services:
<ul>
<li>A maximum number of 2 (most relevant) services is displayed for each query. Defined in <code>websearch_services.CFG_WEBSEARCH_SERVICE_MAX_NB_SERVICE_DISPLAY</code>.</li>
<li>Service with a too low relevance (<21) are not displayed. Defined in <code>websearch_services.CFG_WEBSEARCH_SERVICE_MIN_RELEVANCE_TO_DISPLAY.</code></li>
<li>When the distance between the relevance of two services is too great (30), only the most relevant service out of the two is displayed. Defined in <code>websearch_services.CFG_WEBSEARCH_SERVICE_MIN_RELEVANCE_TO_DISPLAY.</code></li>
<li>When a service replies with too many answers, display only 4 answers of the services. More can be displayed when clicking "more".</li>
<li>Use a visually light theme.</li>
</ul>
See also the section <a href="#3.2">3.2 Good practices</a>.
</p>
<a name="2"></a><h2>2. Enable/Disable a search service</h2>
<p>In order to enable a service, drop its files into the following location: <br/>
<pre>
/opt/invenio/lib/python/invenio/search_services/
</pre>
</p>
<p>
To disable a service, remove the file from the above directory.
</p>
<a name="3"></a><h2>3. Build a custom search service</h2>
<p>Services use the Invenio <code>plugin_utils</code> infrastructure, and
are self-contained in single Pythonic files that comply with the
specifications defined in section <a href="#3.1">3.1 Search service
specifications/requirements</a>.</p>
<a name="3.1"></a><h2>3.1 Search service specifications/requirements</h2>
A search service is a Pythonic file stored
in <code>/opt/invenio/lib/python/invenio/search_services/</code>,
which name corresponds to a class defined in the file. <br/>
<p>In order to be valid, your service should inherit from the base
<code>SearchService</code> class and implement some functions (see
Section <a href="#3.1.1">3.1.1 Using SearchService base class</a>).
Other helper, more specialized classes exists to help you build
services that responds with links of links
(Section <a href="#3.1.2">3.1.2 Using ListLinksService class</a>) or
answer based on a BibKnowledge knowledge base (<a href="#3.1.3">3.1.3
Using KnowledgeBaseService class</a>)</p>
<a name="3.1.1"></a><h2>3.1.1 Using SearchService base class</h2>
<p>Start implementing your service by defining a class that inherits from
the <code>SearchService</code> base class. Choose a class name that
matches the name of your service file.
</p>
<p>
For eg. a spellchecker service could exist
in <code>/opt/invenio/lib/python/invenio/search_services/SpellCheckerService.py</code>,