[Xapian-discuss] Get term from document by position
James Aylett
james-xapian at tartarus.org
Sun Jul 26 19:12:43 BST 2015
On 26 Jul 2015, at 18:34, john.alveris at Safe-mail.net wrote:
>> Can you file a bug with some example outputs that are unrelated to the search string?
>
> Here is the example (see attachment).
Attachments get stripped out by the mailing list, so I’ve made a private gist of the two files here: <https://gist.github.com/jaylett/ce8455b37e2b84422346>.
Actually, when I run it I get 0 matches, which would explain why you’re just getting the start of the document. However if I adjust things (match the stemming strategy for TermGenerator to that for QueryParser), it still gives me the opening rather than a useful snippet.
I don’t know much about the snippet code right now, but I’ll see if I can make it do what I expect on either your data or something else. Or it’s possible someone else will be able to chip in and suggest and approach.
> 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.
Yes, that’s nice, and AIUI certainly in the area of what you’re expected to be able to achieve with ::Snipper.
J
--
James Aylett, occasional trouble-maker
xapian.org
More information about the Xapian-discuss
mailing list