Skip Menu |

This queue is for tickets about the Lucene CPAN distribution.

Report information
The Basics
Id: 49817
Status: new
Priority: 0/
Queue: Lucene

People
Owner: Nobody in particular
Requestors: tomaz.solc [...] tablix.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.18
Fixed in: (no value)



Subject: Binding for getValues method of the Document object
Hi Lucene 0.18 module provides no way to retrieve multi-valued fields from Document objects. This patch adds a getValues(field) method to the Document object that returns a list of all values for the given field (or an empty list if the field is undefined)
Subject: lucene_getvalues_2.patch
Only in Lucene-0.18tomaz: Lucene.bs Only in Lucene-0.18tomaz: Lucene.c Only in Lucene-0.18tomaz: Lucene.o Only in Lucene-0.18tomaz: Makefile Only in Lucene-0.18tomaz: blib Only in Lucene-0.18tomaz: pm_to_blib diff -ru Lucene-0.18/xs/Document.xs Lucene-0.18tomaz/xs/Document.xs --- Lucene-0.18/xs/Document.xs 2007-09-26 14:16:04.000000000 +0200 +++ Lucene-0.18tomaz/xs/Document.xs 2009-09-17 20:33:15.000000000 +0200 @@ -22,6 +22,21 @@ OUTPUT: RETVAL +void +getValues(self, field) + Document* self + wchar_t* field + PPCODE: + wchar_t **src = self->getValues(field); + + if(src) { + for(; *src != NULL; ++src) { + SV* sv = sv_newmortal(); + WCharToSv(*src, sv); + XPUSHs(sv); + } + } + void removeField(self, field) Document* self