mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2026-02-23 09:46:15 -05:00
Merge pull request #804 from kiwix/update_docs
Updated documentation of lang and category filters in catalog query API endpoints
This commit is contained in:
@@ -345,8 +345,22 @@ included in the response. Pagination is applied to the filtered list. The
|
||||
filtering criteria must be specified via the following URL parameters:
|
||||
|
||||
* ``lang`` - filter by language (specified as a 3-letter language code).
|
||||
Multiple languages can be provided as a comma-separated list. An entry will
|
||||
be considered to match this criterion if its language list intersects (in set
|
||||
theory sense) with the list of the filter.
|
||||
|
||||
.. note::
|
||||
|
||||
An entry may have multiple languages listed in its metadata. The ``lang``
|
||||
filter only allows to select entries by one of those languages. For
|
||||
example, ``lang=vol,epo`` selects entries that match *either* ``vol`` *or*
|
||||
``epo`` rather than entries that contain *both* ``vol`` and ``epo`` in
|
||||
their language list.
|
||||
|
||||
* ``category`` - filter by categories associated with the library entries.
|
||||
Multiple categories can be provided as a comma-separated list. An entry will
|
||||
be considered to match this criterion if its category matches *any* of the
|
||||
requested categories.
|
||||
|
||||
* ``tag`` - filter by tags associated with the library entries. Multiple tags
|
||||
can be provided as a semicolon separated list (e.g
|
||||
@@ -374,6 +388,13 @@ Examples:
|
||||
# return only results ## 100-149 (start=100&count=50)
|
||||
$ curl 'http://localhost:8080/catalog/v2/entries?lang=ita&start=100&count=50'
|
||||
|
||||
# List only books in Italian OR French. Return only the first 10 results.
|
||||
$ curl 'http://localhost:8080/catalog/v2/entries?lang=ita,fra'
|
||||
|
||||
# List only books with category of 'gutenberg' OR 'wikibooks'.
|
||||
# Return only the first 10 results.
|
||||
$ curl 'http://localhost:8080/catalog/v2/entries?category=gutenberg,wikibooks'
|
||||
|
||||
# List only books with category of 'wikipedia' AND containing the word
|
||||
# 'science' in the title or description. Return only the first 10 results.
|
||||
$ curl 'http://localhost:8080/catalog/v2/entries?q=science&category=wikipedia'
|
||||
|
||||
Reference in New Issue
Block a user