Skip to content

Enable snippets in full text search results

Xunius edited this page Apr 21, 2019 · 1 revision

Install xapian

Full text searching is achieved using the xapian engine, which consists of 3 major parts (xapian-core, xapian-omega and xapian-bindings). All three are currently required at the moment, so you have to install them all. See their guides on how to install. Many mainstream Linux distributions have them in the software repository, so installing xapian shouldn't be any harder than installing any other software.

Enable snippets

To enable snippet generation a bit of hack is needed. You need to download the source code of xapian-omega, and add these lines in index_file.cc:

if (dump.empty()) {
    record = "dump=";
} else {
    record += "\ndump=";
    record += dump;
}

before the line

newdocument.set_data(record);

Then compile xapian-omega. If you have both the original and modified xapian-omega installed, make sure the modified one is the default one. You can verify this by running which omindex in the terminal. The output should point to the path of the omindex executable that you just compiled.

If you have a better solution that could work around these, please let me know.

Clone this wiki locally