Even if we use the add_reader method to search into embedded full text
index, we need to specify the global `contentHumanReadableId` as it will
be used to generate "page links".
Add the jni method `getContentPart` to get only a part of the artcicle
content.
The method can be used to get a part of the content or to know the size
of the full content.
This is a major API break. User code will have to be rewritten.
Before this commit, API was a unique object wrapping the library and
handle a global state with one `Reader` and one `Writer` at the time.
Now, the API is axed around three main objects :
- The `JNIKiwixReader`, a wrapper around a `kiwix::Reader` (who allow to
read one zim)
- The `JNIKiwixSearcher`, a wrapper around a `kiwix::Searcher` (who allow
to search through one or more reader(s))
- The `JNIKiwixSearcher.Result` a result of a search. Allowing to get all
information about a result (title, url, content, snippet, ...)
This is a small quick and dirty API to do geo query.
It is not possible with this API to do a query search and a geo search.
It's either one or the other.
We should think about a better global API to do searching and provide
both of them in the same time (libzim does it).
70 is a too small limit for the number of results.
Users need at least 100.
As the html rendering will fails with more than 144 results,
explicitly limits the number of search to 140.
Fixeskiwix/kiwix-tools#92
Ctpp2 templates have a limit step number. If the template to render is
too big, the rendering fails, throwing an exception.
From our tests, it seems that, with the template we have, the default
step limit allow us to render 68 results only.
By doubling the limit, we can render up to 144 results.
ctpp2c is used to pre-compile the template resource.
However, on OSX, ctpp2c seems to be difficult to compile, as we don't need
ctpp2 at all on OSX/iOS, lets just stop to force the use of ctpp2c.
We always need a humanReadableName associated with a content to search in.
Do not separate the two values (human readable name and zim) in two
different functions.
This way, we avoid miss-use of the Searcher who could lead to segfault.
Add a `title` write argument to `getContent*` methods.
This argument is filled with the title of the content get.
Also update the JNI accordingly.
Related to kiwix/kiwix-android#214