Xapian on Android?

Olly Betts olly at survex.com
Sun Aug 30 21:57:04 BST 2020


On Thu, Aug 27, 2020 at 03:55:07PM +0000, Cliff Missen wrote:
> We can create the index on more powerful machines with any OS in our
> development lab, but need to provide the end users with tools to
> search that index on their devices.

Not specific to Android, but for this sort of use case you may find the
"single-file database" feature useful (the feature was sponsored by
https://endlessos.com/ who use it to allow shipping a single file
containing both data and a pre-built Xapian index of it).  The
single-file database is generated by compacting a database, and can't be
updated directly:

https://xapian.org/docs/apidoc/html/namespaceXapian.html#af230d8321f07e93dc62d57a6fcfe89fa

It can be embedded inside another file (you
can open it by providing a file descriptor positioned at the start of
the embedded single file database):

https://xapian.org/docs/apidoc/html/classXapian_1_1Database.html#aa882e42d12defaf578e68ac9a4fe36f0

Also, if you don't use any features which need the termlist table at
search time (the main one is being able to list matching terms) then you
could delete termlist.glass from the database directory before
compacting to a single file database to save space.

See Xapian::DB_NO_TERMLIST for details:

https://xapian.org/docs/apidoc/html/namespaceXapian.html#abeb301c332a66efdb695447666c53726

Cheers,
    Olly



More information about the Xapian-discuss mailing list