1# This file was automatically generated by SWIG (http://www.swig.org).
2# Version 3.0.13
3#
4# Do not make changes to this file unless you know what you are doing--modify
5# the SWIG interface file instead.
6
7package Xapian;
8use base qw(Exporter);
9use base qw(DynaLoader);
10package Xapianc;
11bootstrap Xapian;
12package Xapian;
13@EXPORT = qw();
14
15# ---------- BASE METHODS -------------
16
17package Xapian;
18
19sub TIEHASH {
20    my ($classname,$obj) = @_;
21    return bless $obj, $classname;
22}
23
24sub CLEAR { }
25
26sub FIRSTKEY { }
27
28sub NEXTKEY { }
29
30sub FETCH {
31    my ($self,$field) = @_;
32    my $member_func = "swig_${field}_get";
33    $self->$member_func();
34}
35
36sub STORE {
37    my ($self,$field,$newval) = @_;
38    my $member_func = "swig_${field}_set";
39    $self->$member_func($newval);
40}
41
42sub this {
43    my $ptr = shift;
44    return tied(%$ptr);
45}
46
47
48# ------- FUNCTION WRAPPERS --------
49
50package Xapian;
51
52*newN = *Xapianc::newN;
53*version_string = *Xapianc::version_string;
54*major_version = *Xapianc::major_version;
55*minor_version = *Xapianc::minor_version;
56*revision = *Xapianc::revision;
57*__eq__ = *Xapianc::__eq__;
58*__lt__ = *Xapianc::__lt__;
59*__gt__ = *Xapianc::__gt__;
60*__ge__ = *Xapianc::__ge__;
61*__le__ = *Xapianc::__le__;
62*__add__ = *Xapianc::__add__;
63*sortable_serialise = *Xapianc::sortable_serialise;
64*sortable_unserialise = *Xapianc::sortable_unserialise;
65*miles_to_metres = *Xapianc::miles_to_metres;
66*metres_to_miles = *Xapianc::metres_to_miles;
67*__ne__ = *Xapianc::__ne__;
68*remote_open = *Xapianc::remote_open;
69*remote_open_writable = *Xapianc::remote_open_writable;
70
71############# Class : Xapian::Error ##############
72
73package Xapian::Error;
74use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
75@ISA = qw( Xapian );
76%OWNER = ();
77%ITERATORS = ();
78*get_type = *Xapianc::Error_get_type;
79*get_msg = *Xapianc::Error_get_msg;
80*get_context = *Xapianc::Error_get_context;
81*get_error_string = *Xapianc::Error_get_error_string;
82*get_description = *Xapianc::Error_get_description;
83sub DESTROY {
84    return unless $_[0]->isa('HASH');
85    my $self = tied(%{$_[0]});
86    return unless defined $self;
87    delete $ITERATORS{$self};
88    if (exists $OWNER{$self}) {
89        Xapianc::delete_Error($self);
90        delete $OWNER{$self};
91    }
92}
93
94sub DISOWN {
95    my $self = shift;
96    my $ptr = tied(%$self);
97    delete $OWNER{$ptr};
98}
99
100sub ACQUIRE {
101    my $self = shift;
102    my $ptr = tied(%$self);
103    $OWNER{$ptr} = 1;
104}
105
106
107############# Class : Xapian::LogicError ##############
108
109package Xapian::LogicError;
110use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
111@ISA = qw( Xapian::Error Xapian );
112%OWNER = ();
113%ITERATORS = ();
114sub DESTROY {
115    return unless $_[0]->isa('HASH');
116    my $self = tied(%{$_[0]});
117    return unless defined $self;
118    delete $ITERATORS{$self};
119    if (exists $OWNER{$self}) {
120        Xapianc::delete_LogicError($self);
121        delete $OWNER{$self};
122    }
123}
124
125sub DISOWN {
126    my $self = shift;
127    my $ptr = tied(%$self);
128    delete $OWNER{$ptr};
129}
130
131sub ACQUIRE {
132    my $self = shift;
133    my $ptr = tied(%$self);
134    $OWNER{$ptr} = 1;
135}
136
137
138############# Class : Xapian::RuntimeError ##############
139
140package Xapian::RuntimeError;
141use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
142@ISA = qw( Xapian::Error Xapian );
143%OWNER = ();
144%ITERATORS = ();
145sub DESTROY {
146    return unless $_[0]->isa('HASH');
147    my $self = tied(%{$_[0]});
148    return unless defined $self;
149    delete $ITERATORS{$self};
150    if (exists $OWNER{$self}) {
151        Xapianc::delete_RuntimeError($self);
152        delete $OWNER{$self};
153    }
154}
155
156sub DISOWN {
157    my $self = shift;
158    my $ptr = tied(%$self);
159    delete $OWNER{$ptr};
160}
161
162sub ACQUIRE {
163    my $self = shift;
164    my $ptr = tied(%$self);
165    $OWNER{$ptr} = 1;
166}
167
168
169############# Class : Xapian::AssertionError ##############
170
171package Xapian::AssertionError;
172use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
173@ISA = qw( Xapian::LogicError Xapian );
174%OWNER = ();
175%ITERATORS = ();
176sub new {
177    my $pkg = shift;
178    my $self = Xapianc::new_AssertionError(@_);
179    bless $self, $pkg if defined($self);
180}
181
182sub DESTROY {
183    return unless $_[0]->isa('HASH');
184    my $self = tied(%{$_[0]});
185    return unless defined $self;
186    delete $ITERATORS{$self};
187    if (exists $OWNER{$self}) {
188        Xapianc::delete_AssertionError($self);
189        delete $OWNER{$self};
190    }
191}
192
193sub DISOWN {
194    my $self = shift;
195    my $ptr = tied(%$self);
196    delete $OWNER{$ptr};
197}
198
199sub ACQUIRE {
200    my $self = shift;
201    my $ptr = tied(%$self);
202    $OWNER{$ptr} = 1;
203}
204
205
206############# Class : Xapian::InvalidArgumentError ##############
207
208package Xapian::InvalidArgumentError;
209use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
210@ISA = qw( Xapian::LogicError Xapian );
211%OWNER = ();
212%ITERATORS = ();
213sub new {
214    my $pkg = shift;
215    my $self = Xapianc::new_InvalidArgumentError(@_);
216    bless $self, $pkg if defined($self);
217}
218
219sub DESTROY {
220    return unless $_[0]->isa('HASH');
221    my $self = tied(%{$_[0]});
222    return unless defined $self;
223    delete $ITERATORS{$self};
224    if (exists $OWNER{$self}) {
225        Xapianc::delete_InvalidArgumentError($self);
226        delete $OWNER{$self};
227    }
228}
229
230sub DISOWN {
231    my $self = shift;
232    my $ptr = tied(%$self);
233    delete $OWNER{$ptr};
234}
235
236sub ACQUIRE {
237    my $self = shift;
238    my $ptr = tied(%$self);
239    $OWNER{$ptr} = 1;
240}
241
242
243############# Class : Xapian::InvalidOperationError ##############
244
245package Xapian::InvalidOperationError;
246use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
247@ISA = qw( Xapian::LogicError Xapian );
248%OWNER = ();
249%ITERATORS = ();
250sub new {
251    my $pkg = shift;
252    my $self = Xapianc::new_InvalidOperationError(@_);
253    bless $self, $pkg if defined($self);
254}
255
256sub DESTROY {
257    return unless $_[0]->isa('HASH');
258    my $self = tied(%{$_[0]});
259    return unless defined $self;
260    delete $ITERATORS{$self};
261    if (exists $OWNER{$self}) {
262        Xapianc::delete_InvalidOperationError($self);
263        delete $OWNER{$self};
264    }
265}
266
267sub DISOWN {
268    my $self = shift;
269    my $ptr = tied(%$self);
270    delete $OWNER{$ptr};
271}
272
273sub ACQUIRE {
274    my $self = shift;
275    my $ptr = tied(%$self);
276    $OWNER{$ptr} = 1;
277}
278
279
280############# Class : Xapian::UnimplementedError ##############
281
282package Xapian::UnimplementedError;
283use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
284@ISA = qw( Xapian::LogicError Xapian );
285%OWNER = ();
286%ITERATORS = ();
287sub new {
288    my $pkg = shift;
289    my $self = Xapianc::new_UnimplementedError(@_);
290    bless $self, $pkg if defined($self);
291}
292
293sub DESTROY {
294    return unless $_[0]->isa('HASH');
295    my $self = tied(%{$_[0]});
296    return unless defined $self;
297    delete $ITERATORS{$self};
298    if (exists $OWNER{$self}) {
299        Xapianc::delete_UnimplementedError($self);
300        delete $OWNER{$self};
301    }
302}
303
304sub DISOWN {
305    my $self = shift;
306    my $ptr = tied(%$self);
307    delete $OWNER{$ptr};
308}
309
310sub ACQUIRE {
311    my $self = shift;
312    my $ptr = tied(%$self);
313    $OWNER{$ptr} = 1;
314}
315
316
317############# Class : Xapian::DatabaseError ##############
318
319package Xapian::DatabaseError;
320use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
321@ISA = qw( Xapian::RuntimeError Xapian );
322%OWNER = ();
323%ITERATORS = ();
324sub new {
325    my $pkg = shift;
326    my $self = Xapianc::new_DatabaseError(@_);
327    bless $self, $pkg if defined($self);
328}
329
330sub DESTROY {
331    return unless $_[0]->isa('HASH');
332    my $self = tied(%{$_[0]});
333    return unless defined $self;
334    delete $ITERATORS{$self};
335    if (exists $OWNER{$self}) {
336        Xapianc::delete_DatabaseError($self);
337        delete $OWNER{$self};
338    }
339}
340
341sub DISOWN {
342    my $self = shift;
343    my $ptr = tied(%$self);
344    delete $OWNER{$ptr};
345}
346
347sub ACQUIRE {
348    my $self = shift;
349    my $ptr = tied(%$self);
350    $OWNER{$ptr} = 1;
351}
352
353
354############# Class : Xapian::DatabaseCorruptError ##############
355
356package Xapian::DatabaseCorruptError;
357use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
358@ISA = qw( Xapian::DatabaseError Xapian );
359%OWNER = ();
360%ITERATORS = ();
361sub new {
362    my $pkg = shift;
363    my $self = Xapianc::new_DatabaseCorruptError(@_);
364    bless $self, $pkg if defined($self);
365}
366
367sub DESTROY {
368    return unless $_[0]->isa('HASH');
369    my $self = tied(%{$_[0]});
370    return unless defined $self;
371    delete $ITERATORS{$self};
372    if (exists $OWNER{$self}) {
373        Xapianc::delete_DatabaseCorruptError($self);
374        delete $OWNER{$self};
375    }
376}
377
378sub DISOWN {
379    my $self = shift;
380    my $ptr = tied(%$self);
381    delete $OWNER{$ptr};
382}
383
384sub ACQUIRE {
385    my $self = shift;
386    my $ptr = tied(%$self);
387    $OWNER{$ptr} = 1;
388}
389
390
391############# Class : Xapian::DatabaseCreateError ##############
392
393package Xapian::DatabaseCreateError;
394use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
395@ISA = qw( Xapian::DatabaseError Xapian );
396%OWNER = ();
397%ITERATORS = ();
398sub new {
399    my $pkg = shift;
400    my $self = Xapianc::new_DatabaseCreateError(@_);
401    bless $self, $pkg if defined($self);
402}
403
404sub DESTROY {
405    return unless $_[0]->isa('HASH');
406    my $self = tied(%{$_[0]});
407    return unless defined $self;
408    delete $ITERATORS{$self};
409    if (exists $OWNER{$self}) {
410        Xapianc::delete_DatabaseCreateError($self);
411        delete $OWNER{$self};
412    }
413}
414
415sub DISOWN {
416    my $self = shift;
417    my $ptr = tied(%$self);
418    delete $OWNER{$ptr};
419}
420
421sub ACQUIRE {
422    my $self = shift;
423    my $ptr = tied(%$self);
424    $OWNER{$ptr} = 1;
425}
426
427
428############# Class : Xapian::DatabaseLockError ##############
429
430package Xapian::DatabaseLockError;
431use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
432@ISA = qw( Xapian::DatabaseError Xapian );
433%OWNER = ();
434%ITERATORS = ();
435sub new {
436    my $pkg = shift;
437    my $self = Xapianc::new_DatabaseLockError(@_);
438    bless $self, $pkg if defined($self);
439}
440
441sub DESTROY {
442    return unless $_[0]->isa('HASH');
443    my $self = tied(%{$_[0]});
444    return unless defined $self;
445    delete $ITERATORS{$self};
446    if (exists $OWNER{$self}) {
447        Xapianc::delete_DatabaseLockError($self);
448        delete $OWNER{$self};
449    }
450}
451
452sub DISOWN {
453    my $self = shift;
454    my $ptr = tied(%$self);
455    delete $OWNER{$ptr};
456}
457
458sub ACQUIRE {
459    my $self = shift;
460    my $ptr = tied(%$self);
461    $OWNER{$ptr} = 1;
462}
463
464
465############# Class : Xapian::DatabaseModifiedError ##############
466
467package Xapian::DatabaseModifiedError;
468use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
469@ISA = qw( Xapian::DatabaseError Xapian );
470%OWNER = ();
471%ITERATORS = ();
472sub new {
473    my $pkg = shift;
474    my $self = Xapianc::new_DatabaseModifiedError(@_);
475    bless $self, $pkg if defined($self);
476}
477
478sub DESTROY {
479    return unless $_[0]->isa('HASH');
480    my $self = tied(%{$_[0]});
481    return unless defined $self;
482    delete $ITERATORS{$self};
483    if (exists $OWNER{$self}) {
484        Xapianc::delete_DatabaseModifiedError($self);
485        delete $OWNER{$self};
486    }
487}
488
489sub DISOWN {
490    my $self = shift;
491    my $ptr = tied(%$self);
492    delete $OWNER{$ptr};
493}
494
495sub ACQUIRE {
496    my $self = shift;
497    my $ptr = tied(%$self);
498    $OWNER{$ptr} = 1;
499}
500
501
502############# Class : Xapian::DatabaseOpeningError ##############
503
504package Xapian::DatabaseOpeningError;
505use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
506@ISA = qw( Xapian::DatabaseError Xapian );
507%OWNER = ();
508%ITERATORS = ();
509sub new {
510    my $pkg = shift;
511    my $self = Xapianc::new_DatabaseOpeningError(@_);
512    bless $self, $pkg if defined($self);
513}
514
515sub DESTROY {
516    return unless $_[0]->isa('HASH');
517    my $self = tied(%{$_[0]});
518    return unless defined $self;
519    delete $ITERATORS{$self};
520    if (exists $OWNER{$self}) {
521        Xapianc::delete_DatabaseOpeningError($self);
522        delete $OWNER{$self};
523    }
524}
525
526sub DISOWN {
527    my $self = shift;
528    my $ptr = tied(%$self);
529    delete $OWNER{$ptr};
530}
531
532sub ACQUIRE {
533    my $self = shift;
534    my $ptr = tied(%$self);
535    $OWNER{$ptr} = 1;
536}
537
538
539############# Class : Xapian::DatabaseVersionError ##############
540
541package Xapian::DatabaseVersionError;
542use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
543@ISA = qw( Xapian::DatabaseOpeningError Xapian );
544%OWNER = ();
545%ITERATORS = ();
546sub new {
547    my $pkg = shift;
548    my $self = Xapianc::new_DatabaseVersionError(@_);
549    bless $self, $pkg if defined($self);
550}
551
552sub DESTROY {
553    return unless $_[0]->isa('HASH');
554    my $self = tied(%{$_[0]});
555    return unless defined $self;
556    delete $ITERATORS{$self};
557    if (exists $OWNER{$self}) {
558        Xapianc::delete_DatabaseVersionError($self);
559        delete $OWNER{$self};
560    }
561}
562
563sub DISOWN {
564    my $self = shift;
565    my $ptr = tied(%$self);
566    delete $OWNER{$ptr};
567}
568
569sub ACQUIRE {
570    my $self = shift;
571    my $ptr = tied(%$self);
572    $OWNER{$ptr} = 1;
573}
574
575
576############# Class : Xapian::DocNotFoundError ##############
577
578package Xapian::DocNotFoundError;
579use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
580@ISA = qw( Xapian::RuntimeError Xapian );
581%OWNER = ();
582%ITERATORS = ();
583sub new {
584    my $pkg = shift;
585    my $self = Xapianc::new_DocNotFoundError(@_);
586    bless $self, $pkg if defined($self);
587}
588
589sub DESTROY {
590    return unless $_[0]->isa('HASH');
591    my $self = tied(%{$_[0]});
592    return unless defined $self;
593    delete $ITERATORS{$self};
594    if (exists $OWNER{$self}) {
595        Xapianc::delete_DocNotFoundError($self);
596        delete $OWNER{$self};
597    }
598}
599
600sub DISOWN {
601    my $self = shift;
602    my $ptr = tied(%$self);
603    delete $OWNER{$ptr};
604}
605
606sub ACQUIRE {
607    my $self = shift;
608    my $ptr = tied(%$self);
609    $OWNER{$ptr} = 1;
610}
611
612
613############# Class : Xapian::FeatureUnavailableError ##############
614
615package Xapian::FeatureUnavailableError;
616use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
617@ISA = qw( Xapian::RuntimeError Xapian );
618%OWNER = ();
619%ITERATORS = ();
620sub new {
621    my $pkg = shift;
622    my $self = Xapianc::new_FeatureUnavailableError(@_);
623    bless $self, $pkg if defined($self);
624}
625
626sub DESTROY {
627    return unless $_[0]->isa('HASH');
628    my $self = tied(%{$_[0]});
629    return unless defined $self;
630    delete $ITERATORS{$self};
631    if (exists $OWNER{$self}) {
632        Xapianc::delete_FeatureUnavailableError($self);
633        delete $OWNER{$self};
634    }
635}
636
637sub DISOWN {
638    my $self = shift;
639    my $ptr = tied(%$self);
640    delete $OWNER{$ptr};
641}
642
643sub ACQUIRE {
644    my $self = shift;
645    my $ptr = tied(%$self);
646    $OWNER{$ptr} = 1;
647}
648
649
650############# Class : Xapian::InternalError ##############
651
652package Xapian::InternalError;
653use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
654@ISA = qw( Xapian::RuntimeError Xapian );
655%OWNER = ();
656%ITERATORS = ();
657sub new {
658    my $pkg = shift;
659    my $self = Xapianc::new_InternalError(@_);
660    bless $self, $pkg if defined($self);
661}
662
663sub DESTROY {
664    return unless $_[0]->isa('HASH');
665    my $self = tied(%{$_[0]});
666    return unless defined $self;
667    delete $ITERATORS{$self};
668    if (exists $OWNER{$self}) {
669        Xapianc::delete_InternalError($self);
670        delete $OWNER{$self};
671    }
672}
673
674sub DISOWN {
675    my $self = shift;
676    my $ptr = tied(%$self);
677    delete $OWNER{$ptr};
678}
679
680sub ACQUIRE {
681    my $self = shift;
682    my $ptr = tied(%$self);
683    $OWNER{$ptr} = 1;
684}
685
686
687############# Class : Xapian::NetworkError ##############
688
689package Xapian::NetworkError;
690use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
691@ISA = qw( Xapian::RuntimeError Xapian );
692%OWNER = ();
693%ITERATORS = ();
694sub new {
695    my $pkg = shift;
696    my $self = Xapianc::new_NetworkError(@_);
697    bless $self, $pkg if defined($self);
698}
699
700sub DESTROY {
701    return unless $_[0]->isa('HASH');
702    my $self = tied(%{$_[0]});
703    return unless defined $self;
704    delete $ITERATORS{$self};
705    if (exists $OWNER{$self}) {
706        Xapianc::delete_NetworkError($self);
707        delete $OWNER{$self};
708    }
709}
710
711sub DISOWN {
712    my $self = shift;
713    my $ptr = tied(%$self);
714    delete $OWNER{$ptr};
715}
716
717sub ACQUIRE {
718    my $self = shift;
719    my $ptr = tied(%$self);
720    $OWNER{$ptr} = 1;
721}
722
723
724############# Class : Xapian::NetworkTimeoutError ##############
725
726package Xapian::NetworkTimeoutError;
727use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
728@ISA = qw( Xapian::NetworkError Xapian );
729%OWNER = ();
730%ITERATORS = ();
731sub new {
732    my $pkg = shift;
733    my $self = Xapianc::new_NetworkTimeoutError(@_);
734    bless $self, $pkg if defined($self);
735}
736
737sub DESTROY {
738    return unless $_[0]->isa('HASH');
739    my $self = tied(%{$_[0]});
740    return unless defined $self;
741    delete $ITERATORS{$self};
742    if (exists $OWNER{$self}) {
743        Xapianc::delete_NetworkTimeoutError($self);
744        delete $OWNER{$self};
745    }
746}
747
748sub DISOWN {
749    my $self = shift;
750    my $ptr = tied(%$self);
751    delete $OWNER{$ptr};
752}
753
754sub ACQUIRE {
755    my $self = shift;
756    my $ptr = tied(%$self);
757    $OWNER{$ptr} = 1;
758}
759
760
761############# Class : Xapian::QueryParserError ##############
762
763package Xapian::QueryParserError;
764use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
765@ISA = qw( Xapian::RuntimeError Xapian );
766%OWNER = ();
767%ITERATORS = ();
768sub new {
769    my $pkg = shift;
770    my $self = Xapianc::new_QueryParserError(@_);
771    bless $self, $pkg if defined($self);
772}
773
774sub DESTROY {
775    return unless $_[0]->isa('HASH');
776    my $self = tied(%{$_[0]});
777    return unless defined $self;
778    delete $ITERATORS{$self};
779    if (exists $OWNER{$self}) {
780        Xapianc::delete_QueryParserError($self);
781        delete $OWNER{$self};
782    }
783}
784
785sub DISOWN {
786    my $self = shift;
787    my $ptr = tied(%$self);
788    delete $OWNER{$ptr};
789}
790
791sub ACQUIRE {
792    my $self = shift;
793    my $ptr = tied(%$self);
794    $OWNER{$ptr} = 1;
795}
796
797
798############# Class : Xapian::SerialisationError ##############
799
800package Xapian::SerialisationError;
801use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
802@ISA = qw( Xapian::RuntimeError Xapian );
803%OWNER = ();
804%ITERATORS = ();
805sub new {
806    my $pkg = shift;
807    my $self = Xapianc::new_SerialisationError(@_);
808    bless $self, $pkg if defined($self);
809}
810
811sub DESTROY {
812    return unless $_[0]->isa('HASH');
813    my $self = tied(%{$_[0]});
814    return unless defined $self;
815    delete $ITERATORS{$self};
816    if (exists $OWNER{$self}) {
817        Xapianc::delete_SerialisationError($self);
818        delete $OWNER{$self};
819    }
820}
821
822sub DISOWN {
823    my $self = shift;
824    my $ptr = tied(%$self);
825    delete $OWNER{$ptr};
826}
827
828sub ACQUIRE {
829    my $self = shift;
830    my $ptr = tied(%$self);
831    $OWNER{$ptr} = 1;
832}
833
834
835############# Class : Xapian::RangeError ##############
836
837package Xapian::RangeError;
838use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
839@ISA = qw( Xapian::RuntimeError Xapian );
840%OWNER = ();
841%ITERATORS = ();
842sub new {
843    my $pkg = shift;
844    my $self = Xapianc::new_RangeError(@_);
845    bless $self, $pkg if defined($self);
846}
847
848sub DESTROY {
849    return unless $_[0]->isa('HASH');
850    my $self = tied(%{$_[0]});
851    return unless defined $self;
852    delete $ITERATORS{$self};
853    if (exists $OWNER{$self}) {
854        Xapianc::delete_RangeError($self);
855        delete $OWNER{$self};
856    }
857}
858
859sub DISOWN {
860    my $self = shift;
861    my $ptr = tied(%$self);
862    delete $OWNER{$ptr};
863}
864
865sub ACQUIRE {
866    my $self = shift;
867    my $ptr = tied(%$self);
868    $OWNER{$ptr} = 1;
869}
870
871
872############# Class : Xapian::WildcardError ##############
873
874package Xapian::WildcardError;
875use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
876@ISA = qw( Xapian::RuntimeError Xapian );
877%OWNER = ();
878%ITERATORS = ();
879sub new {
880    my $pkg = shift;
881    my $self = Xapianc::new_WildcardError(@_);
882    bless $self, $pkg if defined($self);
883}
884
885sub DESTROY {
886    return unless $_[0]->isa('HASH');
887    my $self = tied(%{$_[0]});
888    return unless defined $self;
889    delete $ITERATORS{$self};
890    if (exists $OWNER{$self}) {
891        Xapianc::delete_WildcardError($self);
892        delete $OWNER{$self};
893    }
894}
895
896sub DISOWN {
897    my $self = shift;
898    my $ptr = tied(%$self);
899    delete $OWNER{$ptr};
900}
901
902sub ACQUIRE {
903    my $self = shift;
904    my $ptr = tied(%$self);
905    $OWNER{$ptr} = 1;
906}
907
908
909############# Class : Xapian::DatabaseNotFoundError ##############
910
911package Xapian::DatabaseNotFoundError;
912use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
913@ISA = qw( Xapian::DatabaseOpeningError Xapian );
914%OWNER = ();
915%ITERATORS = ();
916sub new {
917    my $pkg = shift;
918    my $self = Xapianc::new_DatabaseNotFoundError(@_);
919    bless $self, $pkg if defined($self);
920}
921
922sub DESTROY {
923    return unless $_[0]->isa('HASH');
924    my $self = tied(%{$_[0]});
925    return unless defined $self;
926    delete $ITERATORS{$self};
927    if (exists $OWNER{$self}) {
928        Xapianc::delete_DatabaseNotFoundError($self);
929        delete $OWNER{$self};
930    }
931}
932
933sub DISOWN {
934    my $self = shift;
935    my $ptr = tied(%$self);
936    delete $OWNER{$ptr};
937}
938
939sub ACQUIRE {
940    my $self = shift;
941    my $ptr = tied(%$self);
942    $OWNER{$ptr} = 1;
943}
944
945
946############# Class : Xapian::DatabaseClosedError ##############
947
948package Xapian::DatabaseClosedError;
949use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
950@ISA = qw( Xapian::DatabaseError Xapian );
951%OWNER = ();
952%ITERATORS = ();
953sub new {
954    my $pkg = shift;
955    my $self = Xapianc::new_DatabaseClosedError(@_);
956    bless $self, $pkg if defined($self);
957}
958
959sub DESTROY {
960    return unless $_[0]->isa('HASH');
961    my $self = tied(%{$_[0]});
962    return unless defined $self;
963    delete $ITERATORS{$self};
964    if (exists $OWNER{$self}) {
965        Xapianc::delete_DatabaseClosedError($self);
966        delete $OWNER{$self};
967    }
968}
969
970sub DISOWN {
971    my $self = shift;
972    my $ptr = tied(%$self);
973    delete $OWNER{$ptr};
974}
975
976sub ACQUIRE {
977    my $self = shift;
978    my $ptr = tied(%$self);
979    $OWNER{$ptr} = 1;
980}
981
982
983############# Class : Xapian::PositionIterator ##############
984
985package Xapian::PositionIterator;
986use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
987@ISA = qw( Xapian );
988%OWNER = ();
989%ITERATORS = ();
990sub new {
991    my $pkg = shift;
992    my $self = Xapianc::new_PositionIterator(@_);
993    bless $self, $pkg if defined($self);
994}
995
996sub DESTROY {
997    return unless $_[0]->isa('HASH');
998    my $self = tied(%{$_[0]});
999    return unless defined $self;
1000    delete $ITERATORS{$self};
1001    if (exists $OWNER{$self}) {
1002        Xapianc::delete_PositionIterator($self);
1003        delete $OWNER{$self};
1004    }
1005}
1006
1007*skip_to = *Xapianc::PositionIterator_skip_to;
1008*get_description = *Xapianc::PositionIterator_get_description;
1009*equal = *Xapianc::PositionIterator_equal;
1010*nequal = *Xapianc::PositionIterator_nequal;
1011*get_termpos = *Xapianc::PositionIterator_get_termpos;
1012*inc = *Xapianc::PositionIterator_inc;
1013sub DISOWN {
1014    my $self = shift;
1015    my $ptr = tied(%$self);
1016    delete $OWNER{$ptr};
1017}
1018
1019sub ACQUIRE {
1020    my $self = shift;
1021    my $ptr = tied(%$self);
1022    $OWNER{$ptr} = 1;
1023}
1024
1025
1026############# Class : Xapian::PostingIterator ##############
1027
1028package Xapian::PostingIterator;
1029use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1030@ISA = qw( Xapian );
1031%OWNER = ();
1032%ITERATORS = ();
1033sub new {
1034    my $pkg = shift;
1035    my $self = Xapianc::new_PostingIterator(@_);
1036    bless $self, $pkg if defined($self);
1037}
1038
1039sub DESTROY {
1040    return unless $_[0]->isa('HASH');
1041    my $self = tied(%{$_[0]});
1042    return unless defined $self;
1043    delete $ITERATORS{$self};
1044    if (exists $OWNER{$self}) {
1045        Xapianc::delete_PostingIterator($self);
1046        delete $OWNER{$self};
1047    }
1048}
1049
1050*get_wdf = *Xapianc::PostingIterator_get_wdf;
1051*get_doclength = *Xapianc::PostingIterator_get_doclength;
1052*get_unique_terms = *Xapianc::PostingIterator_get_unique_terms;
1053*positionlist_begin = *Xapianc::PostingIterator_positionlist_begin;
1054*positionlist_end = *Xapianc::PostingIterator_positionlist_end;
1055*skip_to = *Xapianc::PostingIterator_skip_to;
1056*get_description = *Xapianc::PostingIterator_get_description;
1057*equal = *Xapianc::PostingIterator_equal;
1058*nequal = *Xapianc::PostingIterator_nequal;
1059*get_docid = *Xapianc::PostingIterator_get_docid;
1060*inc = *Xapianc::PostingIterator_inc;
1061sub DISOWN {
1062    my $self = shift;
1063    my $ptr = tied(%$self);
1064    delete $OWNER{$ptr};
1065}
1066
1067sub ACQUIRE {
1068    my $self = shift;
1069    my $ptr = tied(%$self);
1070    $OWNER{$ptr} = 1;
1071}
1072
1073
1074############# Class : Xapian::TermIterator ##############
1075
1076package Xapian::TermIterator;
1077use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1078@ISA = qw( Xapian );
1079%OWNER = ();
1080%ITERATORS = ();
1081sub new {
1082    my $pkg = shift;
1083    my $self = Xapianc::new_TermIterator(@_);
1084    bless $self, $pkg if defined($self);
1085}
1086
1087sub DESTROY {
1088    return unless $_[0]->isa('HASH');
1089    my $self = tied(%{$_[0]});
1090    return unless defined $self;
1091    delete $ITERATORS{$self};
1092    if (exists $OWNER{$self}) {
1093        Xapianc::delete_TermIterator($self);
1094        delete $OWNER{$self};
1095    }
1096}
1097
1098*get_wdf = *Xapianc::TermIterator_get_wdf;
1099*get_termfreq = *Xapianc::TermIterator_get_termfreq;
1100*positionlist_count = *Xapianc::TermIterator_positionlist_count;
1101*positionlist_begin = *Xapianc::TermIterator_positionlist_begin;
1102*positionlist_end = *Xapianc::TermIterator_positionlist_end;
1103*skip_to = *Xapianc::TermIterator_skip_to;
1104*get_description = *Xapianc::TermIterator_get_description;
1105*equal = *Xapianc::TermIterator_equal;
1106*nequal = *Xapianc::TermIterator_nequal;
1107*get_termname = *Xapianc::TermIterator_get_termname;
1108*inc = *Xapianc::TermIterator_inc;
1109sub DISOWN {
1110    my $self = shift;
1111    my $ptr = tied(%$self);
1112    delete $OWNER{$ptr};
1113}
1114
1115sub ACQUIRE {
1116    my $self = shift;
1117    my $ptr = tied(%$self);
1118    $OWNER{$ptr} = 1;
1119}
1120
1121
1122############# Class : Xapian::ValueIterator ##############
1123
1124package Xapian::ValueIterator;
1125use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1126@ISA = qw( Xapian );
1127%OWNER = ();
1128%ITERATORS = ();
1129sub new {
1130    my $pkg = shift;
1131    my $self = Xapianc::new_ValueIterator(@_);
1132    bless $self, $pkg if defined($self);
1133}
1134
1135sub DESTROY {
1136    return unless $_[0]->isa('HASH');
1137    my $self = tied(%{$_[0]});
1138    return unless defined $self;
1139    delete $ITERATORS{$self};
1140    if (exists $OWNER{$self}) {
1141        Xapianc::delete_ValueIterator($self);
1142        delete $OWNER{$self};
1143    }
1144}
1145
1146*get_docid = *Xapianc::ValueIterator_get_docid;
1147*get_valueno = *Xapianc::ValueIterator_get_valueno;
1148*skip_to = *Xapianc::ValueIterator_skip_to;
1149*check = *Xapianc::ValueIterator_check;
1150*get_description = *Xapianc::ValueIterator_get_description;
1151*equal = *Xapianc::ValueIterator_equal;
1152*nequal = *Xapianc::ValueIterator_nequal;
1153*get_value = *Xapianc::ValueIterator_get_value;
1154*inc = *Xapianc::ValueIterator_inc;
1155sub DISOWN {
1156    my $self = shift;
1157    my $ptr = tied(%$self);
1158    delete $OWNER{$ptr};
1159}
1160
1161sub ACQUIRE {
1162    my $self = shift;
1163    my $ptr = tied(%$self);
1164    $OWNER{$ptr} = 1;
1165}
1166
1167
1168############# Class : Xapian::Document ##############
1169
1170package Xapian::Document;
1171use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1172@ISA = qw( Xapian );
1173%OWNER = ();
1174%ITERATORS = ();
1175sub new {
1176    my $pkg = shift;
1177    my $self = Xapianc::new_Document(@_);
1178    bless $self, $pkg if defined($self);
1179}
1180
1181sub DESTROY {
1182    return unless $_[0]->isa('HASH');
1183    my $self = tied(%{$_[0]});
1184    return unless defined $self;
1185    delete $ITERATORS{$self};
1186    if (exists $OWNER{$self}) {
1187        Xapianc::delete_Document($self);
1188        delete $OWNER{$self};
1189    }
1190}
1191
1192*get_value = *Xapianc::Document_get_value;
1193*add_value = *Xapianc::Document_add_value;
1194*remove_value = *Xapianc::Document_remove_value;
1195*clear_values = *Xapianc::Document_clear_values;
1196*get_data = *Xapianc::Document_get_data;
1197*set_data = *Xapianc::Document_set_data;
1198*add_posting = *Xapianc::Document_add_posting;
1199*add_term = *Xapianc::Document_add_term;
1200*add_boolean_term = *Xapianc::Document_add_boolean_term;
1201*remove_posting = *Xapianc::Document_remove_posting;
1202*remove_postings = *Xapianc::Document_remove_postings;
1203*remove_term = *Xapianc::Document_remove_term;
1204*clear_terms = *Xapianc::Document_clear_terms;
1205*termlist_count = *Xapianc::Document_termlist_count;
1206*termlist_begin = *Xapianc::Document_termlist_begin;
1207*termlist_end = *Xapianc::Document_termlist_end;
1208*values_count = *Xapianc::Document_values_count;
1209*values_begin = *Xapianc::Document_values_begin;
1210*values_end = *Xapianc::Document_values_end;
1211*get_docid = *Xapianc::Document_get_docid;
1212*serialise = *Xapianc::Document_serialise;
1213*unserialise = *Xapianc::Document_unserialise;
1214*get_description = *Xapianc::Document_get_description;
1215sub DISOWN {
1216    my $self = shift;
1217    my $ptr = tied(%$self);
1218    delete $OWNER{$ptr};
1219}
1220
1221sub ACQUIRE {
1222    my $self = shift;
1223    my $ptr = tied(%$self);
1224    $OWNER{$ptr} = 1;
1225}
1226
1227
1228############# Class : Xapian::Registry ##############
1229
1230package Xapian::Registry;
1231use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1232@ISA = qw( Xapian );
1233%OWNER = ();
1234%ITERATORS = ();
1235sub new {
1236    my $pkg = shift;
1237    my $self = Xapianc::new_Registry(@_);
1238    bless $self, $pkg if defined($self);
1239}
1240
1241sub DESTROY {
1242    return unless $_[0]->isa('HASH');
1243    my $self = tied(%{$_[0]});
1244    return unless defined $self;
1245    delete $ITERATORS{$self};
1246    if (exists $OWNER{$self}) {
1247        Xapianc::delete_Registry($self);
1248        delete $OWNER{$self};
1249    }
1250}
1251
1252*register_weighting_scheme = *Xapianc::Registry_register_weighting_scheme;
1253*get_weighting_scheme = *Xapianc::Registry_get_weighting_scheme;
1254*register_posting_source = *Xapianc::Registry_register_posting_source;
1255*get_posting_source = *Xapianc::Registry_get_posting_source;
1256*register_match_spy = *Xapianc::Registry_register_match_spy;
1257*get_match_spy = *Xapianc::Registry_get_match_spy;
1258*register_lat_long_metric = *Xapianc::Registry_register_lat_long_metric;
1259*get_lat_long_metric = *Xapianc::Registry_get_lat_long_metric;
1260sub DISOWN {
1261    my $self = shift;
1262    my $ptr = tied(%$self);
1263    delete $OWNER{$ptr};
1264}
1265
1266sub ACQUIRE {
1267    my $self = shift;
1268    my $ptr = tied(%$self);
1269    $OWNER{$ptr} = 1;
1270}
1271
1272
1273############# Class : Xapian::Query ##############
1274
1275package Xapian::Query;
1276use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1277@ISA = qw( Xapian );
1278%OWNER = ();
1279%ITERATORS = ();
1280*OP_AND = *Xapianc::Query_OP_AND;
1281*OP_OR = *Xapianc::Query_OP_OR;
1282*OP_AND_NOT = *Xapianc::Query_OP_AND_NOT;
1283*OP_XOR = *Xapianc::Query_OP_XOR;
1284*OP_AND_MAYBE = *Xapianc::Query_OP_AND_MAYBE;
1285*OP_FILTER = *Xapianc::Query_OP_FILTER;
1286*OP_NEAR = *Xapianc::Query_OP_NEAR;
1287*OP_PHRASE = *Xapianc::Query_OP_PHRASE;
1288*OP_VALUE_RANGE = *Xapianc::Query_OP_VALUE_RANGE;
1289*OP_SCALE_WEIGHT = *Xapianc::Query_OP_SCALE_WEIGHT;
1290*OP_ELITE_SET = *Xapianc::Query_OP_ELITE_SET;
1291*OP_VALUE_GE = *Xapianc::Query_OP_VALUE_GE;
1292*OP_VALUE_LE = *Xapianc::Query_OP_VALUE_LE;
1293*OP_SYNONYM = *Xapianc::Query_OP_SYNONYM;
1294*OP_MAX = *Xapianc::Query_OP_MAX;
1295*OP_WILDCARD = *Xapianc::Query_OP_WILDCARD;
1296*OP_INVALID = *Xapianc::Query_OP_INVALID;
1297*WILDCARD_LIMIT_ERROR = *Xapianc::Query_WILDCARD_LIMIT_ERROR;
1298*WILDCARD_LIMIT_FIRST = *Xapianc::Query_WILDCARD_LIMIT_FIRST;
1299*WILDCARD_LIMIT_MOST_FREQUENT = *Xapianc::Query_WILDCARD_LIMIT_MOST_FREQUENT;
1300sub DESTROY {
1301    return unless $_[0]->isa('HASH');
1302    my $self = tied(%{$_[0]});
1303    return unless defined $self;
1304    delete $ITERATORS{$self};
1305    if (exists $OWNER{$self}) {
1306        Xapianc::delete_Query($self);
1307        delete $OWNER{$self};
1308    }
1309}
1310
1311*get_terms_begin = *Xapianc::Query_get_terms_begin;
1312*get_terms_end = *Xapianc::Query_get_terms_end;
1313*get_unique_terms_begin = *Xapianc::Query_get_unique_terms_begin;
1314*get_unique_terms_end = *Xapianc::Query_get_unique_terms_end;
1315*get_length = *Xapianc::Query_get_length;
1316*empty = *Xapianc::Query_empty;
1317*serialise = *Xapianc::Query_serialise;
1318*unserialise = *Xapianc::Query_unserialise;
1319*get_type = *Xapianc::Query_get_type;
1320*get_num_subqueries = *Xapianc::Query_get_num_subqueries;
1321*get_subquery = *Xapianc::Query_get_subquery;
1322*get_description = *Xapianc::Query_get_description;
1323sub new {
1324  my $class = shift;
1325  my $query;
1326
1327  if( @_ <= 1 ) {
1328    $query = Xapianc::new_Query(@_);
1329  } else {
1330    use Carp;
1331    my $op = $_[0];
1332    if( $op !~ /^\d+$/ ) {
1333	Carp::croak( "USAGE: $class->new('term') or $class->new(OP, <args>)" );
1334    }
1335    if( $op == 8 ) { # FIXME: 8 is OP_VALUE_RANGE; eliminate hardcoded literal
1336      if( @_ != 4 ) {
1337	Carp::croak( "USAGE: $class->new(OP_VALUE_RANGE, VALNO, START, END)" );
1338      }
1339      $query = Xapianc::new_Query( @_ );
1340    } elsif( $op == 9 ) { # FIXME: OP_SCALE_WEIGHT
1341      if( @_ != 3 ) {
1342	Carp::croak( "USAGE: $class->new(OP_SCALE_WEIGHT, QUERY, FACTOR)" );
1343      }
1344      $query = Xapianc::new_Query( @_ );
1345    } elsif( $op == 11 || $op == 12 ) { # FIXME: OP_VALUE_GE, OP_VALUE_LE; eliminate hardcoded literals
1346      if( @_ != 3 ) {
1347	Carp::croak( "USAGE: $class->new(OP_VALUE_[GL]E, VALNO, LIMIT)" );
1348      }
1349      $query = Xapianc::new_Query( @_ );
1350    } else {
1351      shift @_;
1352      $query = Xapian::newN( $op, \@_ );
1353    }
1354  }
1355  return $query;
1356}
1357
1358sub DISOWN {
1359    my $self = shift;
1360    my $ptr = tied(%$self);
1361    delete $OWNER{$ptr};
1362}
1363
1364sub ACQUIRE {
1365    my $self = shift;
1366    my $ptr = tied(%$self);
1367    $OWNER{$ptr} = 1;
1368}
1369
1370
1371############# Class : Xapian::Stem ##############
1372
1373package Xapian::Stem;
1374use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1375@ISA = qw( Xapian );
1376%OWNER = ();
1377%ITERATORS = ();
1378sub new {
1379    my $pkg = shift;
1380    my $self = Xapianc::new_Stem(@_);
1381    bless $self, $pkg if defined($self);
1382}
1383
1384sub DESTROY {
1385    return unless $_[0]->isa('HASH');
1386    my $self = tied(%{$_[0]});
1387    return unless defined $self;
1388    delete $ITERATORS{$self};
1389    if (exists $OWNER{$self}) {
1390        Xapianc::delete_Stem($self);
1391        delete $OWNER{$self};
1392    }
1393}
1394
1395*__call__ = *Xapianc::Stem___call__;
1396*is_none = *Xapianc::Stem_is_none;
1397*get_description = *Xapianc::Stem_get_description;
1398*get_available_languages = *Xapianc::Stem_get_available_languages;
1399*stem_word = *Xapianc::Stem_stem_word;
1400sub DISOWN {
1401    my $self = shift;
1402    my $ptr = tied(%$self);
1403    delete $OWNER{$ptr};
1404}
1405
1406sub ACQUIRE {
1407    my $self = shift;
1408    my $ptr = tied(%$self);
1409    $OWNER{$ptr} = 1;
1410}
1411
1412
1413############# Class : Xapian::TermGenerator ##############
1414
1415package Xapian::TermGenerator;
1416use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1417@ISA = qw( Xapian );
1418%OWNER = ();
1419%ITERATORS = ();
1420sub new {
1421    my $pkg = shift;
1422    my $self = Xapianc::new_TermGenerator(@_);
1423    bless $self, $pkg if defined($self);
1424}
1425
1426sub DESTROY {
1427    return unless $_[0]->isa('HASH');
1428    my $self = tied(%{$_[0]});
1429    return unless defined $self;
1430    delete $ITERATORS{$self};
1431    if (exists $OWNER{$self}) {
1432        Xapianc::delete_TermGenerator($self);
1433        delete $OWNER{$self};
1434    }
1435}
1436
1437*set_stemmer = *Xapianc::TermGenerator_set_stemmer;
1438*set_stopper = *Xapianc::TermGenerator_set_stopper;
1439*set_document = *Xapianc::TermGenerator_set_document;
1440*get_document = *Xapianc::TermGenerator_get_document;
1441*set_database = *Xapianc::TermGenerator_set_database;
1442*FLAG_SPELLING = *Xapianc::TermGenerator_FLAG_SPELLING;
1443*FLAG_CJK_NGRAM = *Xapianc::TermGenerator_FLAG_CJK_NGRAM;
1444*STEM_NONE = *Xapianc::TermGenerator_STEM_NONE;
1445*STEM_SOME = *Xapianc::TermGenerator_STEM_SOME;
1446*STEM_ALL = *Xapianc::TermGenerator_STEM_ALL;
1447*STEM_ALL_Z = *Xapianc::TermGenerator_STEM_ALL_Z;
1448*STEM_SOME_FULL_POS = *Xapianc::TermGenerator_STEM_SOME_FULL_POS;
1449*STOP_NONE = *Xapianc::TermGenerator_STOP_NONE;
1450*STOP_ALL = *Xapianc::TermGenerator_STOP_ALL;
1451*STOP_STEMMED = *Xapianc::TermGenerator_STOP_STEMMED;
1452*set_flags = *Xapianc::TermGenerator_set_flags;
1453*set_stemming_strategy = *Xapianc::TermGenerator_set_stemming_strategy;
1454*set_stopper_strategy = *Xapianc::TermGenerator_set_stopper_strategy;
1455*set_max_word_length = *Xapianc::TermGenerator_set_max_word_length;
1456*index_text = *Xapianc::TermGenerator_index_text;
1457*index_text_without_positions = *Xapianc::TermGenerator_index_text_without_positions;
1458*increase_termpos = *Xapianc::TermGenerator_increase_termpos;
1459*get_termpos = *Xapianc::TermGenerator_get_termpos;
1460*set_termpos = *Xapianc::TermGenerator_set_termpos;
1461*get_description = *Xapianc::TermGenerator_get_description;
1462sub DISOWN {
1463    my $self = shift;
1464    my $ptr = tied(%$self);
1465    delete $OWNER{$ptr};
1466}
1467
1468sub ACQUIRE {
1469    my $self = shift;
1470    my $ptr = tied(%$self);
1471    $OWNER{$ptr} = 1;
1472}
1473
1474
1475############# Class : Xapian::MSet ##############
1476
1477package Xapian::MSet;
1478use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1479@ISA = qw( Xapian );
1480%OWNER = ();
1481%ITERATORS = ();
1482sub new {
1483    my $pkg = shift;
1484    my $self = Xapianc::new_MSet(@_);
1485    bless $self, $pkg if defined($self);
1486}
1487
1488sub DESTROY {
1489    return unless $_[0]->isa('HASH');
1490    my $self = tied(%{$_[0]});
1491    return unless defined $self;
1492    delete $ITERATORS{$self};
1493    if (exists $OWNER{$self}) {
1494        Xapianc::delete_MSet($self);
1495        delete $OWNER{$self};
1496    }
1497}
1498
1499*convert_to_percent = *Xapianc::MSet_convert_to_percent;
1500*get_termfreq = *Xapianc::MSet_get_termfreq;
1501*get_termweight = *Xapianc::MSet_get_termweight;
1502*get_firstitem = *Xapianc::MSet_get_firstitem;
1503*get_matches_lower_bound = *Xapianc::MSet_get_matches_lower_bound;
1504*get_matches_estimated = *Xapianc::MSet_get_matches_estimated;
1505*get_matches_upper_bound = *Xapianc::MSet_get_matches_upper_bound;
1506*get_uncollapsed_matches_lower_bound = *Xapianc::MSet_get_uncollapsed_matches_lower_bound;
1507*get_uncollapsed_matches_estimated = *Xapianc::MSet_get_uncollapsed_matches_estimated;
1508*get_uncollapsed_matches_upper_bound = *Xapianc::MSet_get_uncollapsed_matches_upper_bound;
1509*get_max_attained = *Xapianc::MSet_get_max_attained;
1510*get_max_possible = *Xapianc::MSet_get_max_possible;
1511*SNIPPET_BACKGROUND_MODEL = *Xapianc::MSet_SNIPPET_BACKGROUND_MODEL;
1512*SNIPPET_EXHAUSTIVE = *Xapianc::MSet_SNIPPET_EXHAUSTIVE;
1513*SNIPPET_EMPTY_WITHOUT_MATCH = *Xapianc::MSet_SNIPPET_EMPTY_WITHOUT_MATCH;
1514*SNIPPET_CJK_NGRAM = *Xapianc::MSet_SNIPPET_CJK_NGRAM;
1515*snippet = *Xapianc::MSet_snippet;
1516*fetch = *Xapianc::MSet_fetch;
1517*size = *Xapianc::MSet_size;
1518*empty = *Xapianc::MSet_empty;
1519*begin = *Xapianc::MSet_begin;
1520*end = *Xapianc::MSet_end;
1521*back = *Xapianc::MSet_back;
1522*get_description = *Xapianc::MSet_get_description;
1523*FETCH = *Xapianc::MSet_FETCH;
1524*get_docid = *Xapianc::MSet_get_docid;
1525*get_document = *Xapianc::MSet_get_document;
1526*get_hit = *Xapianc::MSet_get_hit;
1527*get_document_percentage = *Xapianc::MSet_get_document_percentage;
1528sub DISOWN {
1529    my $self = shift;
1530    my $ptr = tied(%$self);
1531    delete $OWNER{$ptr};
1532}
1533
1534sub ACQUIRE {
1535    my $self = shift;
1536    my $ptr = tied(%$self);
1537    $OWNER{$ptr} = 1;
1538}
1539
1540
1541############# Class : Xapian::MSetIterator ##############
1542
1543package Xapian::MSetIterator;
1544use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1545@ISA = qw( Xapian );
1546%OWNER = ();
1547%ITERATORS = ();
1548*swig_mset_get = *Xapianc::MSetIterator_mset_get;
1549*swig_mset_set = *Xapianc::MSetIterator_mset_set;
1550*swig_off_from_end_get = *Xapianc::MSetIterator_off_from_end_get;
1551*swig_off_from_end_set = *Xapianc::MSetIterator_off_from_end_set;
1552sub new {
1553    my $pkg = shift;
1554    my $self = Xapianc::new_MSetIterator(@_);
1555    bless $self, $pkg if defined($self);
1556}
1557
1558*get_rank = *Xapianc::MSetIterator_get_rank;
1559*get_document = *Xapianc::MSetIterator_get_document;
1560*get_weight = *Xapianc::MSetIterator_get_weight;
1561*get_collapse_key = *Xapianc::MSetIterator_get_collapse_key;
1562*get_collapse_count = *Xapianc::MSetIterator_get_collapse_count;
1563*get_sort_key = *Xapianc::MSetIterator_get_sort_key;
1564*get_percent = *Xapianc::MSetIterator_get_percent;
1565*get_description = *Xapianc::MSetIterator_get_description;
1566*equal = *Xapianc::MSetIterator_equal;
1567*nequal = *Xapianc::MSetIterator_nequal;
1568*get_docid = *Xapianc::MSetIterator_get_docid;
1569*inc = *Xapianc::MSetIterator_inc;
1570*dec = *Xapianc::MSetIterator_dec;
1571sub DESTROY {
1572    return unless $_[0]->isa('HASH');
1573    my $self = tied(%{$_[0]});
1574    return unless defined $self;
1575    delete $ITERATORS{$self};
1576    if (exists $OWNER{$self}) {
1577        Xapianc::delete_MSetIterator($self);
1578        delete $OWNER{$self};
1579    }
1580}
1581
1582sub DISOWN {
1583    my $self = shift;
1584    my $ptr = tied(%$self);
1585    delete $OWNER{$ptr};
1586}
1587
1588sub ACQUIRE {
1589    my $self = shift;
1590    my $ptr = tied(%$self);
1591    $OWNER{$ptr} = 1;
1592}
1593
1594
1595############# Class : Xapian::ESet ##############
1596
1597package Xapian::ESet;
1598use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1599@ISA = qw( Xapian );
1600%OWNER = ();
1601%ITERATORS = ();
1602sub new {
1603    my $pkg = shift;
1604    my $self = Xapianc::new_ESet(@_);
1605    bless $self, $pkg if defined($self);
1606}
1607
1608sub DESTROY {
1609    return unless $_[0]->isa('HASH');
1610    my $self = tied(%{$_[0]});
1611    return unless defined $self;
1612    delete $ITERATORS{$self};
1613    if (exists $OWNER{$self}) {
1614        Xapianc::delete_ESet($self);
1615        delete $OWNER{$self};
1616    }
1617}
1618
1619*size = *Xapianc::ESet_size;
1620*empty = *Xapianc::ESet_empty;
1621*get_ebound = *Xapianc::ESet_get_ebound;
1622*begin = *Xapianc::ESet_begin;
1623*end = *Xapianc::ESet_end;
1624*back = *Xapianc::ESet_back;
1625*get_description = *Xapianc::ESet_get_description;
1626*FETCH = *Xapianc::ESet_FETCH;
1627sub DISOWN {
1628    my $self = shift;
1629    my $ptr = tied(%$self);
1630    delete $OWNER{$ptr};
1631}
1632
1633sub ACQUIRE {
1634    my $self = shift;
1635    my $ptr = tied(%$self);
1636    $OWNER{$ptr} = 1;
1637}
1638
1639
1640############# Class : Xapian::ESetIterator ##############
1641
1642package Xapian::ESetIterator;
1643use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1644@ISA = qw( Xapian );
1645%OWNER = ();
1646%ITERATORS = ();
1647*swig_eset_get = *Xapianc::ESetIterator_eset_get;
1648*swig_eset_set = *Xapianc::ESetIterator_eset_set;
1649*swig_off_from_end_get = *Xapianc::ESetIterator_off_from_end_get;
1650*swig_off_from_end_set = *Xapianc::ESetIterator_off_from_end_set;
1651sub new {
1652    my $pkg = shift;
1653    my $self = Xapianc::new_ESetIterator(@_);
1654    bless $self, $pkg if defined($self);
1655}
1656
1657*get_weight = *Xapianc::ESetIterator_get_weight;
1658*get_description = *Xapianc::ESetIterator_get_description;
1659*get_termname = *Xapianc::ESetIterator_get_termname;
1660*equal = *Xapianc::ESetIterator_equal;
1661*nequal = *Xapianc::ESetIterator_nequal;
1662*get_term = *Xapianc::ESetIterator_get_term;
1663*inc = *Xapianc::ESetIterator_inc;
1664*dec = *Xapianc::ESetIterator_dec;
1665sub DESTROY {
1666    return unless $_[0]->isa('HASH');
1667    my $self = tied(%{$_[0]});
1668    return unless defined $self;
1669    delete $ITERATORS{$self};
1670    if (exists $OWNER{$self}) {
1671        Xapianc::delete_ESetIterator($self);
1672        delete $OWNER{$self};
1673    }
1674}
1675
1676sub DISOWN {
1677    my $self = shift;
1678    my $ptr = tied(%$self);
1679    delete $OWNER{$ptr};
1680}
1681
1682sub ACQUIRE {
1683    my $self = shift;
1684    my $ptr = tied(%$self);
1685    $OWNER{$ptr} = 1;
1686}
1687
1688
1689############# Class : Xapian::RSet ##############
1690
1691package Xapian::RSet;
1692use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1693@ISA = qw( Xapian );
1694%OWNER = ();
1695%ITERATORS = ();
1696sub new {
1697    my $pkg = shift;
1698    my $self = Xapianc::new_RSet(@_);
1699    bless $self, $pkg if defined($self);
1700}
1701
1702sub DESTROY {
1703    return unless $_[0]->isa('HASH');
1704    my $self = tied(%{$_[0]});
1705    return unless defined $self;
1706    delete $ITERATORS{$self};
1707    if (exists $OWNER{$self}) {
1708        Xapianc::delete_RSet($self);
1709        delete $OWNER{$self};
1710    }
1711}
1712
1713*size = *Xapianc::RSet_size;
1714*empty = *Xapianc::RSet_empty;
1715*add_document = *Xapianc::RSet_add_document;
1716*remove_document = *Xapianc::RSet_remove_document;
1717*contains = *Xapianc::RSet_contains;
1718*get_description = *Xapianc::RSet_get_description;
1719sub DISOWN {
1720    my $self = shift;
1721    my $ptr = tied(%$self);
1722    delete $OWNER{$ptr};
1723}
1724
1725sub ACQUIRE {
1726    my $self = shift;
1727    my $ptr = tied(%$self);
1728    $OWNER{$ptr} = 1;
1729}
1730
1731
1732############# Class : Xapian::MatchDecider ##############
1733
1734package Xapian::MatchDecider;
1735use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1736@ISA = qw( Xapian );
1737%OWNER = ();
1738%ITERATORS = ();
1739*__call__ = *Xapianc::MatchDecider___call__;
1740sub DESTROY {
1741    return unless $_[0]->isa('HASH');
1742    my $self = tied(%{$_[0]});
1743    return unless defined $self;
1744    delete $ITERATORS{$self};
1745    if (exists $OWNER{$self}) {
1746        Xapianc::delete_MatchDecider($self);
1747        delete $OWNER{$self};
1748    }
1749}
1750
1751sub DISOWN {
1752    my $self = shift;
1753    my $ptr = tied(%$self);
1754    delete $OWNER{$ptr};
1755}
1756
1757sub ACQUIRE {
1758    my $self = shift;
1759    my $ptr = tied(%$self);
1760    $OWNER{$ptr} = 1;
1761}
1762
1763
1764############# Class : Xapian::Enquire ##############
1765
1766package Xapian::Enquire;
1767use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1768@ISA = qw( Xapian );
1769%OWNER = ();
1770%ITERATORS = ();
1771sub new {
1772    my $pkg = shift;
1773    my $self = Xapianc::new_Enquire(@_);
1774    bless $self, $pkg if defined($self);
1775}
1776
1777sub DESTROY {
1778    return unless $_[0]->isa('HASH');
1779    my $self = tied(%{$_[0]});
1780    return unless defined $self;
1781    delete $ITERATORS{$self};
1782    if (exists $OWNER{$self}) {
1783        Xapianc::delete_Enquire($self);
1784        delete $OWNER{$self};
1785    }
1786}
1787
1788sub set_query {
1789  if (ref($_[1]) ne 'Xapian::Query') {
1790    push @_, Xapian::Query->new(splice @_, 1);
1791  }
1792  Xapianc::Enquire_set_query(@_);
1793}
1794
1795*get_query = *Xapianc::Enquire_get_query;
1796*add_matchspy = *Xapianc::Enquire_add_matchspy;
1797*clear_matchspies = *Xapianc::Enquire_clear_matchspies;
1798*set_weighting_scheme = *Xapianc::Enquire_set_weighting_scheme;
1799*set_expansion_scheme = *Xapianc::Enquire_set_expansion_scheme;
1800*set_collapse_key = *Xapianc::Enquire_set_collapse_key;
1801*ASCENDING = *Xapianc::Enquire_ASCENDING;
1802*DESCENDING = *Xapianc::Enquire_DESCENDING;
1803*DONT_CARE = *Xapianc::Enquire_DONT_CARE;
1804*set_docid_order = *Xapianc::Enquire_set_docid_order;
1805*set_cutoff = *Xapianc::Enquire_set_cutoff;
1806*set_sort_by_relevance = *Xapianc::Enquire_set_sort_by_relevance;
1807*set_sort_by_value = *Xapianc::Enquire_set_sort_by_value;
1808sub set_sort_by_key {
1809    my $self = $_[0];
1810    my $sorter = $_[1];
1811    $self{_sorter} = $sorter;
1812    Xapianc::Enquire_set_sort_by_key( @_ );
1813}
1814
1815*set_sort_by_value_then_relevance = *Xapianc::Enquire_set_sort_by_value_then_relevance;
1816sub set_sort_by_key_then_relevance {
1817    my $self = $_[0];
1818    my $sorter = $_[1];
1819    $self{_sorter} = $sorter;
1820    Xapianc::Enquire_set_sort_by_key_then_relevance( @_ );
1821}
1822
1823*set_sort_by_relevance_then_value = *Xapianc::Enquire_set_sort_by_relevance_then_value;
1824sub set_sort_by_relevance_then_key {
1825    my $self = $_[0];
1826    my $sorter = $_[1];
1827    $self{_sorter} = $sorter;
1828    Xapianc::Enquire_set_sort_by_relevance_then_key( @_ );
1829}
1830
1831*set_time_limit = *Xapianc::Enquire_set_time_limit;
1832*INCLUDE_QUERY_TERMS = *Xapianc::Enquire_INCLUDE_QUERY_TERMS;
1833*INCLUDE_QUERY_TERMS = *Xapianc::Enquire_INCLUDE_QUERY_TERMS;
1834*USE_EXACT_TERMFREQ = *Xapianc::Enquire_USE_EXACT_TERMFREQ;
1835*USE_EXACT_TERMFREQ = *Xapianc::Enquire_USE_EXACT_TERMFREQ;
1836*get_eset = *Xapianc::Enquire_get_eset;
1837*get_matching_terms_begin = *Xapianc::Enquire_get_matching_terms_begin;
1838*get_matching_terms_end = *Xapianc::Enquire_get_matching_terms_end;
1839*get_description = *Xapianc::Enquire_get_description;
1840sub get_mset {
1841  my $self = $_[0];
1842  my $nargs = scalar(@_);
1843  if( $nargs == 4 ) {
1844    my $type = ref( $_[2] );
1845    if ( $type eq 'Xapian::RSet' ) {
1846      # get_mset(first, max, rset)
1847      splice @_, 2, 0, (0); # insert checkatleast
1848    }
1849  }
1850  return Xapianc::Enquire_get_mset( @_ );
1851}
1852
1853sub DISOWN {
1854    my $self = shift;
1855    my $ptr = tied(%$self);
1856    delete $OWNER{$ptr};
1857}
1858
1859sub ACQUIRE {
1860    my $self = shift;
1861    my $ptr = tied(%$self);
1862    $OWNER{$ptr} = 1;
1863}
1864
1865
1866############# Class : Xapian::ExpandDecider ##############
1867
1868package Xapian::ExpandDecider;
1869use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1870@ISA = qw( Xapian );
1871%OWNER = ();
1872%ITERATORS = ();
1873*__call__ = *Xapianc::ExpandDecider___call__;
1874sub DESTROY {
1875    return unless $_[0]->isa('HASH');
1876    my $self = tied(%{$_[0]});
1877    return unless defined $self;
1878    delete $ITERATORS{$self};
1879    if (exists $OWNER{$self}) {
1880        Xapianc::delete_ExpandDecider($self);
1881        delete $OWNER{$self};
1882    }
1883}
1884
1885*release = *Xapianc::ExpandDecider_release;
1886sub DISOWN {
1887    my $self = shift;
1888    my $ptr = tied(%$self);
1889    delete $OWNER{$ptr};
1890}
1891
1892sub ACQUIRE {
1893    my $self = shift;
1894    my $ptr = tied(%$self);
1895    $OWNER{$ptr} = 1;
1896}
1897
1898
1899############# Class : Xapian::ExpandDeciderAnd ##############
1900
1901package Xapian::ExpandDeciderAnd;
1902use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1903@ISA = qw( Xapian::ExpandDecider Xapian );
1904%OWNER = ();
1905%ITERATORS = ();
1906sub new {
1907    my $pkg = shift;
1908    my $self = Xapianc::new_ExpandDeciderAnd(@_);
1909    bless $self, $pkg if defined($self);
1910}
1911
1912*__call__ = *Xapianc::ExpandDeciderAnd___call__;
1913sub DESTROY {
1914    return unless $_[0]->isa('HASH');
1915    my $self = tied(%{$_[0]});
1916    return unless defined $self;
1917    delete $ITERATORS{$self};
1918    if (exists $OWNER{$self}) {
1919        Xapianc::delete_ExpandDeciderAnd($self);
1920        delete $OWNER{$self};
1921    }
1922}
1923
1924sub DISOWN {
1925    my $self = shift;
1926    my $ptr = tied(%$self);
1927    delete $OWNER{$ptr};
1928}
1929
1930sub ACQUIRE {
1931    my $self = shift;
1932    my $ptr = tied(%$self);
1933    $OWNER{$ptr} = 1;
1934}
1935
1936
1937############# Class : Xapian::ExpandDeciderFilterPrefix ##############
1938
1939package Xapian::ExpandDeciderFilterPrefix;
1940use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1941@ISA = qw( Xapian::ExpandDecider Xapian );
1942%OWNER = ();
1943%ITERATORS = ();
1944sub new {
1945    my $pkg = shift;
1946    my $self = Xapianc::new_ExpandDeciderFilterPrefix(@_);
1947    bless $self, $pkg if defined($self);
1948}
1949
1950*__call__ = *Xapianc::ExpandDeciderFilterPrefix___call__;
1951sub DESTROY {
1952    return unless $_[0]->isa('HASH');
1953    my $self = tied(%{$_[0]});
1954    return unless defined $self;
1955    delete $ITERATORS{$self};
1956    if (exists $OWNER{$self}) {
1957        Xapianc::delete_ExpandDeciderFilterPrefix($self);
1958        delete $OWNER{$self};
1959    }
1960}
1961
1962sub DISOWN {
1963    my $self = shift;
1964    my $ptr = tied(%$self);
1965    delete $OWNER{$ptr};
1966}
1967
1968sub ACQUIRE {
1969    my $self = shift;
1970    my $ptr = tied(%$self);
1971    $OWNER{$ptr} = 1;
1972}
1973
1974
1975############# Class : Xapian::KeyMaker ##############
1976
1977package Xapian::KeyMaker;
1978use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
1979@ISA = qw( Xapian );
1980%OWNER = ();
1981%ITERATORS = ();
1982*__call__ = *Xapianc::KeyMaker___call__;
1983sub DESTROY {
1984    return unless $_[0]->isa('HASH');
1985    my $self = tied(%{$_[0]});
1986    return unless defined $self;
1987    delete $ITERATORS{$self};
1988    if (exists $OWNER{$self}) {
1989        Xapianc::delete_KeyMaker($self);
1990        delete $OWNER{$self};
1991    }
1992}
1993
1994*release = *Xapianc::KeyMaker_release;
1995sub DISOWN {
1996    my $self = shift;
1997    my $ptr = tied(%$self);
1998    delete $OWNER{$ptr};
1999}
2000
2001sub ACQUIRE {
2002    my $self = shift;
2003    my $ptr = tied(%$self);
2004    $OWNER{$ptr} = 1;
2005}
2006
2007
2008############# Class : Xapian::MultiValueKeyMaker ##############
2009
2010package Xapian::MultiValueKeyMaker;
2011use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2012@ISA = qw( Xapian::KeyMaker Xapian );
2013%OWNER = ();
2014%ITERATORS = ();
2015sub new {
2016    my $pkg = shift;
2017    my $self = Xapianc::new_MultiValueKeyMaker(@_);
2018    bless $self, $pkg if defined($self);
2019}
2020
2021*__call__ = *Xapianc::MultiValueKeyMaker___call__;
2022*add_value = *Xapianc::MultiValueKeyMaker_add_value;
2023sub DESTROY {
2024    return unless $_[0]->isa('HASH');
2025    my $self = tied(%{$_[0]});
2026    return unless defined $self;
2027    delete $ITERATORS{$self};
2028    if (exists $OWNER{$self}) {
2029        Xapianc::delete_MultiValueKeyMaker($self);
2030        delete $OWNER{$self};
2031    }
2032}
2033
2034sub DISOWN {
2035    my $self = shift;
2036    my $ptr = tied(%$self);
2037    delete $OWNER{$ptr};
2038}
2039
2040sub ACQUIRE {
2041    my $self = shift;
2042    my $ptr = tied(%$self);
2043    $OWNER{$ptr} = 1;
2044}
2045
2046
2047############# Class : Xapian::Stopper ##############
2048
2049package Xapian::Stopper;
2050use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2051@ISA = qw( Xapian );
2052%OWNER = ();
2053%ITERATORS = ();
2054*__call__ = *Xapianc::Stopper___call__;
2055sub DESTROY {
2056    return unless $_[0]->isa('HASH');
2057    my $self = tied(%{$_[0]});
2058    return unless defined $self;
2059    delete $ITERATORS{$self};
2060    if (exists $OWNER{$self}) {
2061        Xapianc::delete_Stopper($self);
2062        delete $OWNER{$self};
2063    }
2064}
2065
2066*get_description = *Xapianc::Stopper_get_description;
2067*release = *Xapianc::Stopper_release;
2068sub DISOWN {
2069    my $self = shift;
2070    my $ptr = tied(%$self);
2071    delete $OWNER{$ptr};
2072}
2073
2074sub ACQUIRE {
2075    my $self = shift;
2076    my $ptr = tied(%$self);
2077    $OWNER{$ptr} = 1;
2078}
2079
2080
2081############# Class : Xapian::SimpleStopper ##############
2082
2083package Xapian::SimpleStopper;
2084use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2085@ISA = qw( Xapian::Stopper Xapian );
2086%OWNER = ();
2087%ITERATORS = ();
2088*add = *Xapianc::SimpleStopper_add;
2089*__call__ = *Xapianc::SimpleStopper___call__;
2090*get_description = *Xapianc::SimpleStopper_get_description;
2091*stop_word = *Xapianc::SimpleStopper_stop_word;
2092sub new {
2093    my $class = shift;
2094    my $stopper = Xapianc::new_SimpleStopper();
2095
2096    bless $stopper, $class;
2097    foreach (@_) {
2098	$stopper->add($_);
2099    }
2100
2101    return $stopper;
2102}
2103
2104sub DESTROY {
2105    return unless $_[0]->isa('HASH');
2106    my $self = tied(%{$_[0]});
2107    return unless defined $self;
2108    delete $ITERATORS{$self};
2109    if (exists $OWNER{$self}) {
2110        Xapianc::delete_SimpleStopper($self);
2111        delete $OWNER{$self};
2112    }
2113}
2114
2115sub DISOWN {
2116    my $self = shift;
2117    my $ptr = tied(%$self);
2118    delete $OWNER{$ptr};
2119}
2120
2121sub ACQUIRE {
2122    my $self = shift;
2123    my $ptr = tied(%$self);
2124    $OWNER{$ptr} = 1;
2125}
2126
2127
2128############# Class : Xapian::RangeProcessor ##############
2129
2130package Xapian::RangeProcessor;
2131use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2132@ISA = qw( Xapian );
2133%OWNER = ();
2134%ITERATORS = ();
2135sub new {
2136    my $pkg = shift;
2137    my $self = Xapianc::new_RangeProcessor(@_);
2138    bless $self, $pkg if defined($self);
2139}
2140
2141sub DESTROY {
2142    return unless $_[0]->isa('HASH');
2143    my $self = tied(%{$_[0]});
2144    return unless defined $self;
2145    delete $ITERATORS{$self};
2146    if (exists $OWNER{$self}) {
2147        Xapianc::delete_RangeProcessor($self);
2148        delete $OWNER{$self};
2149    }
2150}
2151
2152*check_range = *Xapianc::RangeProcessor_check_range;
2153*__call__ = *Xapianc::RangeProcessor___call__;
2154*release = *Xapianc::RangeProcessor_release;
2155sub DISOWN {
2156    my $self = shift;
2157    my $ptr = tied(%$self);
2158    delete $OWNER{$ptr};
2159}
2160
2161sub ACQUIRE {
2162    my $self = shift;
2163    my $ptr = tied(%$self);
2164    $OWNER{$ptr} = 1;
2165}
2166
2167
2168############# Class : Xapian::DateRangeProcessor ##############
2169
2170package Xapian::DateRangeProcessor;
2171use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2172@ISA = qw( Xapian::RangeProcessor Xapian );
2173%OWNER = ();
2174%ITERATORS = ();
2175sub new {
2176    my $pkg = shift;
2177    my $self = Xapianc::new_DateRangeProcessor(@_);
2178    bless $self, $pkg if defined($self);
2179}
2180
2181*__call__ = *Xapianc::DateRangeProcessor___call__;
2182sub DESTROY {
2183    return unless $_[0]->isa('HASH');
2184    my $self = tied(%{$_[0]});
2185    return unless defined $self;
2186    delete $ITERATORS{$self};
2187    if (exists $OWNER{$self}) {
2188        Xapianc::delete_DateRangeProcessor($self);
2189        delete $OWNER{$self};
2190    }
2191}
2192
2193sub DISOWN {
2194    my $self = shift;
2195    my $ptr = tied(%$self);
2196    delete $OWNER{$ptr};
2197}
2198
2199sub ACQUIRE {
2200    my $self = shift;
2201    my $ptr = tied(%$self);
2202    $OWNER{$ptr} = 1;
2203}
2204
2205
2206############# Class : Xapian::NumberRangeProcessor ##############
2207
2208package Xapian::NumberRangeProcessor;
2209use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2210@ISA = qw( Xapian::RangeProcessor Xapian );
2211%OWNER = ();
2212%ITERATORS = ();
2213sub new {
2214    my $pkg = shift;
2215    my $self = Xapianc::new_NumberRangeProcessor(@_);
2216    bless $self, $pkg if defined($self);
2217}
2218
2219*__call__ = *Xapianc::NumberRangeProcessor___call__;
2220sub DESTROY {
2221    return unless $_[0]->isa('HASH');
2222    my $self = tied(%{$_[0]});
2223    return unless defined $self;
2224    delete $ITERATORS{$self};
2225    if (exists $OWNER{$self}) {
2226        Xapianc::delete_NumberRangeProcessor($self);
2227        delete $OWNER{$self};
2228    }
2229}
2230
2231sub DISOWN {
2232    my $self = shift;
2233    my $ptr = tied(%$self);
2234    delete $OWNER{$ptr};
2235}
2236
2237sub ACQUIRE {
2238    my $self = shift;
2239    my $ptr = tied(%$self);
2240    $OWNER{$ptr} = 1;
2241}
2242
2243
2244############# Class : Xapian::ValueRangeProcessor ##############
2245
2246package Xapian::ValueRangeProcessor;
2247use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2248@ISA = qw( Xapian );
2249%OWNER = ();
2250%ITERATORS = ();
2251sub DESTROY {
2252    return unless $_[0]->isa('HASH');
2253    my $self = tied(%{$_[0]});
2254    return unless defined $self;
2255    delete $ITERATORS{$self};
2256    if (exists $OWNER{$self}) {
2257        Xapianc::delete_ValueRangeProcessor($self);
2258        delete $OWNER{$self};
2259    }
2260}
2261
2262*__call__ = *Xapianc::ValueRangeProcessor___call__;
2263*release = *Xapianc::ValueRangeProcessor_release;
2264sub DISOWN {
2265    my $self = shift;
2266    my $ptr = tied(%$self);
2267    delete $OWNER{$ptr};
2268}
2269
2270sub ACQUIRE {
2271    my $self = shift;
2272    my $ptr = tied(%$self);
2273    $OWNER{$ptr} = 1;
2274}
2275
2276
2277############# Class : Xapian::StringValueRangeProcessor ##############
2278
2279package Xapian::StringValueRangeProcessor;
2280use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2281@ISA = qw( Xapian::ValueRangeProcessor Xapian );
2282%OWNER = ();
2283%ITERATORS = ();
2284sub new {
2285    my $pkg = shift;
2286    my $self = Xapianc::new_StringValueRangeProcessor(@_);
2287    bless $self, $pkg if defined($self);
2288}
2289
2290*__call__ = *Xapianc::StringValueRangeProcessor___call__;
2291sub DESTROY {
2292    return unless $_[0]->isa('HASH');
2293    my $self = tied(%{$_[0]});
2294    return unless defined $self;
2295    delete $ITERATORS{$self};
2296    if (exists $OWNER{$self}) {
2297        Xapianc::delete_StringValueRangeProcessor($self);
2298        delete $OWNER{$self};
2299    }
2300}
2301
2302sub DISOWN {
2303    my $self = shift;
2304    my $ptr = tied(%$self);
2305    delete $OWNER{$ptr};
2306}
2307
2308sub ACQUIRE {
2309    my $self = shift;
2310    my $ptr = tied(%$self);
2311    $OWNER{$ptr} = 1;
2312}
2313
2314
2315############# Class : Xapian::DateValueRangeProcessor ##############
2316
2317package Xapian::DateValueRangeProcessor;
2318use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2319@ISA = qw( Xapian::StringValueRangeProcessor Xapian );
2320%OWNER = ();
2321%ITERATORS = ();
2322sub new {
2323    my $pkg = shift;
2324    my $self = Xapianc::new_DateValueRangeProcessor(@_);
2325    bless $self, $pkg if defined($self);
2326}
2327
2328*__call__ = *Xapianc::DateValueRangeProcessor___call__;
2329sub DESTROY {
2330    return unless $_[0]->isa('HASH');
2331    my $self = tied(%{$_[0]});
2332    return unless defined $self;
2333    delete $ITERATORS{$self};
2334    if (exists $OWNER{$self}) {
2335        Xapianc::delete_DateValueRangeProcessor($self);
2336        delete $OWNER{$self};
2337    }
2338}
2339
2340sub DISOWN {
2341    my $self = shift;
2342    my $ptr = tied(%$self);
2343    delete $OWNER{$ptr};
2344}
2345
2346sub ACQUIRE {
2347    my $self = shift;
2348    my $ptr = tied(%$self);
2349    $OWNER{$ptr} = 1;
2350}
2351
2352
2353############# Class : Xapian::NumberValueRangeProcessor ##############
2354
2355package Xapian::NumberValueRangeProcessor;
2356use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2357@ISA = qw( Xapian::StringValueRangeProcessor Xapian );
2358%OWNER = ();
2359%ITERATORS = ();
2360sub new {
2361    my $pkg = shift;
2362    my $self = Xapianc::new_NumberValueRangeProcessor(@_);
2363    bless $self, $pkg if defined($self);
2364}
2365
2366*__call__ = *Xapianc::NumberValueRangeProcessor___call__;
2367sub DESTROY {
2368    return unless $_[0]->isa('HASH');
2369    my $self = tied(%{$_[0]});
2370    return unless defined $self;
2371    delete $ITERATORS{$self};
2372    if (exists $OWNER{$self}) {
2373        Xapianc::delete_NumberValueRangeProcessor($self);
2374        delete $OWNER{$self};
2375    }
2376}
2377
2378sub DISOWN {
2379    my $self = shift;
2380    my $ptr = tied(%$self);
2381    delete $OWNER{$ptr};
2382}
2383
2384sub ACQUIRE {
2385    my $self = shift;
2386    my $ptr = tied(%$self);
2387    $OWNER{$ptr} = 1;
2388}
2389
2390
2391############# Class : Xapian::FieldProcessor ##############
2392
2393package Xapian::FieldProcessor;
2394use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2395@ISA = qw( Xapian );
2396%OWNER = ();
2397%ITERATORS = ();
2398sub DESTROY {
2399    return unless $_[0]->isa('HASH');
2400    my $self = tied(%{$_[0]});
2401    return unless defined $self;
2402    delete $ITERATORS{$self};
2403    if (exists $OWNER{$self}) {
2404        Xapianc::delete_FieldProcessor($self);
2405        delete $OWNER{$self};
2406    }
2407}
2408
2409*__call__ = *Xapianc::FieldProcessor___call__;
2410*release = *Xapianc::FieldProcessor_release;
2411sub DISOWN {
2412    my $self = shift;
2413    my $ptr = tied(%$self);
2414    delete $OWNER{$ptr};
2415}
2416
2417sub ACQUIRE {
2418    my $self = shift;
2419    my $ptr = tied(%$self);
2420    $OWNER{$ptr} = 1;
2421}
2422
2423
2424############# Class : Xapian::QueryParser ##############
2425
2426package Xapian::QueryParser;
2427use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2428@ISA = qw( Xapian );
2429%OWNER = ();
2430%ITERATORS = ();
2431*FLAG_BOOLEAN = *Xapianc::QueryParser_FLAG_BOOLEAN;
2432*FLAG_PHRASE = *Xapianc::QueryParser_FLAG_PHRASE;
2433*FLAG_LOVEHATE = *Xapianc::QueryParser_FLAG_LOVEHATE;
2434*FLAG_BOOLEAN_ANY_CASE = *Xapianc::QueryParser_FLAG_BOOLEAN_ANY_CASE;
2435*FLAG_WILDCARD = *Xapianc::QueryParser_FLAG_WILDCARD;
2436*FLAG_PURE_NOT = *Xapianc::QueryParser_FLAG_PURE_NOT;
2437*FLAG_PARTIAL = *Xapianc::QueryParser_FLAG_PARTIAL;
2438*FLAG_SPELLING_CORRECTION = *Xapianc::QueryParser_FLAG_SPELLING_CORRECTION;
2439*FLAG_SYNONYM = *Xapianc::QueryParser_FLAG_SYNONYM;
2440*FLAG_AUTO_SYNONYMS = *Xapianc::QueryParser_FLAG_AUTO_SYNONYMS;
2441*FLAG_AUTO_MULTIWORD_SYNONYMS = *Xapianc::QueryParser_FLAG_AUTO_MULTIWORD_SYNONYMS;
2442*FLAG_CJK_NGRAM = *Xapianc::QueryParser_FLAG_CJK_NGRAM;
2443*FLAG_ACCUMULATE = *Xapianc::QueryParser_FLAG_ACCUMULATE;
2444*FLAG_DEFAULT = *Xapianc::QueryParser_FLAG_DEFAULT;
2445*STEM_NONE = *Xapianc::QueryParser_STEM_NONE;
2446*STEM_SOME = *Xapianc::QueryParser_STEM_SOME;
2447*STEM_ALL = *Xapianc::QueryParser_STEM_ALL;
2448*STEM_ALL_Z = *Xapianc::QueryParser_STEM_ALL_Z;
2449*STEM_SOME_FULL_POS = *Xapianc::QueryParser_STEM_SOME_FULL_POS;
2450sub new {
2451  my $class = shift;
2452  my $qp = Xapianc::new_QueryParser();
2453
2454  bless $qp, $class;
2455  $qp->set_database(@_) if scalar(@_) == 1;
2456
2457  return $qp;
2458}
2459
2460sub DESTROY {
2461    return unless $_[0]->isa('HASH');
2462    my $self = tied(%{$_[0]});
2463    return unless defined $self;
2464    delete $ITERATORS{$self};
2465    if (exists $OWNER{$self}) {
2466        Xapianc::delete_QueryParser($self);
2467        delete $OWNER{$self};
2468    }
2469}
2470
2471*set_stemmer = *Xapianc::QueryParser_set_stemmer;
2472*set_stemming_strategy = *Xapianc::QueryParser_set_stemming_strategy;
2473sub set_stopper {
2474    my ($self, $stopper) = @_;
2475    $self{_stopper} = $stopper;
2476    Xapianc::QueryParser_set_stopper( @_ );
2477}
2478
2479*set_default_op = *Xapianc::QueryParser_set_default_op;
2480*get_default_op = *Xapianc::QueryParser_get_default_op;
2481*set_database = *Xapianc::QueryParser_set_database;
2482*set_max_expansion = *Xapianc::QueryParser_set_max_expansion;
2483*set_max_wildcard_expansion = *Xapianc::QueryParser_set_max_wildcard_expansion;
2484*parse_query = *Xapianc::QueryParser_parse_query;
2485*add_prefix = *Xapianc::QueryParser_add_prefix;
2486*add_boolean_prefix = *Xapianc::QueryParser_add_boolean_prefix;
2487*stoplist_begin = *Xapianc::QueryParser_stoplist_begin;
2488*stoplist_end = *Xapianc::QueryParser_stoplist_end;
2489*unstem_begin = *Xapianc::QueryParser_unstem_begin;
2490*unstem_end = *Xapianc::QueryParser_unstem_end;
2491sub add_rangeprocessor {
2492    my ($self, $rproc) = @_;
2493    push @{$self{_rproc}}, $rproc;
2494    Xapianc::QueryParser_add_rangeprocessor( @_ );
2495}
2496
2497sub add_valuerangeprocessor {
2498    my ($self, $vrproc) = @_;
2499    push @{$self{_vrproc}}, $vrproc;
2500    Xapianc::QueryParser_add_valuerangeprocessor( @_ );
2501}
2502
2503*get_corrected_query_string = *Xapianc::QueryParser_get_corrected_query_string;
2504*get_description = *Xapianc::QueryParser_get_description;
2505sub DISOWN {
2506    my $self = shift;
2507    my $ptr = tied(%$self);
2508    delete $OWNER{$ptr};
2509}
2510
2511sub ACQUIRE {
2512    my $self = shift;
2513    my $ptr = tied(%$self);
2514    $OWNER{$ptr} = 1;
2515}
2516
2517
2518############# Class : Xapian::ValueSetMatchDecider ##############
2519
2520package Xapian::ValueSetMatchDecider;
2521use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2522@ISA = qw( Xapian::MatchDecider Xapian );
2523%OWNER = ();
2524%ITERATORS = ();
2525sub new {
2526    my $pkg = shift;
2527    my $self = Xapianc::new_ValueSetMatchDecider(@_);
2528    bless $self, $pkg if defined($self);
2529}
2530
2531*add_value = *Xapianc::ValueSetMatchDecider_add_value;
2532*remove_value = *Xapianc::ValueSetMatchDecider_remove_value;
2533*__call__ = *Xapianc::ValueSetMatchDecider___call__;
2534sub DESTROY {
2535    return unless $_[0]->isa('HASH');
2536    my $self = tied(%{$_[0]});
2537    return unless defined $self;
2538    delete $ITERATORS{$self};
2539    if (exists $OWNER{$self}) {
2540        Xapianc::delete_ValueSetMatchDecider($self);
2541        delete $OWNER{$self};
2542    }
2543}
2544
2545sub DISOWN {
2546    my $self = shift;
2547    my $ptr = tied(%$self);
2548    delete $OWNER{$ptr};
2549}
2550
2551sub ACQUIRE {
2552    my $self = shift;
2553    my $ptr = tied(%$self);
2554    $OWNER{$ptr} = 1;
2555}
2556
2557
2558############# Class : Xapian::Weight ##############
2559
2560package Xapian::Weight;
2561use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2562@ISA = qw( Xapian );
2563%OWNER = ();
2564%ITERATORS = ();
2565*TWO_STAGE_SMOOTHING = *Xapianc::Weight_TWO_STAGE_SMOOTHING;
2566*DIRICHLET_SMOOTHING = *Xapianc::Weight_DIRICHLET_SMOOTHING;
2567*ABSOLUTE_DISCOUNT_SMOOTHING = *Xapianc::Weight_ABSOLUTE_DISCOUNT_SMOOTHING;
2568*JELINEK_MERCER_SMOOTHING = *Xapianc::Weight_JELINEK_MERCER_SMOOTHING;
2569*DIRICHLET_PLUS_SMOOTHING = *Xapianc::Weight_DIRICHLET_PLUS_SMOOTHING;
2570sub DESTROY {
2571    return unless $_[0]->isa('HASH');
2572    my $self = tied(%{$_[0]});
2573    return unless defined $self;
2574    delete $ITERATORS{$self};
2575    if (exists $OWNER{$self}) {
2576        Xapianc::delete_Weight($self);
2577        delete $OWNER{$self};
2578    }
2579}
2580
2581*name = *Xapianc::Weight_name;
2582*get_sumpart = *Xapianc::Weight_get_sumpart;
2583*get_maxpart = *Xapianc::Weight_get_maxpart;
2584*get_sumextra = *Xapianc::Weight_get_sumextra;
2585*get_maxextra = *Xapianc::Weight_get_maxextra;
2586sub DISOWN {
2587    my $self = shift;
2588    my $ptr = tied(%$self);
2589    delete $OWNER{$ptr};
2590}
2591
2592sub ACQUIRE {
2593    my $self = shift;
2594    my $ptr = tied(%$self);
2595    $OWNER{$ptr} = 1;
2596}
2597
2598
2599############# Class : Xapian::BoolWeight ##############
2600
2601package Xapian::BoolWeight;
2602use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2603@ISA = qw( Xapian::Weight Xapian );
2604%OWNER = ();
2605%ITERATORS = ();
2606sub new {
2607    my $pkg = shift;
2608    my $self = Xapianc::new_BoolWeight(@_);
2609    bless $self, $pkg if defined($self);
2610}
2611
2612*name = *Xapianc::BoolWeight_name;
2613*get_sumpart = *Xapianc::BoolWeight_get_sumpart;
2614*get_maxpart = *Xapianc::BoolWeight_get_maxpart;
2615*get_sumextra = *Xapianc::BoolWeight_get_sumextra;
2616*get_maxextra = *Xapianc::BoolWeight_get_maxextra;
2617sub DESTROY {
2618    return unless $_[0]->isa('HASH');
2619    my $self = tied(%{$_[0]});
2620    return unless defined $self;
2621    delete $ITERATORS{$self};
2622    if (exists $OWNER{$self}) {
2623        Xapianc::delete_BoolWeight($self);
2624        delete $OWNER{$self};
2625    }
2626}
2627
2628sub DISOWN {
2629    my $self = shift;
2630    my $ptr = tied(%$self);
2631    delete $OWNER{$ptr};
2632}
2633
2634sub ACQUIRE {
2635    my $self = shift;
2636    my $ptr = tied(%$self);
2637    $OWNER{$ptr} = 1;
2638}
2639
2640
2641############# Class : Xapian::TfIdfWeight ##############
2642
2643package Xapian::TfIdfWeight;
2644use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2645@ISA = qw( Xapian::Weight Xapian );
2646%OWNER = ();
2647%ITERATORS = ();
2648sub new {
2649    my $pkg = shift;
2650    my $self = Xapianc::new_TfIdfWeight(@_);
2651    bless $self, $pkg if defined($self);
2652}
2653
2654*name = *Xapianc::TfIdfWeight_name;
2655*get_sumpart = *Xapianc::TfIdfWeight_get_sumpart;
2656*get_maxpart = *Xapianc::TfIdfWeight_get_maxpart;
2657*get_sumextra = *Xapianc::TfIdfWeight_get_sumextra;
2658*get_maxextra = *Xapianc::TfIdfWeight_get_maxextra;
2659sub DESTROY {
2660    return unless $_[0]->isa('HASH');
2661    my $self = tied(%{$_[0]});
2662    return unless defined $self;
2663    delete $ITERATORS{$self};
2664    if (exists $OWNER{$self}) {
2665        Xapianc::delete_TfIdfWeight($self);
2666        delete $OWNER{$self};
2667    }
2668}
2669
2670sub DISOWN {
2671    my $self = shift;
2672    my $ptr = tied(%$self);
2673    delete $OWNER{$ptr};
2674}
2675
2676sub ACQUIRE {
2677    my $self = shift;
2678    my $ptr = tied(%$self);
2679    $OWNER{$ptr} = 1;
2680}
2681
2682
2683############# Class : Xapian::BM25Weight ##############
2684
2685package Xapian::BM25Weight;
2686use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2687@ISA = qw( Xapian::Weight Xapian );
2688%OWNER = ();
2689%ITERATORS = ();
2690sub new {
2691    my $pkg = shift;
2692    my $self = Xapianc::new_BM25Weight(@_);
2693    bless $self, $pkg if defined($self);
2694}
2695
2696*name = *Xapianc::BM25Weight_name;
2697*get_sumpart = *Xapianc::BM25Weight_get_sumpart;
2698*get_maxpart = *Xapianc::BM25Weight_get_maxpart;
2699*get_sumextra = *Xapianc::BM25Weight_get_sumextra;
2700*get_maxextra = *Xapianc::BM25Weight_get_maxextra;
2701sub DESTROY {
2702    return unless $_[0]->isa('HASH');
2703    my $self = tied(%{$_[0]});
2704    return unless defined $self;
2705    delete $ITERATORS{$self};
2706    if (exists $OWNER{$self}) {
2707        Xapianc::delete_BM25Weight($self);
2708        delete $OWNER{$self};
2709    }
2710}
2711
2712sub DISOWN {
2713    my $self = shift;
2714    my $ptr = tied(%$self);
2715    delete $OWNER{$ptr};
2716}
2717
2718sub ACQUIRE {
2719    my $self = shift;
2720    my $ptr = tied(%$self);
2721    $OWNER{$ptr} = 1;
2722}
2723
2724
2725############# Class : Xapian::BM25PlusWeight ##############
2726
2727package Xapian::BM25PlusWeight;
2728use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2729@ISA = qw( Xapian::Weight Xapian );
2730%OWNER = ();
2731%ITERATORS = ();
2732sub new {
2733    my $pkg = shift;
2734    my $self = Xapianc::new_BM25PlusWeight(@_);
2735    bless $self, $pkg if defined($self);
2736}
2737
2738*name = *Xapianc::BM25PlusWeight_name;
2739*get_sumpart = *Xapianc::BM25PlusWeight_get_sumpart;
2740*get_maxpart = *Xapianc::BM25PlusWeight_get_maxpart;
2741*get_sumextra = *Xapianc::BM25PlusWeight_get_sumextra;
2742*get_maxextra = *Xapianc::BM25PlusWeight_get_maxextra;
2743sub DESTROY {
2744    return unless $_[0]->isa('HASH');
2745    my $self = tied(%{$_[0]});
2746    return unless defined $self;
2747    delete $ITERATORS{$self};
2748    if (exists $OWNER{$self}) {
2749        Xapianc::delete_BM25PlusWeight($self);
2750        delete $OWNER{$self};
2751    }
2752}
2753
2754sub DISOWN {
2755    my $self = shift;
2756    my $ptr = tied(%$self);
2757    delete $OWNER{$ptr};
2758}
2759
2760sub ACQUIRE {
2761    my $self = shift;
2762    my $ptr = tied(%$self);
2763    $OWNER{$ptr} = 1;
2764}
2765
2766
2767############# Class : Xapian::TradWeight ##############
2768
2769package Xapian::TradWeight;
2770use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2771@ISA = qw( Xapian::Weight Xapian );
2772%OWNER = ();
2773%ITERATORS = ();
2774sub new {
2775    my $pkg = shift;
2776    my $self = Xapianc::new_TradWeight(@_);
2777    bless $self, $pkg if defined($self);
2778}
2779
2780*name = *Xapianc::TradWeight_name;
2781*get_sumpart = *Xapianc::TradWeight_get_sumpart;
2782*get_maxpart = *Xapianc::TradWeight_get_maxpart;
2783*get_sumextra = *Xapianc::TradWeight_get_sumextra;
2784*get_maxextra = *Xapianc::TradWeight_get_maxextra;
2785sub DESTROY {
2786    return unless $_[0]->isa('HASH');
2787    my $self = tied(%{$_[0]});
2788    return unless defined $self;
2789    delete $ITERATORS{$self};
2790    if (exists $OWNER{$self}) {
2791        Xapianc::delete_TradWeight($self);
2792        delete $OWNER{$self};
2793    }
2794}
2795
2796sub DISOWN {
2797    my $self = shift;
2798    my $ptr = tied(%$self);
2799    delete $OWNER{$ptr};
2800}
2801
2802sub ACQUIRE {
2803    my $self = shift;
2804    my $ptr = tied(%$self);
2805    $OWNER{$ptr} = 1;
2806}
2807
2808
2809############# Class : Xapian::InL2Weight ##############
2810
2811package Xapian::InL2Weight;
2812use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2813@ISA = qw( Xapian::Weight Xapian );
2814%OWNER = ();
2815%ITERATORS = ();
2816sub new {
2817    my $pkg = shift;
2818    my $self = Xapianc::new_InL2Weight(@_);
2819    bless $self, $pkg if defined($self);
2820}
2821
2822*name = *Xapianc::InL2Weight_name;
2823*get_sumpart = *Xapianc::InL2Weight_get_sumpart;
2824*get_maxpart = *Xapianc::InL2Weight_get_maxpart;
2825*get_sumextra = *Xapianc::InL2Weight_get_sumextra;
2826*get_maxextra = *Xapianc::InL2Weight_get_maxextra;
2827sub DESTROY {
2828    return unless $_[0]->isa('HASH');
2829    my $self = tied(%{$_[0]});
2830    return unless defined $self;
2831    delete $ITERATORS{$self};
2832    if (exists $OWNER{$self}) {
2833        Xapianc::delete_InL2Weight($self);
2834        delete $OWNER{$self};
2835    }
2836}
2837
2838sub DISOWN {
2839    my $self = shift;
2840    my $ptr = tied(%$self);
2841    delete $OWNER{$ptr};
2842}
2843
2844sub ACQUIRE {
2845    my $self = shift;
2846    my $ptr = tied(%$self);
2847    $OWNER{$ptr} = 1;
2848}
2849
2850
2851############# Class : Xapian::IfB2Weight ##############
2852
2853package Xapian::IfB2Weight;
2854use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2855@ISA = qw( Xapian::Weight Xapian );
2856%OWNER = ();
2857%ITERATORS = ();
2858sub new {
2859    my $pkg = shift;
2860    my $self = Xapianc::new_IfB2Weight(@_);
2861    bless $self, $pkg if defined($self);
2862}
2863
2864*name = *Xapianc::IfB2Weight_name;
2865*get_sumpart = *Xapianc::IfB2Weight_get_sumpart;
2866*get_maxpart = *Xapianc::IfB2Weight_get_maxpart;
2867*get_sumextra = *Xapianc::IfB2Weight_get_sumextra;
2868*get_maxextra = *Xapianc::IfB2Weight_get_maxextra;
2869sub DESTROY {
2870    return unless $_[0]->isa('HASH');
2871    my $self = tied(%{$_[0]});
2872    return unless defined $self;
2873    delete $ITERATORS{$self};
2874    if (exists $OWNER{$self}) {
2875        Xapianc::delete_IfB2Weight($self);
2876        delete $OWNER{$self};
2877    }
2878}
2879
2880sub DISOWN {
2881    my $self = shift;
2882    my $ptr = tied(%$self);
2883    delete $OWNER{$ptr};
2884}
2885
2886sub ACQUIRE {
2887    my $self = shift;
2888    my $ptr = tied(%$self);
2889    $OWNER{$ptr} = 1;
2890}
2891
2892
2893############# Class : Xapian::IneB2Weight ##############
2894
2895package Xapian::IneB2Weight;
2896use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2897@ISA = qw( Xapian::Weight Xapian );
2898%OWNER = ();
2899%ITERATORS = ();
2900sub new {
2901    my $pkg = shift;
2902    my $self = Xapianc::new_IneB2Weight(@_);
2903    bless $self, $pkg if defined($self);
2904}
2905
2906*name = *Xapianc::IneB2Weight_name;
2907*get_sumpart = *Xapianc::IneB2Weight_get_sumpart;
2908*get_maxpart = *Xapianc::IneB2Weight_get_maxpart;
2909*get_sumextra = *Xapianc::IneB2Weight_get_sumextra;
2910*get_maxextra = *Xapianc::IneB2Weight_get_maxextra;
2911sub DESTROY {
2912    return unless $_[0]->isa('HASH');
2913    my $self = tied(%{$_[0]});
2914    return unless defined $self;
2915    delete $ITERATORS{$self};
2916    if (exists $OWNER{$self}) {
2917        Xapianc::delete_IneB2Weight($self);
2918        delete $OWNER{$self};
2919    }
2920}
2921
2922sub DISOWN {
2923    my $self = shift;
2924    my $ptr = tied(%$self);
2925    delete $OWNER{$ptr};
2926}
2927
2928sub ACQUIRE {
2929    my $self = shift;
2930    my $ptr = tied(%$self);
2931    $OWNER{$ptr} = 1;
2932}
2933
2934
2935############# Class : Xapian::BB2Weight ##############
2936
2937package Xapian::BB2Weight;
2938use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2939@ISA = qw( Xapian::Weight Xapian );
2940%OWNER = ();
2941%ITERATORS = ();
2942sub new {
2943    my $pkg = shift;
2944    my $self = Xapianc::new_BB2Weight(@_);
2945    bless $self, $pkg if defined($self);
2946}
2947
2948*name = *Xapianc::BB2Weight_name;
2949*get_sumpart = *Xapianc::BB2Weight_get_sumpart;
2950*get_maxpart = *Xapianc::BB2Weight_get_maxpart;
2951*get_sumextra = *Xapianc::BB2Weight_get_sumextra;
2952*get_maxextra = *Xapianc::BB2Weight_get_maxextra;
2953sub DESTROY {
2954    return unless $_[0]->isa('HASH');
2955    my $self = tied(%{$_[0]});
2956    return unless defined $self;
2957    delete $ITERATORS{$self};
2958    if (exists $OWNER{$self}) {
2959        Xapianc::delete_BB2Weight($self);
2960        delete $OWNER{$self};
2961    }
2962}
2963
2964sub DISOWN {
2965    my $self = shift;
2966    my $ptr = tied(%$self);
2967    delete $OWNER{$ptr};
2968}
2969
2970sub ACQUIRE {
2971    my $self = shift;
2972    my $ptr = tied(%$self);
2973    $OWNER{$ptr} = 1;
2974}
2975
2976
2977############# Class : Xapian::DLHWeight ##############
2978
2979package Xapian::DLHWeight;
2980use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
2981@ISA = qw( Xapian::Weight Xapian );
2982%OWNER = ();
2983%ITERATORS = ();
2984sub new {
2985    my $pkg = shift;
2986    my $self = Xapianc::new_DLHWeight(@_);
2987    bless $self, $pkg if defined($self);
2988}
2989
2990*name = *Xapianc::DLHWeight_name;
2991*get_sumpart = *Xapianc::DLHWeight_get_sumpart;
2992*get_maxpart = *Xapianc::DLHWeight_get_maxpart;
2993*get_sumextra = *Xapianc::DLHWeight_get_sumextra;
2994*get_maxextra = *Xapianc::DLHWeight_get_maxextra;
2995sub DESTROY {
2996    return unless $_[0]->isa('HASH');
2997    my $self = tied(%{$_[0]});
2998    return unless defined $self;
2999    delete $ITERATORS{$self};
3000    if (exists $OWNER{$self}) {
3001        Xapianc::delete_DLHWeight($self);
3002        delete $OWNER{$self};
3003    }
3004}
3005
3006sub DISOWN {
3007    my $self = shift;
3008    my $ptr = tied(%$self);
3009    delete $OWNER{$ptr};
3010}
3011
3012sub ACQUIRE {
3013    my $self = shift;
3014    my $ptr = tied(%$self);
3015    $OWNER{$ptr} = 1;
3016}
3017
3018
3019############# Class : Xapian::PL2Weight ##############
3020
3021package Xapian::PL2Weight;
3022use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3023@ISA = qw( Xapian::Weight Xapian );
3024%OWNER = ();
3025%ITERATORS = ();
3026sub new {
3027    my $pkg = shift;
3028    my $self = Xapianc::new_PL2Weight(@_);
3029    bless $self, $pkg if defined($self);
3030}
3031
3032*name = *Xapianc::PL2Weight_name;
3033*get_sumpart = *Xapianc::PL2Weight_get_sumpart;
3034*get_maxpart = *Xapianc::PL2Weight_get_maxpart;
3035*get_sumextra = *Xapianc::PL2Weight_get_sumextra;
3036*get_maxextra = *Xapianc::PL2Weight_get_maxextra;
3037sub DESTROY {
3038    return unless $_[0]->isa('HASH');
3039    my $self = tied(%{$_[0]});
3040    return unless defined $self;
3041    delete $ITERATORS{$self};
3042    if (exists $OWNER{$self}) {
3043        Xapianc::delete_PL2Weight($self);
3044        delete $OWNER{$self};
3045    }
3046}
3047
3048sub DISOWN {
3049    my $self = shift;
3050    my $ptr = tied(%$self);
3051    delete $OWNER{$ptr};
3052}
3053
3054sub ACQUIRE {
3055    my $self = shift;
3056    my $ptr = tied(%$self);
3057    $OWNER{$ptr} = 1;
3058}
3059
3060
3061############# Class : Xapian::PL2PlusWeight ##############
3062
3063package Xapian::PL2PlusWeight;
3064use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3065@ISA = qw( Xapian::Weight Xapian );
3066%OWNER = ();
3067%ITERATORS = ();
3068sub new {
3069    my $pkg = shift;
3070    my $self = Xapianc::new_PL2PlusWeight(@_);
3071    bless $self, $pkg if defined($self);
3072}
3073
3074*name = *Xapianc::PL2PlusWeight_name;
3075*get_sumpart = *Xapianc::PL2PlusWeight_get_sumpart;
3076*get_maxpart = *Xapianc::PL2PlusWeight_get_maxpart;
3077*get_sumextra = *Xapianc::PL2PlusWeight_get_sumextra;
3078*get_maxextra = *Xapianc::PL2PlusWeight_get_maxextra;
3079sub DESTROY {
3080    return unless $_[0]->isa('HASH');
3081    my $self = tied(%{$_[0]});
3082    return unless defined $self;
3083    delete $ITERATORS{$self};
3084    if (exists $OWNER{$self}) {
3085        Xapianc::delete_PL2PlusWeight($self);
3086        delete $OWNER{$self};
3087    }
3088}
3089
3090sub DISOWN {
3091    my $self = shift;
3092    my $ptr = tied(%$self);
3093    delete $OWNER{$ptr};
3094}
3095
3096sub ACQUIRE {
3097    my $self = shift;
3098    my $ptr = tied(%$self);
3099    $OWNER{$ptr} = 1;
3100}
3101
3102
3103############# Class : Xapian::DPHWeight ##############
3104
3105package Xapian::DPHWeight;
3106use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3107@ISA = qw( Xapian::Weight Xapian );
3108%OWNER = ();
3109%ITERATORS = ();
3110sub new {
3111    my $pkg = shift;
3112    my $self = Xapianc::new_DPHWeight(@_);
3113    bless $self, $pkg if defined($self);
3114}
3115
3116*name = *Xapianc::DPHWeight_name;
3117*get_sumpart = *Xapianc::DPHWeight_get_sumpart;
3118*get_maxpart = *Xapianc::DPHWeight_get_maxpart;
3119*get_sumextra = *Xapianc::DPHWeight_get_sumextra;
3120*get_maxextra = *Xapianc::DPHWeight_get_maxextra;
3121sub DESTROY {
3122    return unless $_[0]->isa('HASH');
3123    my $self = tied(%{$_[0]});
3124    return unless defined $self;
3125    delete $ITERATORS{$self};
3126    if (exists $OWNER{$self}) {
3127        Xapianc::delete_DPHWeight($self);
3128        delete $OWNER{$self};
3129    }
3130}
3131
3132sub DISOWN {
3133    my $self = shift;
3134    my $ptr = tied(%$self);
3135    delete $OWNER{$ptr};
3136}
3137
3138sub ACQUIRE {
3139    my $self = shift;
3140    my $ptr = tied(%$self);
3141    $OWNER{$ptr} = 1;
3142}
3143
3144
3145############# Class : Xapian::LMWeight ##############
3146
3147package Xapian::LMWeight;
3148use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3149@ISA = qw( Xapian::Weight Xapian );
3150%OWNER = ();
3151%ITERATORS = ();
3152sub new {
3153    my $pkg = shift;
3154    my $self = Xapianc::new_LMWeight(@_);
3155    bless $self, $pkg if defined($self);
3156}
3157
3158*name = *Xapianc::LMWeight_name;
3159*get_sumpart = *Xapianc::LMWeight_get_sumpart;
3160*get_maxpart = *Xapianc::LMWeight_get_maxpart;
3161*get_sumextra = *Xapianc::LMWeight_get_sumextra;
3162*get_maxextra = *Xapianc::LMWeight_get_maxextra;
3163sub DESTROY {
3164    return unless $_[0]->isa('HASH');
3165    my $self = tied(%{$_[0]});
3166    return unless defined $self;
3167    delete $ITERATORS{$self};
3168    if (exists $OWNER{$self}) {
3169        Xapianc::delete_LMWeight($self);
3170        delete $OWNER{$self};
3171    }
3172}
3173
3174sub DISOWN {
3175    my $self = shift;
3176    my $ptr = tied(%$self);
3177    delete $OWNER{$ptr};
3178}
3179
3180sub ACQUIRE {
3181    my $self = shift;
3182    my $ptr = tied(%$self);
3183    $OWNER{$ptr} = 1;
3184}
3185
3186
3187############# Class : Xapian::CoordWeight ##############
3188
3189package Xapian::CoordWeight;
3190use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3191@ISA = qw( Xapian::Weight Xapian );
3192%OWNER = ();
3193%ITERATORS = ();
3194*init = *Xapianc::CoordWeight_init;
3195sub new {
3196    my $pkg = shift;
3197    my $self = Xapianc::new_CoordWeight(@_);
3198    bless $self, $pkg if defined($self);
3199}
3200
3201*name = *Xapianc::CoordWeight_name;
3202*get_sumpart = *Xapianc::CoordWeight_get_sumpart;
3203*get_maxpart = *Xapianc::CoordWeight_get_maxpart;
3204*get_sumextra = *Xapianc::CoordWeight_get_sumextra;
3205*get_maxextra = *Xapianc::CoordWeight_get_maxextra;
3206sub DESTROY {
3207    return unless $_[0]->isa('HASH');
3208    my $self = tied(%{$_[0]});
3209    return unless defined $self;
3210    delete $ITERATORS{$self};
3211    if (exists $OWNER{$self}) {
3212        Xapianc::delete_CoordWeight($self);
3213        delete $OWNER{$self};
3214    }
3215}
3216
3217sub DISOWN {
3218    my $self = shift;
3219    my $ptr = tied(%$self);
3220    delete $OWNER{$ptr};
3221}
3222
3223sub ACQUIRE {
3224    my $self = shift;
3225    my $ptr = tied(%$self);
3226    $OWNER{$ptr} = 1;
3227}
3228
3229
3230############# Class : Xapian::Compactor ##############
3231
3232package Xapian::Compactor;
3233use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3234@ISA = qw( Xapian );
3235%OWNER = ();
3236%ITERATORS = ();
3237*STANDARD = *Xapianc::Compactor_STANDARD;
3238*FULL = *Xapianc::Compactor_FULL;
3239*FULLER = *Xapianc::Compactor_FULLER;
3240sub new {
3241    my $pkg = shift;
3242    my $self = Xapianc::new_Compactor(@_);
3243    bless $self, $pkg if defined($self);
3244}
3245
3246sub DESTROY {
3247    return unless $_[0]->isa('HASH');
3248    my $self = tied(%{$_[0]});
3249    return unless defined $self;
3250    delete $ITERATORS{$self};
3251    if (exists $OWNER{$self}) {
3252        Xapianc::delete_Compactor($self);
3253        delete $OWNER{$self};
3254    }
3255}
3256
3257*set_block_size = *Xapianc::Compactor_set_block_size;
3258*set_renumber = *Xapianc::Compactor_set_renumber;
3259*set_multipass = *Xapianc::Compactor_set_multipass;
3260*set_compaction_level = *Xapianc::Compactor_set_compaction_level;
3261*set_destdir = *Xapianc::Compactor_set_destdir;
3262*add_source = *Xapianc::Compactor_add_source;
3263*compact = *Xapianc::Compactor_compact;
3264*set_status = *Xapianc::Compactor_set_status;
3265*resolve_duplicate_metadata = *Xapianc::Compactor_resolve_duplicate_metadata;
3266sub DISOWN {
3267    my $self = shift;
3268    my $ptr = tied(%$self);
3269    delete $OWNER{$ptr};
3270}
3271
3272sub ACQUIRE {
3273    my $self = shift;
3274    my $ptr = tied(%$self);
3275    $OWNER{$ptr} = 1;
3276}
3277
3278
3279############# Class : Xapian::PostingSource ##############
3280
3281package Xapian::PostingSource;
3282use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3283@ISA = qw( Xapian );
3284%OWNER = ();
3285%ITERATORS = ();
3286sub DESTROY {
3287    return unless $_[0]->isa('HASH');
3288    my $self = tied(%{$_[0]});
3289    return unless defined $self;
3290    delete $ITERATORS{$self};
3291    if (exists $OWNER{$self}) {
3292        Xapianc::delete_PostingSource($self);
3293        delete $OWNER{$self};
3294    }
3295}
3296
3297*get_termfreq_min = *Xapianc::PostingSource_get_termfreq_min;
3298*get_termfreq_est = *Xapianc::PostingSource_get_termfreq_est;
3299*get_termfreq_max = *Xapianc::PostingSource_get_termfreq_max;
3300*set_maxweight = *Xapianc::PostingSource_set_maxweight;
3301*get_maxweight = *Xapianc::PostingSource_get_maxweight;
3302*get_weight = *Xapianc::PostingSource_get_weight;
3303*get_docid = *Xapianc::PostingSource_get_docid;
3304*increment_weight = *Xapianc::PostingSource_increment_weight;
3305*skip_to = *Xapianc::PostingSource_skip_to;
3306*check = *Xapianc::PostingSource_check;
3307*at_end = *Xapianc::PostingSource_at_end;
3308*name = *Xapianc::PostingSource_name;
3309*init = *Xapianc::PostingSource_init;
3310*get_description = *Xapianc::PostingSource_get_description;
3311*release = *Xapianc::PostingSource_release;
3312sub DISOWN {
3313    my $self = shift;
3314    my $ptr = tied(%$self);
3315    delete $OWNER{$ptr};
3316}
3317
3318sub ACQUIRE {
3319    my $self = shift;
3320    my $ptr = tied(%$self);
3321    $OWNER{$ptr} = 1;
3322}
3323
3324
3325############# Class : Xapian::ValuePostingSource ##############
3326
3327package Xapian::ValuePostingSource;
3328use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3329@ISA = qw( Xapian::PostingSource Xapian );
3330%OWNER = ();
3331%ITERATORS = ();
3332sub new {
3333    my $pkg = shift;
3334    my $self = Xapianc::new_ValuePostingSource(@_);
3335    bless $self, $pkg if defined($self);
3336}
3337
3338*get_termfreq_min = *Xapianc::ValuePostingSource_get_termfreq_min;
3339*get_termfreq_est = *Xapianc::ValuePostingSource_get_termfreq_est;
3340*get_termfreq_max = *Xapianc::ValuePostingSource_get_termfreq_max;
3341*increment_weight = *Xapianc::ValuePostingSource_increment_weight;
3342*skip_to = *Xapianc::ValuePostingSource_skip_to;
3343*check = *Xapianc::ValuePostingSource_check;
3344*at_end = *Xapianc::ValuePostingSource_at_end;
3345*get_docid = *Xapianc::ValuePostingSource_get_docid;
3346*init = *Xapianc::ValuePostingSource_init;
3347*get_database = *Xapianc::ValuePostingSource_get_database;
3348*get_slot = *Xapianc::ValuePostingSource_get_slot;
3349*get_value = *Xapianc::ValuePostingSource_get_value;
3350*done = *Xapianc::ValuePostingSource_done;
3351*get_started = *Xapianc::ValuePostingSource_get_started;
3352*set_termfreq_min = *Xapianc::ValuePostingSource_set_termfreq_min;
3353*set_termfreq_est = *Xapianc::ValuePostingSource_set_termfreq_est;
3354*set_termfreq_max = *Xapianc::ValuePostingSource_set_termfreq_max;
3355sub DESTROY {
3356    return unless $_[0]->isa('HASH');
3357    my $self = tied(%{$_[0]});
3358    return unless defined $self;
3359    delete $ITERATORS{$self};
3360    if (exists $OWNER{$self}) {
3361        Xapianc::delete_ValuePostingSource($self);
3362        delete $OWNER{$self};
3363    }
3364}
3365
3366sub DISOWN {
3367    my $self = shift;
3368    my $ptr = tied(%$self);
3369    delete $OWNER{$ptr};
3370}
3371
3372sub ACQUIRE {
3373    my $self = shift;
3374    my $ptr = tied(%$self);
3375    $OWNER{$ptr} = 1;
3376}
3377
3378
3379############# Class : Xapian::ValueWeightPostingSource ##############
3380
3381package Xapian::ValueWeightPostingSource;
3382use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3383@ISA = qw( Xapian::ValuePostingSource Xapian );
3384%OWNER = ();
3385%ITERATORS = ();
3386sub new {
3387    my $pkg = shift;
3388    my $self = Xapianc::new_ValueWeightPostingSource(@_);
3389    bless $self, $pkg if defined($self);
3390}
3391
3392*get_weight = *Xapianc::ValueWeightPostingSource_get_weight;
3393*name = *Xapianc::ValueWeightPostingSource_name;
3394*init = *Xapianc::ValueWeightPostingSource_init;
3395*get_description = *Xapianc::ValueWeightPostingSource_get_description;
3396sub DESTROY {
3397    return unless $_[0]->isa('HASH');
3398    my $self = tied(%{$_[0]});
3399    return unless defined $self;
3400    delete $ITERATORS{$self};
3401    if (exists $OWNER{$self}) {
3402        Xapianc::delete_ValueWeightPostingSource($self);
3403        delete $OWNER{$self};
3404    }
3405}
3406
3407sub DISOWN {
3408    my $self = shift;
3409    my $ptr = tied(%$self);
3410    delete $OWNER{$ptr};
3411}
3412
3413sub ACQUIRE {
3414    my $self = shift;
3415    my $ptr = tied(%$self);
3416    $OWNER{$ptr} = 1;
3417}
3418
3419
3420############# Class : Xapian::DecreasingValueWeightPostingSource ##############
3421
3422package Xapian::DecreasingValueWeightPostingSource;
3423use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3424@ISA = qw( Xapian::ValueWeightPostingSource Xapian );
3425%OWNER = ();
3426%ITERATORS = ();
3427sub new {
3428    my $pkg = shift;
3429    my $self = Xapianc::new_DecreasingValueWeightPostingSource(@_);
3430    bless $self, $pkg if defined($self);
3431}
3432
3433*get_weight = *Xapianc::DecreasingValueWeightPostingSource_get_weight;
3434*name = *Xapianc::DecreasingValueWeightPostingSource_name;
3435*init = *Xapianc::DecreasingValueWeightPostingSource_init;
3436*increment_weight = *Xapianc::DecreasingValueWeightPostingSource_increment_weight;
3437*skip_to = *Xapianc::DecreasingValueWeightPostingSource_skip_to;
3438*check = *Xapianc::DecreasingValueWeightPostingSource_check;
3439*get_description = *Xapianc::DecreasingValueWeightPostingSource_get_description;
3440sub DESTROY {
3441    return unless $_[0]->isa('HASH');
3442    my $self = tied(%{$_[0]});
3443    return unless defined $self;
3444    delete $ITERATORS{$self};
3445    if (exists $OWNER{$self}) {
3446        Xapianc::delete_DecreasingValueWeightPostingSource($self);
3447        delete $OWNER{$self};
3448    }
3449}
3450
3451sub DISOWN {
3452    my $self = shift;
3453    my $ptr = tied(%$self);
3454    delete $OWNER{$ptr};
3455}
3456
3457sub ACQUIRE {
3458    my $self = shift;
3459    my $ptr = tied(%$self);
3460    $OWNER{$ptr} = 1;
3461}
3462
3463
3464############# Class : Xapian::ValueMapPostingSource ##############
3465
3466package Xapian::ValueMapPostingSource;
3467use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3468@ISA = qw( Xapian::ValuePostingSource Xapian );
3469%OWNER = ();
3470%ITERATORS = ();
3471sub new {
3472    my $pkg = shift;
3473    my $self = Xapianc::new_ValueMapPostingSource(@_);
3474    bless $self, $pkg if defined($self);
3475}
3476
3477*add_mapping = *Xapianc::ValueMapPostingSource_add_mapping;
3478*clear_mappings = *Xapianc::ValueMapPostingSource_clear_mappings;
3479*set_default_weight = *Xapianc::ValueMapPostingSource_set_default_weight;
3480*get_weight = *Xapianc::ValueMapPostingSource_get_weight;
3481*name = *Xapianc::ValueMapPostingSource_name;
3482*init = *Xapianc::ValueMapPostingSource_init;
3483*get_description = *Xapianc::ValueMapPostingSource_get_description;
3484sub DESTROY {
3485    return unless $_[0]->isa('HASH');
3486    my $self = tied(%{$_[0]});
3487    return unless defined $self;
3488    delete $ITERATORS{$self};
3489    if (exists $OWNER{$self}) {
3490        Xapianc::delete_ValueMapPostingSource($self);
3491        delete $OWNER{$self};
3492    }
3493}
3494
3495sub DISOWN {
3496    my $self = shift;
3497    my $ptr = tied(%$self);
3498    delete $OWNER{$ptr};
3499}
3500
3501sub ACQUIRE {
3502    my $self = shift;
3503    my $ptr = tied(%$self);
3504    $OWNER{$ptr} = 1;
3505}
3506
3507
3508############# Class : Xapian::FixedWeightPostingSource ##############
3509
3510package Xapian::FixedWeightPostingSource;
3511use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3512@ISA = qw( Xapian::PostingSource Xapian );
3513%OWNER = ();
3514%ITERATORS = ();
3515sub new {
3516    my $pkg = shift;
3517    my $self = Xapianc::new_FixedWeightPostingSource(@_);
3518    bless $self, $pkg if defined($self);
3519}
3520
3521*get_termfreq_min = *Xapianc::FixedWeightPostingSource_get_termfreq_min;
3522*get_termfreq_est = *Xapianc::FixedWeightPostingSource_get_termfreq_est;
3523*get_termfreq_max = *Xapianc::FixedWeightPostingSource_get_termfreq_max;
3524*get_weight = *Xapianc::FixedWeightPostingSource_get_weight;
3525*increment_weight = *Xapianc::FixedWeightPostingSource_increment_weight;
3526*skip_to = *Xapianc::FixedWeightPostingSource_skip_to;
3527*check = *Xapianc::FixedWeightPostingSource_check;
3528*at_end = *Xapianc::FixedWeightPostingSource_at_end;
3529*get_docid = *Xapianc::FixedWeightPostingSource_get_docid;
3530*name = *Xapianc::FixedWeightPostingSource_name;
3531*init = *Xapianc::FixedWeightPostingSource_init;
3532*get_description = *Xapianc::FixedWeightPostingSource_get_description;
3533sub DESTROY {
3534    return unless $_[0]->isa('HASH');
3535    my $self = tied(%{$_[0]});
3536    return unless defined $self;
3537    delete $ITERATORS{$self};
3538    if (exists $OWNER{$self}) {
3539        Xapianc::delete_FixedWeightPostingSource($self);
3540        delete $OWNER{$self};
3541    }
3542}
3543
3544sub DISOWN {
3545    my $self = shift;
3546    my $ptr = tied(%$self);
3547    delete $OWNER{$ptr};
3548}
3549
3550sub ACQUIRE {
3551    my $self = shift;
3552    my $ptr = tied(%$self);
3553    $OWNER{$ptr} = 1;
3554}
3555
3556
3557############# Class : Xapian::MatchSpy ##############
3558
3559package Xapian::MatchSpy;
3560use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3561@ISA = qw( Xapian );
3562%OWNER = ();
3563%ITERATORS = ();
3564sub DESTROY {
3565    return unless $_[0]->isa('HASH');
3566    my $self = tied(%{$_[0]});
3567    return unless defined $self;
3568    delete $ITERATORS{$self};
3569    if (exists $OWNER{$self}) {
3570        Xapianc::delete_MatchSpy($self);
3571        delete $OWNER{$self};
3572    }
3573}
3574
3575*__call__ = *Xapianc::MatchSpy___call__;
3576*name = *Xapianc::MatchSpy_name;
3577*merge_results = *Xapianc::MatchSpy_merge_results;
3578*get_description = *Xapianc::MatchSpy_get_description;
3579*release = *Xapianc::MatchSpy_release;
3580sub DISOWN {
3581    my $self = shift;
3582    my $ptr = tied(%$self);
3583    delete $OWNER{$ptr};
3584}
3585
3586sub ACQUIRE {
3587    my $self = shift;
3588    my $ptr = tied(%$self);
3589    $OWNER{$ptr} = 1;
3590}
3591
3592
3593############# Class : Xapian::ValueCountMatchSpy ##############
3594
3595package Xapian::ValueCountMatchSpy;
3596use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3597@ISA = qw( Xapian::MatchSpy Xapian );
3598%OWNER = ();
3599%ITERATORS = ();
3600sub new {
3601    my $pkg = shift;
3602    my $self = Xapianc::new_ValueCountMatchSpy(@_);
3603    bless $self, $pkg if defined($self);
3604}
3605
3606*get_total = *Xapianc::ValueCountMatchSpy_get_total;
3607*values_begin = *Xapianc::ValueCountMatchSpy_values_begin;
3608*values_end = *Xapianc::ValueCountMatchSpy_values_end;
3609*top_values_begin = *Xapianc::ValueCountMatchSpy_top_values_begin;
3610*top_values_end = *Xapianc::ValueCountMatchSpy_top_values_end;
3611*__call__ = *Xapianc::ValueCountMatchSpy___call__;
3612*name = *Xapianc::ValueCountMatchSpy_name;
3613*merge_results = *Xapianc::ValueCountMatchSpy_merge_results;
3614*get_description = *Xapianc::ValueCountMatchSpy_get_description;
3615sub DESTROY {
3616    return unless $_[0]->isa('HASH');
3617    my $self = tied(%{$_[0]});
3618    return unless defined $self;
3619    delete $ITERATORS{$self};
3620    if (exists $OWNER{$self}) {
3621        Xapianc::delete_ValueCountMatchSpy($self);
3622        delete $OWNER{$self};
3623    }
3624}
3625
3626sub DISOWN {
3627    my $self = shift;
3628    my $ptr = tied(%$self);
3629    delete $OWNER{$ptr};
3630}
3631
3632sub ACQUIRE {
3633    my $self = shift;
3634    my $ptr = tied(%$self);
3635    $OWNER{$ptr} = 1;
3636}
3637
3638
3639############# Class : Xapian::LatLongCoord ##############
3640
3641package Xapian::LatLongCoord;
3642use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3643@ISA = qw( Xapian );
3644%OWNER = ();
3645%ITERATORS = ();
3646*swig_latitude_get = *Xapianc::LatLongCoord_latitude_get;
3647*swig_latitude_set = *Xapianc::LatLongCoord_latitude_set;
3648*swig_longitude_get = *Xapianc::LatLongCoord_longitude_get;
3649*swig_longitude_set = *Xapianc::LatLongCoord_longitude_set;
3650sub new {
3651    my $pkg = shift;
3652    my $self = Xapianc::new_LatLongCoord(@_);
3653    bless $self, $pkg if defined($self);
3654}
3655
3656*unserialise = *Xapianc::LatLongCoord_unserialise;
3657*serialise = *Xapianc::LatLongCoord_serialise;
3658*get_description = *Xapianc::LatLongCoord_get_description;
3659sub DESTROY {
3660    return unless $_[0]->isa('HASH');
3661    my $self = tied(%{$_[0]});
3662    return unless defined $self;
3663    delete $ITERATORS{$self};
3664    if (exists $OWNER{$self}) {
3665        Xapianc::delete_LatLongCoord($self);
3666        delete $OWNER{$self};
3667    }
3668}
3669
3670sub DISOWN {
3671    my $self = shift;
3672    my $ptr = tied(%$self);
3673    delete $OWNER{$ptr};
3674}
3675
3676sub ACQUIRE {
3677    my $self = shift;
3678    my $ptr = tied(%$self);
3679    $OWNER{$ptr} = 1;
3680}
3681
3682
3683############# Class : Xapian::LatLongCoordsIterator ##############
3684
3685package Xapian::LatLongCoordsIterator;
3686use overload
3687    "==" => sub { $_[0]->__eq__($_[1])},
3688    "=" => sub { my $class = ref($_[0]); $class->new($_[0]) },
3689    "fallback" => 1;
3690use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3691@ISA = qw( Xapian );
3692%OWNER = ();
3693%ITERATORS = ();
3694sub new {
3695    my $pkg = shift;
3696    my $self = Xapianc::new_LatLongCoordsIterator(@_);
3697    bless $self, $pkg if defined($self);
3698}
3699
3700*__eq__ = *Xapianc::LatLongCoordsIterator___eq__;
3701*equal = *Xapianc::LatLongCoordsIterator_equal;
3702*nequal = *Xapianc::LatLongCoordsIterator_nequal;
3703*get_coord = *Xapianc::LatLongCoordsIterator_get_coord;
3704*inc = *Xapianc::LatLongCoordsIterator_inc;
3705sub DESTROY {
3706    return unless $_[0]->isa('HASH');
3707    my $self = tied(%{$_[0]});
3708    return unless defined $self;
3709    delete $ITERATORS{$self};
3710    if (exists $OWNER{$self}) {
3711        Xapianc::delete_LatLongCoordsIterator($self);
3712        delete $OWNER{$self};
3713    }
3714}
3715
3716sub DISOWN {
3717    my $self = shift;
3718    my $ptr = tied(%$self);
3719    delete $OWNER{$ptr};
3720}
3721
3722sub ACQUIRE {
3723    my $self = shift;
3724    my $ptr = tied(%$self);
3725    $OWNER{$ptr} = 1;
3726}
3727
3728
3729############# Class : Xapian::LatLongCoords ##############
3730
3731package Xapian::LatLongCoords;
3732use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3733@ISA = qw( Xapian );
3734%OWNER = ();
3735%ITERATORS = ();
3736*begin = *Xapianc::LatLongCoords_begin;
3737*end = *Xapianc::LatLongCoords_end;
3738*size = *Xapianc::LatLongCoords_size;
3739*empty = *Xapianc::LatLongCoords_empty;
3740*append = *Xapianc::LatLongCoords_append;
3741sub new {
3742    my $pkg = shift;
3743    my $self = Xapianc::new_LatLongCoords(@_);
3744    bless $self, $pkg if defined($self);
3745}
3746
3747*unserialise = *Xapianc::LatLongCoords_unserialise;
3748*serialise = *Xapianc::LatLongCoords_serialise;
3749*get_description = *Xapianc::LatLongCoords_get_description;
3750sub DESTROY {
3751    return unless $_[0]->isa('HASH');
3752    my $self = tied(%{$_[0]});
3753    return unless defined $self;
3754    delete $ITERATORS{$self};
3755    if (exists $OWNER{$self}) {
3756        Xapianc::delete_LatLongCoords($self);
3757        delete $OWNER{$self};
3758    }
3759}
3760
3761sub DISOWN {
3762    my $self = shift;
3763    my $ptr = tied(%$self);
3764    delete $OWNER{$ptr};
3765}
3766
3767sub ACQUIRE {
3768    my $self = shift;
3769    my $ptr = tied(%$self);
3770    $OWNER{$ptr} = 1;
3771}
3772
3773
3774############# Class : Xapian::LatLongMetric ##############
3775
3776package Xapian::LatLongMetric;
3777use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3778@ISA = qw( Xapian );
3779%OWNER = ();
3780%ITERATORS = ();
3781sub DESTROY {
3782    return unless $_[0]->isa('HASH');
3783    my $self = tied(%{$_[0]});
3784    return unless defined $self;
3785    delete $ITERATORS{$self};
3786    if (exists $OWNER{$self}) {
3787        Xapianc::delete_LatLongMetric($self);
3788        delete $OWNER{$self};
3789    }
3790}
3791
3792*pointwise_distance = *Xapianc::LatLongMetric_pointwise_distance;
3793*__call__ = *Xapianc::LatLongMetric___call__;
3794*name = *Xapianc::LatLongMetric_name;
3795sub DISOWN {
3796    my $self = shift;
3797    my $ptr = tied(%$self);
3798    delete $OWNER{$ptr};
3799}
3800
3801sub ACQUIRE {
3802    my $self = shift;
3803    my $ptr = tied(%$self);
3804    $OWNER{$ptr} = 1;
3805}
3806
3807
3808############# Class : Xapian::GreatCircleMetric ##############
3809
3810package Xapian::GreatCircleMetric;
3811use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3812@ISA = qw( Xapian::LatLongMetric Xapian );
3813%OWNER = ();
3814%ITERATORS = ();
3815sub new {
3816    my $pkg = shift;
3817    my $self = Xapianc::new_GreatCircleMetric(@_);
3818    bless $self, $pkg if defined($self);
3819}
3820
3821*pointwise_distance = *Xapianc::GreatCircleMetric_pointwise_distance;
3822*name = *Xapianc::GreatCircleMetric_name;
3823sub DESTROY {
3824    return unless $_[0]->isa('HASH');
3825    my $self = tied(%{$_[0]});
3826    return unless defined $self;
3827    delete $ITERATORS{$self};
3828    if (exists $OWNER{$self}) {
3829        Xapianc::delete_GreatCircleMetric($self);
3830        delete $OWNER{$self};
3831    }
3832}
3833
3834sub DISOWN {
3835    my $self = shift;
3836    my $ptr = tied(%$self);
3837    delete $OWNER{$ptr};
3838}
3839
3840sub ACQUIRE {
3841    my $self = shift;
3842    my $ptr = tied(%$self);
3843    $OWNER{$ptr} = 1;
3844}
3845
3846
3847############# Class : Xapian::LatLongDistancePostingSource ##############
3848
3849package Xapian::LatLongDistancePostingSource;
3850use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3851@ISA = qw( Xapian::ValuePostingSource Xapian );
3852%OWNER = ();
3853%ITERATORS = ();
3854sub new {
3855    my $pkg = shift;
3856    my $self = Xapianc::new_LatLongDistancePostingSource(@_);
3857    bless $self, $pkg if defined($self);
3858}
3859
3860sub DESTROY {
3861    return unless $_[0]->isa('HASH');
3862    my $self = tied(%{$_[0]});
3863    return unless defined $self;
3864    delete $ITERATORS{$self};
3865    if (exists $OWNER{$self}) {
3866        Xapianc::delete_LatLongDistancePostingSource($self);
3867        delete $OWNER{$self};
3868    }
3869}
3870
3871*increment_weight = *Xapianc::LatLongDistancePostingSource_increment_weight;
3872*skip_to = *Xapianc::LatLongDistancePostingSource_skip_to;
3873*check = *Xapianc::LatLongDistancePostingSource_check;
3874*get_weight = *Xapianc::LatLongDistancePostingSource_get_weight;
3875*name = *Xapianc::LatLongDistancePostingSource_name;
3876*init = *Xapianc::LatLongDistancePostingSource_init;
3877*get_description = *Xapianc::LatLongDistancePostingSource_get_description;
3878sub DISOWN {
3879    my $self = shift;
3880    my $ptr = tied(%$self);
3881    delete $OWNER{$ptr};
3882}
3883
3884sub ACQUIRE {
3885    my $self = shift;
3886    my $ptr = tied(%$self);
3887    $OWNER{$ptr} = 1;
3888}
3889
3890
3891############# Class : Xapian::LatLongDistanceKeyMaker ##############
3892
3893package Xapian::LatLongDistanceKeyMaker;
3894use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3895@ISA = qw( Xapian::KeyMaker Xapian );
3896%OWNER = ();
3897%ITERATORS = ();
3898sub new {
3899    my $pkg = shift;
3900    my $self = Xapianc::new_LatLongDistanceKeyMaker(@_);
3901    bless $self, $pkg if defined($self);
3902}
3903
3904sub DESTROY {
3905    return unless $_[0]->isa('HASH');
3906    my $self = tied(%{$_[0]});
3907    return unless defined $self;
3908    delete $ITERATORS{$self};
3909    if (exists $OWNER{$self}) {
3910        Xapianc::delete_LatLongDistanceKeyMaker($self);
3911        delete $OWNER{$self};
3912    }
3913}
3914
3915*__call__ = *Xapianc::LatLongDistanceKeyMaker___call__;
3916sub DISOWN {
3917    my $self = shift;
3918    my $ptr = tied(%$self);
3919    delete $OWNER{$ptr};
3920}
3921
3922sub ACQUIRE {
3923    my $self = shift;
3924    my $ptr = tied(%$self);
3925    $OWNER{$ptr} = 1;
3926}
3927
3928
3929############# Class : Xapian::Database ##############
3930
3931package Xapian::Database;
3932use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
3933@ISA = qw( Xapian );
3934%OWNER = ();
3935%ITERATORS = ();
3936*add_database = *Xapianc::Database_add_database;
3937*size = *Xapianc::Database_size;
3938sub new {
3939    my $pkg = shift;
3940    my $self = Xapianc::new_Database(@_);
3941    bless $self, $pkg if defined($self);
3942}
3943
3944sub DESTROY {
3945    return unless $_[0]->isa('HASH');
3946    my $self = tied(%{$_[0]});
3947    return unless defined $self;
3948    delete $ITERATORS{$self};
3949    if (exists $OWNER{$self}) {
3950        Xapianc::delete_Database($self);
3951        delete $OWNER{$self};
3952    }
3953}
3954
3955*reopen = *Xapianc::Database_reopen;
3956*close = *Xapianc::Database_close;
3957*get_description = *Xapianc::Database_get_description;
3958*postlist_begin = *Xapianc::Database_postlist_begin;
3959*postlist_end = *Xapianc::Database_postlist_end;
3960*termlist_begin = *Xapianc::Database_termlist_begin;
3961*termlist_end = *Xapianc::Database_termlist_end;
3962*has_positions = *Xapianc::Database_has_positions;
3963*positionlist_begin = *Xapianc::Database_positionlist_begin;
3964*positionlist_end = *Xapianc::Database_positionlist_end;
3965*allterms_begin = *Xapianc::Database_allterms_begin;
3966*allterms_end = *Xapianc::Database_allterms_end;
3967*get_doccount = *Xapianc::Database_get_doccount;
3968*get_lastdocid = *Xapianc::Database_get_lastdocid;
3969*get_avlength = *Xapianc::Database_get_avlength;
3970*get_average_length = *Xapianc::Database_get_average_length;
3971*get_total_length = *Xapianc::Database_get_total_length;
3972*get_termfreq = *Xapianc::Database_get_termfreq;
3973*term_exists = *Xapianc::Database_term_exists;
3974*get_collection_freq = *Xapianc::Database_get_collection_freq;
3975*get_value_freq = *Xapianc::Database_get_value_freq;
3976*get_value_lower_bound = *Xapianc::Database_get_value_lower_bound;
3977*get_value_upper_bound = *Xapianc::Database_get_value_upper_bound;
3978*get_doclength_lower_bound = *Xapianc::Database_get_doclength_lower_bound;
3979*get_doclength_upper_bound = *Xapianc::Database_get_doclength_upper_bound;
3980*get_wdf_upper_bound = *Xapianc::Database_get_wdf_upper_bound;
3981*valuestream_begin = *Xapianc::Database_valuestream_begin;
3982*valuestream_end = *Xapianc::Database_valuestream_end;
3983*get_doclength = *Xapianc::Database_get_doclength;
3984*get_unique_terms = *Xapianc::Database_get_unique_terms;
3985*keep_alive = *Xapianc::Database_keep_alive;
3986*get_document = *Xapianc::Database_get_document;
3987*get_spelling_suggestion = *Xapianc::Database_get_spelling_suggestion;
3988*spellings_begin = *Xapianc::Database_spellings_begin;
3989*spellings_end = *Xapianc::Database_spellings_end;
3990*synonyms_begin = *Xapianc::Database_synonyms_begin;
3991*synonyms_end = *Xapianc::Database_synonyms_end;
3992*synonym_keys_begin = *Xapianc::Database_synonym_keys_begin;
3993*synonym_keys_end = *Xapianc::Database_synonym_keys_end;
3994*get_metadata = *Xapianc::Database_get_metadata;
3995*metadata_keys_begin = *Xapianc::Database_metadata_keys_begin;
3996*metadata_keys_end = *Xapianc::Database_metadata_keys_end;
3997*get_uuid = *Xapianc::Database_get_uuid;
3998*locked = *Xapianc::Database_locked;
3999*get_revision = *Xapianc::Database_get_revision;
4000*check = *Xapianc::Database_check;
4001*compact = *Xapianc::Database_compact;
4002sub DISOWN {
4003    my $self = shift;
4004    my $ptr = tied(%$self);
4005    delete $OWNER{$ptr};
4006}
4007
4008sub ACQUIRE {
4009    my $self = shift;
4010    my $ptr = tied(%$self);
4011    $OWNER{$ptr} = 1;
4012}
4013
4014
4015############# Class : Xapian::WritableDatabase ##############
4016
4017package Xapian::WritableDatabase;
4018use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
4019@ISA = qw( Xapian::Database Xapian );
4020%OWNER = ();
4021%ITERATORS = ();
4022sub DESTROY {
4023    return unless $_[0]->isa('HASH');
4024    my $self = tied(%{$_[0]});
4025    return unless defined $self;
4026    delete $ITERATORS{$self};
4027    if (exists $OWNER{$self}) {
4028        Xapianc::delete_WritableDatabase($self);
4029        delete $OWNER{$self};
4030    }
4031}
4032
4033sub new {
4034  my $pkg = shift;
4035  my $self;
4036  if( scalar(@_) == 0 ) {
4037    # For compatibility with Search::Xapian
4038    @_ = ('', $Xapianc::DB_BACKEND_INMEMORY);
4039  }
4040  $self = Xapianc::new_WritableDatabase(@_);
4041  bless $self, $pkg if defined($self);
4042}
4043
4044*commit = *Xapianc::WritableDatabase_commit;
4045*flush = *Xapianc::WritableDatabase_flush;
4046*begin_transaction = *Xapianc::WritableDatabase_begin_transaction;
4047*commit_transaction = *Xapianc::WritableDatabase_commit_transaction;
4048*cancel_transaction = *Xapianc::WritableDatabase_cancel_transaction;
4049*add_document = *Xapianc::WritableDatabase_add_document;
4050*delete_document = *Xapianc::WritableDatabase_delete_document;
4051*delete_document_by_term = *Xapianc::WritableDatabase_delete_document_by_term;
4052*replace_document = *Xapianc::WritableDatabase_replace_document;
4053*replace_document_by_term = *Xapianc::WritableDatabase_replace_document_by_term;
4054*add_spelling = *Xapianc::WritableDatabase_add_spelling;
4055*remove_spelling = *Xapianc::WritableDatabase_remove_spelling;
4056*add_synonym = *Xapianc::WritableDatabase_add_synonym;
4057*remove_synonym = *Xapianc::WritableDatabase_remove_synonym;
4058*clear_synonyms = *Xapianc::WritableDatabase_clear_synonyms;
4059*set_metadata = *Xapianc::WritableDatabase_set_metadata;
4060*get_description = *Xapianc::WritableDatabase_get_description;
4061sub DISOWN {
4062    my $self = shift;
4063    my $ptr = tied(%$self);
4064    delete $OWNER{$ptr};
4065}
4066
4067sub ACQUIRE {
4068    my $self = shift;
4069    my $ptr = tied(%$self);
4070    $OWNER{$ptr} = 1;
4071}
4072
4073
4074# ------- CONSTANT STUBS -------
4075
4076package Xapian;
4077
4078sub OP_AND () { $Xapianc::OP_AND }
4079sub OP_OR () { $Xapianc::OP_OR }
4080sub OP_AND_NOT () { $Xapianc::OP_AND_NOT }
4081sub OP_XOR () { $Xapianc::OP_XOR }
4082sub OP_AND_MAYBE () { $Xapianc::OP_AND_MAYBE }
4083sub OP_FILTER () { $Xapianc::OP_FILTER }
4084sub OP_NEAR () { $Xapianc::OP_NEAR }
4085sub OP_PHRASE () { $Xapianc::OP_PHRASE }
4086sub OP_VALUE_RANGE () { $Xapianc::OP_VALUE_RANGE }
4087sub OP_SCALE_WEIGHT () { $Xapianc::OP_SCALE_WEIGHT }
4088sub OP_ELITE_SET () { $Xapianc::OP_ELITE_SET }
4089sub OP_VALUE_GE () { $Xapianc::OP_VALUE_GE }
4090sub OP_SYNONYM () { $Xapianc::OP_SYNONYM }
4091sub OP_MAX () { $Xapianc::OP_MAX }
4092sub OP_WILDCARD () { $Xapianc::OP_WILDCARD }
4093sub OP_VALUE_LE () { $Xapianc::OP_VALUE_LE }
4094sub OP_INVALID () { $Xapianc::OP_INVALID }
4095sub ENQ_ASCENDING () { $Xapianc::ENQ_ASCENDING }
4096sub ENQ_DESCENDING () { $Xapianc::ENQ_DESCENDING }
4097sub ENQ_DONT_CARE () { $Xapianc::ENQ_DONT_CARE }
4098sub FLAG_BOOLEAN () { $Xapianc::FLAG_BOOLEAN }
4099sub FLAG_PHRASE () { $Xapianc::FLAG_PHRASE }
4100sub FLAG_LOVEHATE () { $Xapianc::FLAG_LOVEHATE }
4101sub FLAG_BOOLEAN_ANY_CASE () { $Xapianc::FLAG_BOOLEAN_ANY_CASE }
4102sub FLAG_WILDCARD () { $Xapianc::FLAG_WILDCARD }
4103sub FLAG_PURE_NOT () { $Xapianc::FLAG_PURE_NOT }
4104sub FLAG_PARTIAL () { $Xapianc::FLAG_PARTIAL }
4105sub FLAG_SPELLING_CORRECTION () { $Xapianc::FLAG_SPELLING_CORRECTION }
4106sub FLAG_SYNONYM () { $Xapianc::FLAG_SYNONYM }
4107sub FLAG_AUTO_SYNONYMS () { $Xapianc::FLAG_AUTO_SYNONYMS }
4108sub FLAG_AUTO_MULTIWORD_SYNONYMS () { $Xapianc::FLAG_AUTO_MULTIWORD_SYNONYMS }
4109sub FLAG_CJK_NGRAM () { $Xapianc::FLAG_CJK_NGRAM }
4110sub FLAG_DEFAULT () { $Xapianc::FLAG_DEFAULT }
4111sub STEM_NONE () { $Xapianc::STEM_NONE }
4112sub STEM_SOME () { $Xapianc::STEM_SOME }
4113sub STEM_SOME_FULL_POS () { $Xapianc::STEM_SOME_FULL_POS }
4114sub STEM_ALL () { $Xapianc::STEM_ALL }
4115sub STEM_ALL_Z () { $Xapianc::STEM_ALL_Z }
4116sub FLAG_SPELLING () { $Xapianc::FLAG_SPELLING }
4117sub WILDCARD_LIMIT_ERROR () { $Xapianc::WILDCARD_LIMIT_ERROR }
4118sub WILDCARD_LIMIT_FIRST () { $Xapianc::WILDCARD_LIMIT_FIRST }
4119sub WILDCARD_LIMIT_MOST_FREQUENT () { $Xapianc::WILDCARD_LIMIT_MOST_FREQUENT }
4120sub BAD_VALUENO () { $Xapianc::BAD_VALUENO }
4121sub DB_CREATE () { $Xapianc::DB_CREATE }
4122sub DB_CREATE_OR_OPEN () { $Xapianc::DB_CREATE_OR_OPEN }
4123sub DB_CREATE_OR_OVERWRITE () { $Xapianc::DB_CREATE_OR_OVERWRITE }
4124sub DB_OPEN () { $Xapianc::DB_OPEN }
4125sub DB_NO_SYNC () { $Xapianc::DB_NO_SYNC }
4126sub DB_FULL_SYNC () { $Xapianc::DB_FULL_SYNC }
4127sub DB_DANGEROUS () { $Xapianc::DB_DANGEROUS }
4128sub DB_NO_TERMLIST () { $Xapianc::DB_NO_TERMLIST }
4129sub DB_BACKEND_CHERT () { $Xapianc::DB_BACKEND_CHERT }
4130sub DB_BACKEND_GLASS () { $Xapianc::DB_BACKEND_GLASS }
4131sub DB_BACKEND_INMEMORY () { $Xapianc::DB_BACKEND_INMEMORY }
4132sub DB_BACKEND_STUB () { $Xapianc::DB_BACKEND_STUB }
4133sub DB_RETRY_LOCK () { $Xapianc::DB_RETRY_LOCK }
4134sub DBCHECK_SHORT_TREE () { $Xapianc::DBCHECK_SHORT_TREE }
4135sub DBCHECK_FULL_TREE () { $Xapianc::DBCHECK_FULL_TREE }
4136sub DBCHECK_SHOW_FREELIST () { $Xapianc::DBCHECK_SHOW_FREELIST }
4137sub DBCHECK_SHOW_STATS () { $Xapianc::DBCHECK_SHOW_STATS }
4138sub DBCHECK_FIX () { $Xapianc::DBCHECK_FIX }
4139sub DBCOMPACT_MULTIPASS () { $Xapianc::DBCOMPACT_MULTIPASS }
4140sub DBCOMPACT_NO_RENUMBER () { $Xapianc::DBCOMPACT_NO_RENUMBER }
4141sub DBCOMPACT_SINGLE_FILE () { $Xapianc::DBCOMPACT_SINGLE_FILE }
4142sub DOC_ASSUME_VALID () { $Xapianc::DOC_ASSUME_VALID }
4143sub RP_SUFFIX () { $Xapianc::RP_SUFFIX }
4144sub RP_REPEATED () { $Xapianc::RP_REPEATED }
4145sub RP_DATE_PREFER_MDY () { $Xapianc::RP_DATE_PREFER_MDY }
4146
4147# ------- VARIABLE STUBS --------
4148
4149package Xapian;
4150
4151
4152package Xapian;
4153
4154our $VERSION = "1.4.18.0";
4155
4156# We need to use the RTLD_GLOBAL flag to dlopen() so that other C++
4157# modules that link against libxapian.so get the *same* value for all the
4158# weak symbols (eg, the exception classes)
4159sub dl_load_flags { 0x01 }
4160
4161# Items to export into caller's namespace by default. Note: do not export
4162# names by default without a very good reason. Use EXPORT_OK instead.
4163# Do not simply export all your public functions/methods/constants.
4164
4165# This allows declaration use Xapian ':all';
4166# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
4167# will save memory.
4168our %EXPORT_TAGS = (
4169		    'ops' => [ qw(
4170				  OP_AND
4171				  OP_OR
4172				  OP_AND_NOT
4173				  OP_XOR
4174				  OP_AND_MAYBE
4175				  OP_FILTER
4176				  OP_NEAR
4177				  OP_PHRASE
4178				  OP_VALUE_RANGE
4179				  OP_SCALE_WEIGHT
4180				  OP_ELITE_SET
4181				  OP_VALUE_GE
4182				  OP_VALUE_LE
4183				 ) ],
4184		    'db' => [ qw(
4185				 DB_OPEN
4186				 DB_CREATE
4187				 DB_CREATE_OR_OPEN
4188				 DB_CREATE_OR_OVERWRITE
4189				 ) ],
4190		    'enq_order' => [ qw(
4191				 ENQ_DESCENDING
4192				 ENQ_ASCENDING
4193				 ENQ_DONT_CARE
4194				   ) ],
4195		    'qpflags' => [ qw(
4196				 FLAG_BOOLEAN
4197				 FLAG_PHRASE
4198				 FLAG_LOVEHATE
4199				 FLAG_BOOLEAN_ANY_CASE
4200				 FLAG_WILDCARD
4201				 FLAG_PURE_NOT
4202				 FLAG_PARTIAL
4203				 FLAG_SPELLING_CORRECTION
4204				 FLAG_SYNONYM
4205				 FLAG_AUTO_SYNONYMS
4206				 FLAG_AUTO_MULTIWORD_SYNONYMS
4207				 FLAG_CJK_NGRAM
4208				 FLAG_DEFAULT
4209				 ) ],
4210		    'qpstem' => [ qw(
4211				 STEM_NONE
4212				 STEM_SOME
4213				 STEM_SOME_FULL_POS
4214				 STEM_ALL
4215				 STEM_ALL_Z
4216				 ) ]
4217		   );
4218$EXPORT_TAGS{standard} = [ @{ $EXPORT_TAGS{'ops'} },
4219			   @{ $EXPORT_TAGS{'db'} },
4220			   @{ $EXPORT_TAGS{'qpflags'} },
4221			   @{ $EXPORT_TAGS{'qpstem'} } ];
4222$EXPORT_TAGS{all} = [ @{ $EXPORT_TAGS{'standard'} }, @{ $EXPORT_TAGS{'enq_order'} } ];
4223
4224our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
4225
4226# Preloaded methods go here.
4227
4228our @OP_NAMES;
4229foreach (@{ $EXPORT_TAGS{'ops'} }) {
4230  $OP_NAMES[eval $_] = $_;
4231}
4232
4233our @DB_NAMES;
4234foreach (@{ $EXPORT_TAGS{'db'} }) {
4235  $DB_NAMES[eval $_] = $_;
4236}
4237
4238our @FLAG_NAMES;
4239foreach (@{ $EXPORT_TAGS{'qpflags'} }) {
4240  $FLAG_NAMES[eval $_] = $_;
4241}
4242
4243our @STEM_NAMES;
4244foreach (@{ $EXPORT_TAGS{'qpstem'} }) {
4245  $STEM_NAMES[eval $_] = $_;
4246}
4247
4248# Compatibility wrapping for Xapian::BAD_VALUENO (wrapped as a constant since
4249# xapian-bindings 1.4.10).
4250our $BAD_VALUENO = BAD_VALUENO;
4251
4252sub search_xapian_compat {
4253    *Search::Xapian:: = \%Xapian::;
4254    *Search::Xapian::VERSION = \$VERSION;
4255    *Search::Xapian::OP_NAMES = \@OP_NAMES;
4256    *Search::Xapian::DB_NAMES = \@DB_NAMES;
4257    *Search::Xapian::FLAG_NAMES = \@FLAG_NAMES;
4258    *Search::Xapian::STEM_NAMES = \@STEM_NAMES;
4259    *Search::Xapian::BAD_VALUENO = \&BAD_VALUENO;
4260    *Search::Xapian::DB_OPEN = \&DB_OPEN;
4261    *Search::Xapian::DB_CREATE = \&DB_CREATE;
4262    *Search::Xapian::DB_CREATE_OR_OPEN = \&DB_CREATE_OR_OPEN;
4263    *Search::Xapian::DB_CREATE_OR_OVERWRITE = \&DB_CREATE_OR_OVERWRITE;
4264    *Search::Xapian::version_string = \&version_string;
4265    *Search::Xapian::major_version = \&major_version;
4266    *Search::Xapian::minor_version = \&minor_version;
4267    *Search::Xapian::revision = \&revision;
4268    *Search::Xapian::sortable_serialise = \&sortable_serialise;
4269    *Search::Xapian::sortable_unserialise = \&sortable_unserialise;
4270}
4271
4272package Xapian::Database;
4273sub enquire {
4274  my $self = shift;
4275  my $enquire = Xapian::Enquire->new( $self );
4276  if( @_ ) {
4277    $enquire->set_query( @_ );
4278  }
4279  return $enquire;
4280}
4281
4282package Xapian::Enquire;
4283sub matches {
4284  my $self = shift;
4285  return $self->get_mset(@_)->items();
4286}
4287
4288package Xapian::ESet;
4289sub items {
4290  my $self = shift;
4291  my @array;
4292  tie( @array, 'Xapian::ESet', $self );
4293  return @array;
4294}
4295
4296use overload '++' => sub { $_[0]->inc() },
4297	     '--' => sub { $_[0]->dec() },
4298	     '='  => sub { $_[0]->clone() },
4299	     'eq' => sub { $_[0]->equal($_[1]) },
4300	     'ne' => sub { $_[0]->nequal($_[1]) },
4301	     '==' => sub { $_[0]->equal($_[1]) },
4302	     '!=' => sub { $_[0]->nequal($_[1]) },
4303	     'fallback' => 1;
4304
4305sub clone() {
4306  my $self = shift;
4307  my $class = ref( $self );
4308  my $copy = new( $self );
4309  bless $copy, $class;
4310  return $copy;
4311}
4312
4313sub TIEARRAY {
4314  my $class = shift;
4315  my $eset = shift;
4316  return bless $eset, $class;
4317}
4318
4319sub FETCHSIZE {
4320    my $self = shift;
4321    return $self->size();
4322}
4323
4324package Xapian::ESetIterator;
4325use overload '++' => sub { $_[0]->inc() },
4326	     '--' => sub { $_[0]->dec() },
4327	     '='  => sub { $_[0]->clone() },
4328	     'eq' => sub { $_[0]->equal($_[1]) },
4329	     'ne' => sub { $_[0]->nequal($_[1]) },
4330	     '==' => sub { $_[0]->equal($_[1]) },
4331	     '!=' => sub { $_[0]->nequal($_[1]) },
4332	     'fallback' => 1;
4333
4334sub clone() {
4335  my $self = shift;
4336  my $class = ref( $self );
4337  my $copy = new( $self );
4338  bless $copy, $class;
4339  return $copy;
4340}
4341
4342package Xapian::MSet;
4343sub items {
4344  my $self = shift;
4345  my @array;
4346  tie( @array, 'Xapian::MSet::Tied', $self );
4347  return @array;
4348}
4349
4350sub TIEARRAY {
4351  my $class = shift;
4352  my $mset = shift;
4353  return bless $mset, $class;
4354}
4355
4356sub FETCHSIZE {
4357    my $self = shift;
4358    return $self->size();
4359}
4360
4361package Xapian::MSetIterator;
4362use overload '++' => sub { $_[0]->inc() },
4363	     '--' => sub { $_[0]->dec() },
4364	     '='  => sub { $_[0]->clone() },
4365	     'eq' => sub { $_[0]->equal($_[1]) },
4366	     'ne' => sub { $_[0]->nequal($_[1]) },
4367	     '==' => sub { $_[0]->equal($_[1]) },
4368	     '!=' => sub { $_[0]->nequal($_[1]) },
4369	     'fallback' => 1;
4370
4371sub clone() {
4372  my $self = shift;
4373  my $class = ref( $self );
4374  bless $self, $class;
4375  return $self;
4376}
4377
4378package Xapian::MSet::Tied;
4379our @ISA = qw(Xapian::MSet);
4380
4381package Xapian::PositionIterator;
4382use overload '++' => sub { $_[0]->inc() },
4383	     '='  => sub { $_[0]->clone() },
4384	     'eq' => sub { $_[0]->equal($_[1]) },
4385	     'ne' => sub { $_[0]->nequal($_[1]) },
4386	     '==' => sub { $_[0]->equal($_[1]) },
4387	     '!=' => sub { $_[0]->nequal($_[1]) },
4388	     'fallback' => 1;
4389
4390sub clone() {
4391  my $self = shift;
4392  my $class = ref( $self );
4393  my $copy = new( $self );
4394  bless $copy, $class;
4395  return $copy;
4396}
4397
4398package Xapian::PostingIterator;
4399use overload '++' => sub { $_[0]->inc() },
4400	     '='  => sub { $_[0]->clone() },
4401	     'eq' => sub { $_[0]->equal($_[1]) },
4402	     'ne' => sub { $_[0]->nequal($_[1]) },
4403	     '==' => sub { $_[0]->equal($_[1]) },
4404	     '!=' => sub { $_[0]->nequal($_[1]) },
4405	     'fallback' => 1;
4406
4407sub clone() {
4408  my $self = shift;
4409  my $class = ref( $self );
4410  my $copy = new( $self );
4411  bless $copy, $class;
4412  return $copy;
4413}
4414
4415package Xapian::TermGenerator;
4416sub set_stopper {
4417    my ($self, $stopper) = @_;
4418    $self{_stopper} = $stopper;
4419    set_stopper1( @_ );
4420}
4421
4422package Xapian::TermIterator;
4423use overload '++' => sub { $_[0]->inc() },
4424	     '='  => sub { $_[0]->clone() },
4425	     'eq' => sub { $_[0]->equal($_[1]) },
4426	     'ne' => sub { $_[0]->nequal($_[1]) },
4427	     '==' => sub { $_[0]->equal($_[1]) },
4428	     '!=' => sub { $_[0]->nequal($_[1]) },
4429	     'fallback' => 1;
4430
4431sub clone() {
4432  my $self = shift;
4433  my $class = ref( $self );
4434  my $copy = new( $self );
4435  bless $copy, $class;
4436  return $copy;
4437}
4438
4439package Xapian::ValueIterator;
4440use overload '++' => sub { $_[0]->inc() },
4441	     '='  => sub { $_[0]->clone() },
4442	     'eq' => sub { $_[0]->equal($_[1]) },
4443	     'ne' => sub { $_[0]->nequal($_[1]) },
4444	     '==' => sub { $_[0]->equal($_[1]) },
4445	     '!=' => sub { $_[0]->nequal($_[1]) },
4446	     'fallback' => 1;
4447
4448sub clone() {
4449  my $self = shift;
4450  my $class = ref( $self );
4451  my $copy = new( $self );
4452  bless $copy, $class;
4453  return $copy;
4454}
4455
4456# Adding CLONE_SKIP functions
4457package Xapian::LogicError;
4458sub CLONE_SKIP { 1 }
4459package Xapian::PositionIterator;
4460sub CLONE_SKIP { 1 }
4461package Xapian::PostingIterator;
4462sub CLONE_SKIP { 1 }
4463package Xapian::TermIterator;
4464sub CLONE_SKIP { 1 }
4465package Xapian::ValueIterator;
4466sub CLONE_SKIP { 1 }
4467package Xapian::Document;
4468sub CLONE_SKIP { 1 }
4469package Xapian::PostingSource;
4470sub CLONE_SKIP { 1 }
4471package Xapian::ValuePostingSource;
4472sub CLONE_SKIP { 1 }
4473package Xapian::ValueWeightPostingSource;
4474sub CLONE_SKIP { 1 }
4475package Xapian::ValueMapPostingSource;
4476sub CLONE_SKIP { 1 }
4477package Xapian::FixedWeightPostingSource;
4478sub CLONE_SKIP { 1 }
4479package Xapian::MSet;
4480sub CLONE_SKIP { 1 }
4481package Xapian::MSetIterator;
4482sub CLONE_SKIP { 1 }
4483package Xapian::ESet;
4484sub CLONE_SKIP { 1 }
4485package Xapian::ESetIterator;
4486sub CLONE_SKIP { 1 }
4487package Xapian::RSet;
4488sub CLONE_SKIP { 1 }
4489package Xapian::MatchDecider;
4490sub CLONE_SKIP { 1 }
4491package Xapian::Enquire;
4492sub CLONE_SKIP { 1 }
4493package Xapian::Weight;
4494sub CLONE_SKIP { 1 }
4495package Xapian::BoolWeight;
4496sub CLONE_SKIP { 1 }
4497package Xapian::BM25Weight;
4498sub CLONE_SKIP { 1 }
4499package Xapian::TradWeight;
4500sub CLONE_SKIP { 1 }
4501package Xapian::Database;
4502sub CLONE_SKIP { 1 }
4503package Xapian::WritableDatabase;
4504sub CLONE_SKIP { 1 }
4505package Xapian::Query;
4506sub MatchAll { Xapianc::new_Query('') }
4507sub MatchNothing { Xapianc::new_Query() }
4508sub CLONE_SKIP { 1 }
4509package Xapian::Stopper;
4510sub CLONE_SKIP { 1 }
4511package Xapian::SimpleStopper;
4512sub CLONE_SKIP { 1 }
4513package Xapian::RangeProcessor;
4514sub CLONE_SKIP { 1 }
4515package Xapian::DateRangeProcessor;
4516sub CLONE_SKIP { 1 }
4517package Xapian::NumberRangeProcessor;
4518sub CLONE_SKIP { 1 }
4519package Xapian::ValueRangeProcessor;
4520sub CLONE_SKIP { 1 }
4521package Xapian::StringValueRangeProcessor;
4522sub CLONE_SKIP { 1 }
4523package Xapian::DateValueRangeProcessor;
4524sub CLONE_SKIP { 1 }
4525package Xapian::NumberValueRangeProcessor;
4526sub CLONE_SKIP { 1 }
4527package Xapian::FieldProcessor;
4528sub CLONE_SKIP { 1 }
4529package Xapian::QueryParser;
4530sub CLONE_SKIP { 1 }
4531package Xapian::Stem;
4532sub CLONE_SKIP { 1 }
4533package Xapian::TermGenerator;
4534sub CLONE_SKIP { 1 }
4535package Xapian::Sorter;
4536sub CLONE_SKIP { 1 }
4537package Xapian::MultiValueSorter;
4538sub CLONE_SKIP { 1 }
4539package Xapian::ReplicationInfo;
4540sub CLONE_SKIP { 1 }
4541package Xapian::DatabaseMaster;
4542sub CLONE_SKIP { 1 }
4543package Xapian::DatabaseReplica;
4544sub CLONE_SKIP { 1 }
4545package Xapian::ValueSetMatchDecider;
4546sub CLONE_SKIP { 1 }
4547package Xapian::SerialisationContext;
4548sub CLONE_SKIP { 1 }
4549package Xapian::MSet::Tied;
4550sub CLONE_SKIP { 1 }
4551
4552# Pod document of Xapian
4553=encoding utf8
4554=head1 NAME
4555
4556Xapian - Perl frontend to the Xapian C++ search library.
4557
4558=head1 SYNOPSIS
4559
4560  use Xapian;
4561
4562  my $parser = Xapian::QueryParser->new();
4563  my $query = $parser->parse_query( '[QUERY STRING]' );
4564
4565  my $db = Xapian::Database->new( '[DATABASE DIR]' );
4566  my $enq = $db->enquire();
4567
4568  printf "Running query '%s'\n", $query->get_description();
4569
4570  $enq->set_query( $query );
4571  my @matches = $enq->matches(0, 10);
4572
4573  print scalar(@matches) . " results found\n";
4574
4575  foreach my $match ( @matches ) {
4576    my $doc = $match->get_document();
4577    printf "ID %d %d%% [ %s ]\n", $match->get_docid(), $match->get_percent(), $doc->get_data();
4578  }
4579
4580=head1 DESCRIPTION
4581
4582This module is a pretty-much complete wrapping of the Xapian C++ API.  The
4583main omissions are features which aren't useful to wrap for Perl, such as
4584Xapian::UTF8Iterator.
4585
4586This module is generated using SWIG.  It is intended as a replacement for
4587the older Search::Xapian module which is easier to keep up to date and
4588which more completely wraps the C++ API.  It is largely compatible with
4589Search::Xapian, but see the COMPATIBILITY section below if you have code using
4590Search::Xapian which you want to get working with this new module.
4591
4592There are some gaps in the POD documentation for wrapped classes, but you
4593can read the Xapian C++ API documentation at
4594L<https://xapian.org/docs/apidoc/html/annotated.html> for details of
4595these.  Alternatively, take a look at the code in the examples and tests.
4596
4597If you want to use Xapian and the threads module together, make
4598sure you're using Perl >= 5.8.7 as then Xapian uses CLONE_SKIP to make sure
4599that the perl wrapper objects aren't copied to new threads - without this the
4600underlying C++ objects can get destroyed more than once which leads to
4601undefined behaviour.
4602
4603If you encounter problems, or have any comments, suggestions, patches, etc
4604please email the Xapian-discuss mailing list (details of which can be found at
4605L<https://xapian.org/lists>).
4606
4607=head2 COMPATIBILITY
4608
4609This module is mostly compatible with Search::Xapian.  The following are known
4610differences, with details of how to write code which works with both.
4611
4612Search::Xapian overloads stringification - e.g. C<"$query"> is equivalent to
4613C<$query->get_description()>, while C<"$termiterator"> is equivalent to
4614C<$termiterator->get_term()>.  This module doesn't support overloaded
4615stringification, so you should instead explicitly call the method you
4616want.  The technical reason for this change is that stringification is hard to
4617support in SWIG-generated bindings, but this context-sensitive stringification
4618where the operation performed depends on the object type seems unhelpful in
4619hindsight anyway.
4620
4621Search::Xapian overloads conversion to an integer for some classes - e.g.
4622C<0+$positioniterator> is equivalent to C<$positioniterator->get_termpos>
4623while C<0+$postingiterator> is equivalent to C<$postingiterator->get_docid>.
4624This module doesn't provide these overloads so you should instead explicitly
4625call the method you want.  As above, we think this context-sensitive behaviour
4626wasn't helpful in hindsight.
4627
4628This module is fussier about whether a passed scalar value is a string or
4629an integer than Search::Xapian, so e.g. C<Xapian::Query->new(2001)> will fail
4630but the equivalent worked with Search::Xapian.  If C<$term> might not be a
4631string use C<Xapian::Query->new("$term")> to ensure it is converted to a
4632string.  The new behaviour isn't very Perlish, but is likely to be hard to
4633address universally as it comes from SWIG.  Let us know if you find particular
4634places where it's annoying and we can look at addressing those.
4635
4636Both this module and Search::Xapian support passing a Perl sub (which can be
4637anonymous) for the functor classes C<MatchDecider> and C<ExpandDecider>.  In
4638some cases Search::Xapian accepts a string naming a Perl sub, but this module
4639never accepts this.  Instead of passing C<"::mymatchdecider">, pass
4640C<\&mymatchdecider> which will work with either module.  If you really want to
4641dynamically specify the function name, you can pass C<sub {eval
4642"&$dynamicmatchdecider"}>.
4643
4644Search::Xapian provides a PerlStopper class which is supposed to be
4645subclassable in Perl to implement your own stopper, but this mechanism doesn't
4646actually seem to work.  This module instead supports user-implemented stoppers
4647by accepting a Perl sub in place of a Stopper object.
4648
4649=head3 Importing Either Module
4650
4651If you want your code to use either this module or Search::Xapian depending
4652what's installed, then instead of C<use Search::Xapian (':all');> you can use:
4653
4654  BEGIN {
4655    eval {
4656      require Xapian;
4657      Xapian->import(':all');
4658      Xapian::search_xapian_compat();
4659    };
4660    if ($@) {
4661      require Search::Xapian;
4662      Search::Xapian->import(':all');
4663    }
4664  }
4665
4666If you just C<use Search::Xapian;> then the C<import()> calls aren't needed.
4667
4668The C<Xapian::search_xapian_compat()> call sets up aliases in the
4669C<Search::Xapian> namespace so you can write code which refers to
4670C<Search::Xapian> but can actually use this module instead.
4671
4672=head2 EXPORT
4673
4674None by default.
4675
4676=head1 :db
4677
4678=over 4
4679
4680=item DB_OPEN
4681
4682Open a database, fail if database doesn't exist.
4683
4684=item DB_CREATE
4685
4686Create a new database, fail if database exists.
4687
4688=item DB_CREATE_OR_OPEN
4689
4690Open an existing database, without destroying data, or create a new
4691database if one doesn't already exist.
4692
4693=item DB_CREATE_OR_OVERWRITE
4694
4695Overwrite database if it exists.
4696
4697=back
4698
4699=head1 :ops
4700
4701=over 4
4702
4703=item OP_AND
4704
4705Match if both subqueries are satisfied.
4706
4707=item OP_OR
4708
4709Match if either subquery is satisfied.
4710
4711=item OP_AND_NOT
4712
4713Match if left but not right subquery is satisfied.
4714
4715=item OP_XOR
4716
4717Match if left or right, but not both queries are satisfied.
4718
4719=item OP_AND_MAYBE
4720
4721Match if left is satisfied, but use weights from both.
4722
4723=item OP_FILTER
4724
4725Like OP_AND, but only weight using the left query.
4726
4727=item OP_NEAR
4728
4729Match if the words are near each other. The window should be specified, as
4730a parameter to C<Xapian::Query->new()>, but it defaults to the
4731number of terms in the list.
4732
4733=item OP_PHRASE
4734
4735Match as a phrase (All words in order).
4736
4737=item OP_ELITE_SET
4738
4739Select an elite set from the subqueries, and perform a query with these combined as an OR query.
4740
4741=item OP_VALUE_RANGE
4742
4743Filter by a range test on a document value.
4744
4745=back
4746
4747=head1 :qpflags
4748
4749=over 4
4750
4751=item FLAG_DEFAULT
4752
4753This gives the QueryParser default flag settings, allowing you to easily add
4754flags to the default ones.
4755
4756=item FLAG_BOOLEAN
4757
4758Support AND, OR, etc and bracketted subexpressions.
4759
4760=item FLAG_LOVEHATE
4761
4762Support + and -.
4763
4764=item FLAG_PHRASE
4765
4766Support quoted phrases.
4767
4768=item FLAG_BOOLEAN_ANY_CASE
4769
4770Support AND, OR, etc even if they aren't in ALLCAPS.
4771
4772=item FLAG_WILDCARD
4773
4774Support right truncation (e.g. Xap*).
4775
4776=item FLAG_PURE_NOT
4777
4778Allow queries such as 'NOT apples'.
4779
4780These require the use of a list of all documents in the database
4781which is potentially expensive, so this feature isn't enabled by
4782default.
4783
4784=item FLAG_PARTIAL
4785
4786Enable partial matching.
4787
4788Partial matching causes the parser to treat the query as a
4789"partially entered" search.  This will automatically treat the
4790final word as a wildcarded match, unless it is followed by
4791whitespace, to produce more stable results from interactive
4792searches.
4793
4794=item FLAG_SPELLING_CORRECTION
4795
4796=item FLAG_SYNONYM
4797
4798=item FLAG_AUTO_SYNONYMS
4799
4800=item FLAG_AUTO_MULTIWORD_SYNONYMS
4801
4802=back
4803
4804=head1 :qpstem
4805
4806=over 4
4807
4808=item STEM_ALL
4809
4810Stem all terms.
4811
4812=item STEM_ALL_Z
4813
4814Stem all terms and add a "Z" prefix.
4815
4816=item STEM_NONE
4817
4818Don't stem any terms.
4819
4820=item STEM_SOME
4821
4822Stem some terms, in a manner compatible with Omega (capitalised words and those
4823in phrases aren't stemmed).
4824
4825=item STEM_SOME_FULL_POS
4826
4827Like STEM_SOME but also store term positions for stemmed terms.
4828
4829=back
4830
4831=head1 :enq_order
4832
4833=over 4
4834
4835=item ENQ_ASCENDING
4836
4837docids sort in ascending order (default)
4838
4839=item ENQ_DESCENDING
4840
4841docids sort in descending order
4842
4843=item ENQ_DONT_CARE
4844
4845docids sort in whatever order is most efficient for the backend
4846
4847=back
4848
4849=head1 :standard
4850
4851Standard is db + ops + qpflags + qpstem
4852
4853=head1 Version functions
4854
4855=over 4
4856
4857=item major_version
4858
4859Returns the major version of the Xapian C++ library being used.  E.g. for
4860Xapian 1.4.15 this would return 1.
4861
4862=item minor_version
4863
4864Returns the minor version of the Xapian C++ library being used.  E.g. for
4865Xapian 1.4.15 this would return 4.
4866
4867=item revision
4868
4869Returns the revision of the Xapian C++ library being used.  E.g. for
4870Xapian 1.4.15 this would return 15.  In a stable release series, Xapian
4871libraries with the same minor and major versions are usually ABI compatible, so
4872this often won't match the third component of C<$Xapian::VERSION> (which is the
4873version of the Xapian wrappers).
4874
4875=back
4876
4877=head1 Numeric encoding functions
4878
4879=over 4
4880
4881=item sortable_serialise NUMBER
4882
4883Convert a floating point number to a string, preserving sort order.
4884
4885This method converts a floating point number to a string, suitable for
4886using as a value for numeric range restriction, or for use as a sort
4887key.
4888
4889The conversion is platform independent.
4890
4891The conversion attempts to ensure that, for any pair of values supplied
4892to the conversion algorithm, the result of comparing the original
4893values (with a numeric comparison operator) will be the same as the
4894result of comparing the resulting values (with a string comparison
4895operator).  On platforms which represent doubles with the precisions
4896specified by IEEE_754, this will be the case: if the representation of
4897doubles is more precise, it is possible that two very close doubles
4898will be mapped to the same string, so will compare equal.
4899
4900Note also that both zero and -zero will be converted to the same
4901representation: since these compare equal, this satisfies the
4902comparison constraint, but it's worth knowing this if you wish to use
4903the encoding in some situation where this distinction matters.
4904
4905Handling of NaN isn't (currently) guaranteed to be sensible.
4906
4907=item sortable_unserialise SERIALISED_NUMBER
4908
4909Convert a string encoded using sortable_serialise back to a floating
4910point number.
4911
4912This expects the input to be a string produced by C<sortable_serialise()>.
4913If the input is not such a string, the value returned is undefined (but
4914no error will be thrown).
4915
4916The result of the conversion will be exactly the value which was
4917supplied to C<sortable_serialise()> when making the string on platforms
4918which represent doubles with the precisions specified by IEEE_754, but
4919may be a different (nearby) value on other platforms.
4920
4921=back
4922
4923=head1 TODO
4924
4925=over 4
4926
4927=item Documentation
4928
4929Add POD documentation for all classes, where possible just adapted from Xapian
4930docs.
4931
4932=item Unwrapped classes
4933
4934The following Xapian classes are not yet wrapped:
4935ErrorHandler, user-defined Weight subclasses.
4936
4937=back
4938
4939=head1 CREDITS
4940
4941These SWIG-generated Perl bindings were originally implemented by Kosei
4942Moriyama in GSoC 2009, and made their debut in the 1.2.4 release.
4943
4944They take a lot of inspiration and some code from Search::Xapian, a set
4945of hand-written XS bindings, originally written by Alex Bowley, and later
4946maintained by Olly Betts.
4947
4948Search::Xapian owed thanks to Tye McQueen E<lt>tye@metronet.comE<gt> for
4949explaining the finer points of how best to write XS frontends to C++ libraries,
4950and James Aylett E<lt>james@tartarus.orgE<gt> for clarifying the less obvious
4951aspects of the Xapian API.  Patches for wrapping missing classes and other
4952things were contributed by Olly Betts, Tim Brody, Marcus Ramberg, Peter Karman,
4953Benjamin Smith, Rusty Conover, Frank Lichtenheld, Henry Combrinck, Jess
4954Robinson, David F. Skoll, Dave O'Neill, Andreas Marienborg, Adam Sjøgren,
4955Dmitry Karasik, and Val Rosca.
4956
4957=head1 AUTHOR
4958
4959Please report any bugs/suggestions to E<lt>xapian-discuss@lists.xapian.orgE<gt>
4960or use the Xapian bug tracker L<https://xapian.org/bugs>.  Please do
4961NOT use the CPAN bug tracker or mail contributors individually.
4962
4963=head1 LICENSE
4964
4965This program is free software; you can redistribute it and/or modify
4966it under the same terms as Perl itself.
4967
4968=head1 SEE ALSO
4969
4970L<Xapian::BM25Weight>,
4971L<Xapian::BoolWeight>,
4972L<Xapian::Database>,
4973L<Xapian::Document>,
4974L<Xapian::Enquire>,
4975L<Xapian::MultiValueSorter>,
4976L<Xapian::PositionIterator>,
4977L<Xapian::PostingIterator>,
4978L<Xapian::Query>,
4979L<Xapian::QueryParser>,
4980L<Xapian::Stem>,
4981L<Xapian::TermGenerator>,
4982L<Xapian::TermIterator>,
4983L<Xapian::TradWeight>,
4984L<Xapian::ValueIterator>,
4985L<Xapian::Weight>,
4986L<Xapian::WritableDatabase>,
4987and
4988L<https://xapian.org/>.
4989
4990=cut
49911;
4992