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