summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-07xapian: Introduce document-slot-ref-bytes.Bob131
* xapian/xapian.scm (document-slot-ref-bytes): New function. Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
2021-09-07xapian: Reimplement document-bytes.Bob131
The current implementation of document-bytes involves converting the document data string into a list of characters, mapping over the result with char->integer and passing the list of integers to u8-list->integer. This is quite an expensive operation (relative to what the user might expect), and may not reliably return a result if the document data couldn't be decoded as a UTF-8 string in the first place. Now that we have SWIG wrappers that return bytevectors directly, we can redefine document-bytes as an alias of Document-get-data-bytes. * xapian/xapian.scm (document-bytes): Redefine function in terms of Document-get-data-bytes. Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
2021-09-07Add SWIG wrappers for bytevector method variants.Bob131
Several Xapian methods use `std::string' to represent opaque binary blobs. SWIG treats these as UTF-8 strings and converts them to an SCM representation via `scm_from_utf8_string', which will throw an error if the input is not valid UTF-8. This commit updates the SWIG interface file to add wrappers taking or returning bytevectors instead of strings for Xapian methods dealing with document values and bodies. * xapian.i.in (SWIG_bytevector, typemap_in_SWIG_bytevector, typemap_out_SWIG_bytevector): Add machinery for defining bytevector-variant wrappers of existing methods taking or returning std::string. * (Xapian::ValueIterator::get_value_bytes, Xapian::Document::get_value_bytes, Xapian::Document::add_value_bytes, Xapian::Document::get_data_bytes, Xapian::Document::set_data_bytes, Xapian::Database::get_metadata_bytes, Xapian::WritableDatabase::set_metadata_bytes, Xapian::Query::Query): Add bytevector variants of methods. Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
2021-09-07Set up testing infrastructure.Arun Isaac
* tests/xapian.scm: New file. * build-aux/test-driver.scm.in: New file. * configure.ac: Configure build-aux/test-driver.scm. * .gitignore: Add build-aux/test-driver.scm, tests/*.log and tests/*.trs. * Makefile.am (EXTRA_DIST): Add TESTS. (TEST_EXTENSIONS, SCM_TESTS, TESTS, SCM_LOG_DRIVER): New variables.
2021-09-06xapian: Support in-memory databases.Arun Isaac
* xapian/xapian.scm (call-with-in-memory-database): New public function.
2021-09-06README: Remove unnecessary guile -s flag.Arun Isaac
* README.org (Usage): Remove unnecessary guile -s flag.
2021-09-02xapian: Fix spacing in association list.Arun Isaac
* examples/search.scm (search): Add a space after '.' in the prefixes association list.
2021-09-02Update copyright years.Arun Isaac
This is a follow-up to commits cb61a526c82153c09ed357901166a42b48ba9d3b and 12f12fbcb3cba4c634e10e7bf16a5c47d670f83b where the copyright year was not updated. * Makefile.am, build-aux/build-home-page.el, configure.ac, guix.scm: Add 2021 to copyright.
2021-09-02README: Add continuous integration badges.Arun Isaac
* README.org (ci-badge): New macro. Add continuous integration badges.
2021-09-02website: Add website.Arun Isaac
* website/style.css: New file. * build-aux/build-home-page.el: New file. * configure.ac: Look for emacs. * Makefile.am (EMACS_GEN, EMACS_GEN_, EMACS_GEN_0, EMACS_GEN_1): New variables. (website, website/index.html): New target. (CLEANFILES): Add website/index.html. * .gitignore: Add website/index.html.
2021-09-02Add guix.scm.Arun Isaac
* guix.scm: New file. * README.org (Usage): Update guix environment instructions.
2020-10-17xapian: Introduce document-bytes.Arun Isaac
* xapian/xapian.scm (document-bytes): New function.
2020-10-14xapian: Wrap MSet-snippet.Arun Isaac
* xapian/xapian.scm (get-flag, mset-snippet): New functions.
2020-10-14Use Guix's guile-xapian package for `guix environment`.Arun Isaac
* guix.scm: Delete file. * README.org (Usage): Update `guix environment` instructions.
2020-03-07xapian: Rename document-ref to document-slot-ref.v0.1.0Arun Isaac
* xapian/xapian.scm (document-ref): Rename to document-slot-ref.
2020-03-06xapian: Wrap document values.Arun Isaac
* xapian/xapian.scm (make-document): Support setting document values. (document-ref): New function.
2020-03-05xapian: Wrap Enquire-get-mset using keyword arguments.Arun Isaac
* xapian/xapian.scm (enquire-mset): Introduce offset and maximum-items keyword arguments. * examples/search.scm (search): Pass pagesize as keyword argument to enquire-mset. Remove argument offset.
2020-03-05xapian: Wrap Database-get-doccount.Arun Isaac
* xapian/xapian.scm (database-document-count): New function.
2020-02-26Add generated files to .gitignore.Arun Isaac
* .gitignore: Add xapian.i and xapian/wrap.scm.
2020-02-26Organize .gitignore.Arun Isaac
* .gitignore: Organize into sections with comments.
2020-02-26Load libguilexapian with absolute path or through a search path.Arun Isaac
* xapian.i: Rename to xapian.i.in. * xapian.i.in: Try loading libguilexapian with absolute path first. If it fails, then try searching using LD_LIBRARY_PATH and other mechanisms. * Makefile.am: Generate xapian.i from xapian.i.in.
2020-02-26Support guile 3.0.Arun Isaac
* configure.ac: Check for guile 3.0. If not found, check for guile 2.2.
2020-02-19Invoke GUILE_PKG to set GUILE_EFFECTIVE_VERSION.Arun Isaac
* configure.ac: Invoke GUILE_PKG.
2020-02-19Build xapian/xapian.scm after libguilexapian.la.Arun Isaac
* Makefile.am: Build xapian/xapian.scm only after libguilexapian.la.
2020-02-19Load libguilexapian without any specific path.Arun Isaac
* pre-inst-env.in (LD_LIBRARY_PATH): Set LD_LIBRARY_PATH. * xapian.i: Load libguilexapian without any specific path. Let it be found using LD_LIBRARY_PATH and other search mechanisms.
2020-02-18xapian: Remove generated scheme stub.Arun Isaac
xapian/wrap.scm is generated by swig. We need not commit it to the git repository. * xapian/wrap.scm: Delete file.
2020-02-18Rerun pkg-config to find xapian include flags for swig.Arun Isaac
* configure.ac: Rerun pkg-config to find xapian include flags for swig. Store result in SWIG_FLAGS. * Makefile.am: Use SWIG_CFLAGS.
2020-02-17README: Warn about unstable API.Arun Isaac
* README.org: Warn about unstable API.
2020-02-16examples: Add comments.Arun Isaac
* examples/index.scm, examples/search.scm: Add comments.
2020-02-15README: Explain the end goal of Scheme-friendly wrapping.Arun Isaac
* README.org: Explain the eventual complete wrapping of low level functions from (xapian wrap).
2020-02-15Add .gitignore.Arun Isaac
* .gitignore: New file.
2020-02-15Add Emacs directory local variables.Arun Isaac
* .dir-locals.el: New file.
2020-02-15Add bootstrap script.Arun Isaac
* bootstrap.sh: New file.
2020-02-15First commit.Arun Isaac