[Xapian-discuss] Get term from document by position

john.alveris at Safe-mail.net john.alveris at Safe-mail.net
Sun Jul 26 18:34:32 BST 2015


> Can you file a bug with some example outputs that are unrelated to the search string?

Here is the example (see attachment).

This example does the following:
1)First, it indexes text from the "text.txt" file (see attachment) (actually, this is the text of the following book: "Abbas, Lichtman. Basic immunology").

2)Next, it searches for the "extracellular microbe" string and generates snippet. 

Xapian::Snipper generates the following snippet:

"к к  1 I * I I  Andre , Lichtma  SECOND  EDITION  B Q С If1  Immun logy  Functions and Disorders  of the Immune System  NOT FOR SALE   
                                                        C1q  В lymphocyte Antibody-secreting  (plasma) cell  Ant..."




My approach generates this snippet for the same search string (not included in the example):

"mechanisms of humoral immunity the elimination of <b>extracellular</b> <b>microbes</b> and toxins 143 9 immunologic tolerance ... for example antibodies function to eliminate <b>microbes</b> in extra <b>extracellular</b> fluids and activated t lymphocytes ... and are designed to provide defense against <b>extracellular</b> <b>microbes</b> and intracellular <b>microbes</b> respectively fig 1 ... "

Yes, this snippet misses punctuation and so on, but it allows user to understand why this particular book was found.

How to use the example: unpack the archive, cd to the test_snippet directory, build test.cpp. Run the built execuatable from the command line.


More information about the Xapian-discuss mailing list