Skip to content

Commit

Permalink
Documented the /search endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
veloman-yunkan committed Jan 4, 2023
1 parent 679e96d commit e580281
Showing 1 changed file with 62 additions and 1 deletion.
63 changes: 62 additions & 1 deletion docs/kiwix-serve.rst
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,68 @@ Returns the metadata item ``METADATAID`` from the ZIM file with :term:`name
``/search``
-----------

Blablabla
Performs a full text search on one or more ZIM files and returns an HTML page
with a list of links to matching pages along with snippets of the matching
portions of those pages.

.. _multi-zim-search-constraints:

A multi-ZIM search request must comply with the following constraints:

* the number of ZIM files participating in the search operation must not exceed
the limit imposed by the :option:`--searchLimit` option of ``kiwix-serve``.

* all of the ZIM files participating in the same search operation must be in
the same language.

**Parameters:**


ZIM file selection parameters:

At least one of the following parameters must be provided in order to
specify in which ZIM file(s) to search. Parameters appearing earlier in
below list take precedence over subsequent ones (the later ones, even if
present in the request, are simply ignored).

``content``: :term:`name <ZIM name>` of the ZIM file (for a single-ZIM
search). This is a legacy parameter. ``books.name`` should be used instead.

``books.id``: :term:`UUID <ZIM UUID>` of the ZIM file. Can be repeated for
a multi-ZIM search, however must respect the :ref:`multi-ZIM search
constraints <multi-zim-search-constraints>`.

``books.name``: :term:`name <ZIM name>` of the ZIM file. Can be repeated
for a multi-ZIM search, however must respect the :ref:`multi-ZIM search
constraints <multi-zim-search-constraints>`.

Query parameters:

``pattern`` (optional; defaults to an empty string): text to search for.

``latitude``, ``longitude`` & ``distance`` (optional): geospatial query
parameters. If all of these are provided, then the results will be
restricted to geotagged pages that are within ``distance`` metres from the
location on Earth with coordinates ``latitude`` and ``longitude``.

Pagination parameters:

``pageLength`` (optional, default: 25): maximum number of search results in
the response. Capped at 140.

``start`` (optional, default: 1): this parameter enables pagination of
results. The response will include up to ``pageLength`` results starting
with entry # ``start`` from the full list of search results (the first
result is assumed to have index 1).



``/search/searchdescription.xml``
---------------------------------

Describes the `/search`_ endpoint in `OpenSearch description format
<https://developer.mozilla.org/en-US/docs/Web/OpenSearch>`_.



``/skin``
Expand Down

0 comments on commit e580281

Please sign in to comment.