[Xapian-discuss] some sample perl code

Olly Betts olly at survex.com
Fri Feb 3 23:46:31 GMT 2006


On Sat, Jan 28, 2006 at 05:53:01PM -0800, Dan Carpenter wrote:
> I had a hard time finding sample perl code so I here is mine.  Instead
> of storing the real position it just stores the line number.

Hmm, there's some sample search code, but no sample indexing code it
seems.  I'll add a version of simpleindex to match C++ and the other
bindings.  Presumably you're happy for me to include your example too?

> One thing that puzzled me is I'm not sure about the error handling on
> set_data() and  add_posting().  Wouldn't they normally return 0 on
> failure so that you could say set_data() or warn "set_data() failed"?

I think there's no way set_data can fail while add_posting can only
fail if you try to give an empty termname, in which case an exception is
thrown.  Looking at the XS glue, that case doesn't seem to be handled
currently.

Cheers,
    Olly



More information about the Xapian-discuss mailing list