1<?php 2 3/* ---------------------------------------------------------------------------- 4 * This file was automatically generated by SWIG (http://www.swig.org). 5 * Version 2.0.5 6 * 7 * This file is not intended to be easily readable and contains a number of 8 * coding conventions designed to improve portability and efficiency. Do not make 9 * changes to this file unless you know what you are doing--modify the SWIG 10 * interface file instead. 11 * ----------------------------------------------------------------------------- */ 12 13// Try to load our extension if it's not already loaded. 14if (!extension_loaded('xapian')) { 15 if (strtolower(substr(PHP_OS, 0, 3)) === 'win') { 16 if (!dl('php_xapian.dll')) return; 17 } else { 18 // PHP_SHLIB_SUFFIX gives 'dylib' on MacOS X but modules are 'so'. 19 if (PHP_SHLIB_SUFFIX === 'dylib') { 20 if (!dl('xapian.so')) return; 21 } else { 22 if (!dl('xapian.'.PHP_SHLIB_SUFFIX)) return; 23 } 24 } 25} 26 27 28 29abstract class Xapian { 30 static function BAD_VALUENO_get() { 31 return BAD_VALUENO_get(); 32 } 33 34 static function version_string() { 35 return version_string(); 36 } 37 38 static function major_version() { 39 return major_version(); 40 } 41 42 static function minor_version() { 43 return minor_version(); 44 } 45 46 static function revision() { 47 return revision(); 48 } 49 50 const DB_CREATE_OR_OPEN = DB_CREATE_OR_OPEN; 51 52 const DB_CREATE = DB_CREATE; 53 54 const DB_CREATE_OR_OVERWRITE = DB_CREATE_OR_OVERWRITE; 55 56 const DB_OPEN = DB_OPEN; 57 58 static function auto_open_stub($file) { 59 $r=auto_open_stub($file); 60 if (is_resource($r)) { 61 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 62 if (class_exists($c)) return new $c($r); 63 return new XapianDatabase($r); 64 } 65 return $r; 66 } 67 68 static function brass_open($dir,$action=null,$block_size=8192) { 69 switch (func_num_args()) { 70 case 1: $r=brass_open($dir); break; 71 default: $r=brass_open($dir,$action,$block_size); 72 } 73 if (!is_resource($r)) return $r; 74 switch (get_resource_type($r)) { 75 case '_p_Xapian__WritableDatabase': return new XapianWritableDatabase($r); 76 default: return new XapianDatabase($r); 77 } 78 } 79 80 static function chert_open($dir,$action=null,$block_size=8192) { 81 switch (func_num_args()) { 82 case 1: $r=chert_open($dir); break; 83 default: $r=chert_open($dir,$action,$block_size); 84 } 85 if (!is_resource($r)) return $r; 86 switch (get_resource_type($r)) { 87 case '_p_Xapian__WritableDatabase': return new XapianWritableDatabase($r); 88 default: return new XapianDatabase($r); 89 } 90 } 91 92 static function flint_open($dir,$action=null,$block_size=8192) { 93 switch (func_num_args()) { 94 case 1: $r=flint_open($dir); break; 95 default: $r=flint_open($dir,$action,$block_size); 96 } 97 if (!is_resource($r)) return $r; 98 switch (get_resource_type($r)) { 99 case '_p_Xapian__WritableDatabase': return new XapianWritableDatabase($r); 100 default: return new XapianDatabase($r); 101 } 102 } 103 104 static function inmemory_open() { 105 $r=inmemory_open(); 106 if (is_resource($r)) { 107 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 108 if (class_exists($c)) return new $c($r); 109 return new XapianWritableDatabase($r); 110 } 111 return $r; 112 } 113 114 static function remote_open($host_or_program,$port_or_args,$timeout=10000,$connect_timeout=null) { 115 switch (func_num_args()) { 116 case 2: case 3: $r=remote_open($host_or_program,$port_or_args,$timeout); break; 117 default: $r=remote_open($host_or_program,$port_or_args,$timeout,$connect_timeout); 118 } 119 if (is_resource($r)) { 120 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 121 if (class_exists($c)) return new $c($r); 122 return new XapianDatabase($r); 123 } 124 return $r; 125 } 126 127 static function remote_open_writable($host_or_program,$port_or_args,$timeout=10000,$connect_timeout=null) { 128 switch (func_num_args()) { 129 case 2: case 3: $r=remote_open_writable($host_or_program,$port_or_args,$timeout); break; 130 default: $r=remote_open_writable($host_or_program,$port_or_args,$timeout,$connect_timeout); 131 } 132 if (is_resource($r)) { 133 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 134 if (class_exists($c)) return new $c($r); 135 return new XapianWritableDatabase($r); 136 } 137 return $r; 138 } 139 140 static function sortable_serialise($value) { 141 return sortable_serialise($value); 142 } 143 144 static function sortable_unserialise($value) { 145 return sortable_unserialise($value); 146 } 147} 148 149/* PHP Proxy Classes */ 150class XapianPositionIterator { 151 public $_cPtr=null; 152 protected $_pData=array(); 153 154 function __set($var,$value) { 155 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 156 $this->_pData[$var] = $value; 157 } 158 159 function __isset($var) { 160 if ($var === 'thisown') return true; 161 return array_key_exists($var, $this->_pData); 162 } 163 164 function __get($var) { 165 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 166 return $this->_pData[$var]; 167 } 168 169 function __construct($other=null) { 170 if (is_resource($other) && get_resource_type($other) === '_p_Xapian__PositionIterator') { 171 $this->_cPtr=$other; 172 return; 173 } 174 switch (func_num_args()) { 175 case 0: $this->_cPtr=new_PositionIterator(); break; 176 default: $this->_cPtr=new_PositionIterator($other); 177 } 178 } 179 180 function get_termpos() { 181 return PositionIterator_get_termpos($this->_cPtr); 182 } 183 184 function next() { 185 PositionIterator_next($this->_cPtr); 186 } 187 188 function equals($other) { 189 return PositionIterator_equals($this->_cPtr,$other); 190 } 191 192 function skip_to($pos) { 193 PositionIterator_skip_to($this->_cPtr,$pos); 194 } 195 196 function get_description() { 197 return PositionIterator_get_description($this->_cPtr); 198 } 199} 200 201class XapianPostingIterator { 202 public $_cPtr=null; 203 protected $_pData=array(); 204 205 function __set($var,$value) { 206 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 207 $this->_pData[$var] = $value; 208 } 209 210 function __isset($var) { 211 if ($var === 'thisown') return true; 212 return array_key_exists($var, $this->_pData); 213 } 214 215 function __get($var) { 216 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 217 return $this->_pData[$var]; 218 } 219 220 function __construct($other=null) { 221 if (is_resource($other) && get_resource_type($other) === '_p_Xapian__PostingIterator') { 222 $this->_cPtr=$other; 223 return; 224 } 225 switch (func_num_args()) { 226 case 0: $this->_cPtr=new_PostingIterator(); break; 227 default: $this->_cPtr=new_PostingIterator($other); 228 } 229 } 230 231 function skip_to($did) { 232 PostingIterator_skip_to($this->_cPtr,$did); 233 } 234 235 function get_doclength() { 236 return PostingIterator_get_doclength($this->_cPtr); 237 } 238 239 function get_wdf() { 240 return PostingIterator_get_wdf($this->_cPtr); 241 } 242 243 function positionlist_begin() { 244 $r=PostingIterator_positionlist_begin($this->_cPtr); 245 if (is_resource($r)) { 246 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 247 if (class_exists($c)) return new $c($r); 248 return new XapianPositionIterator($r); 249 } 250 return $r; 251 } 252 253 function positionlist_end() { 254 $r=PostingIterator_positionlist_end($this->_cPtr); 255 if (is_resource($r)) { 256 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 257 if (class_exists($c)) return new $c($r); 258 return new XapianPositionIterator($r); 259 } 260 return $r; 261 } 262 263 function get_description() { 264 return PostingIterator_get_description($this->_cPtr); 265 } 266 267 function get_docid() { 268 return PostingIterator_get_docid($this->_cPtr); 269 } 270 271 function next() { 272 PostingIterator_next($this->_cPtr); 273 } 274 275 function equals($other) { 276 return PostingIterator_equals($this->_cPtr,$other); 277 } 278} 279 280class XapianTermIterator { 281 public $_cPtr=null; 282 protected $_pData=array(); 283 284 function __set($var,$value) { 285 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 286 $this->_pData[$var] = $value; 287 } 288 289 function __isset($var) { 290 if ($var === 'thisown') return true; 291 return array_key_exists($var, $this->_pData); 292 } 293 294 function __get($var) { 295 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 296 return $this->_pData[$var]; 297 } 298 299 function __construct($other=null) { 300 if (is_resource($other) && get_resource_type($other) === '_p_Xapian__TermIterator') { 301 $this->_cPtr=$other; 302 return; 303 } 304 switch (func_num_args()) { 305 case 0: $this->_cPtr=new_TermIterator(); break; 306 default: $this->_cPtr=new_TermIterator($other); 307 } 308 } 309 310 function get_term() { 311 return TermIterator_get_term($this->_cPtr); 312 } 313 314 function next() { 315 TermIterator_next($this->_cPtr); 316 } 317 318 function equals($other) { 319 return TermIterator_equals($this->_cPtr,$other); 320 } 321 322 function skip_to($tname) { 323 TermIterator_skip_to($this->_cPtr,$tname); 324 } 325 326 function get_wdf() { 327 return TermIterator_get_wdf($this->_cPtr); 328 } 329 330 function get_termfreq() { 331 return TermIterator_get_termfreq($this->_cPtr); 332 } 333 334 function positionlist_count() { 335 return TermIterator_positionlist_count($this->_cPtr); 336 } 337 338 function positionlist_begin() { 339 $r=TermIterator_positionlist_begin($this->_cPtr); 340 if (is_resource($r)) { 341 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 342 if (class_exists($c)) return new $c($r); 343 return new XapianPositionIterator($r); 344 } 345 return $r; 346 } 347 348 function positionlist_end() { 349 $r=TermIterator_positionlist_end($this->_cPtr); 350 if (is_resource($r)) { 351 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 352 if (class_exists($c)) return new $c($r); 353 return new XapianPositionIterator($r); 354 } 355 return $r; 356 } 357 358 function get_description() { 359 return TermIterator_get_description($this->_cPtr); 360 } 361} 362 363class XapianValueIterator { 364 public $_cPtr=null; 365 protected $_pData=array(); 366 367 function __set($var,$value) { 368 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 369 $this->_pData[$var] = $value; 370 } 371 372 function __isset($var) { 373 if ($var === 'thisown') return true; 374 return array_key_exists($var, $this->_pData); 375 } 376 377 function __get($var) { 378 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 379 return $this->_pData[$var]; 380 } 381 382 function __construct($other=null) { 383 if (is_resource($other) && get_resource_type($other) === '_p_Xapian__ValueIterator') { 384 $this->_cPtr=$other; 385 return; 386 } 387 switch (func_num_args()) { 388 case 0: $this->_cPtr=new_ValueIterator(); break; 389 default: $this->_cPtr=new_ValueIterator($other); 390 } 391 } 392 393 function get_value() { 394 return ValueIterator_get_value($this->_cPtr); 395 } 396 397 function next() { 398 ValueIterator_next($this->_cPtr); 399 } 400 401 function equals($other) { 402 return ValueIterator_equals($this->_cPtr,$other); 403 } 404 405 function get_docid() { 406 return ValueIterator_get_docid($this->_cPtr); 407 } 408 409 function get_valueno() { 410 return ValueIterator_get_valueno($this->_cPtr); 411 } 412 413 function skip_to($docid_or_slot) { 414 ValueIterator_skip_to($this->_cPtr,$docid_or_slot); 415 } 416 417 function check($docid) { 418 return ValueIterator_check($this->_cPtr,$docid); 419 } 420 421 function get_description() { 422 return ValueIterator_get_description($this->_cPtr); 423 } 424} 425 426class XapianDocument { 427 public $_cPtr=null; 428 protected $_pData=array(); 429 430 function __set($var,$value) { 431 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 432 $this->_pData[$var] = $value; 433 } 434 435 function __isset($var) { 436 if ($var === 'thisown') return true; 437 return array_key_exists($var, $this->_pData); 438 } 439 440 function __get($var) { 441 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 442 return $this->_pData[$var]; 443 } 444 445 function __construct($other=null) { 446 if (is_resource($other) && get_resource_type($other) === '_p_Xapian__Document') { 447 $this->_cPtr=$other; 448 return; 449 } 450 switch (func_num_args()) { 451 case 0: $this->_cPtr=new_Document(); break; 452 default: $this->_cPtr=new_Document($other); 453 } 454 } 455 456 function get_value($slot) { 457 return Document_get_value($this->_cPtr,$slot); 458 } 459 460 function add_value($slot,$value) { 461 Document_add_value($this->_cPtr,$slot,$value); 462 } 463 464 function remove_value($slot) { 465 Document_remove_value($this->_cPtr,$slot); 466 } 467 468 function clear_values() { 469 Document_clear_values($this->_cPtr); 470 } 471 472 function get_data() { 473 return Document_get_data($this->_cPtr); 474 } 475 476 function set_data($data) { 477 Document_set_data($this->_cPtr,$data); 478 } 479 480 function add_posting($tname,$tpos,$wdfinc=1) { 481 Document_add_posting($this->_cPtr,$tname,$tpos,$wdfinc); 482 } 483 484 function add_term($tname,$wdfinc=1) { 485 Document_add_term($this->_cPtr,$tname,$wdfinc); 486 } 487 488 function add_boolean_term($term) { 489 Document_add_boolean_term($this->_cPtr,$term); 490 } 491 492 function remove_posting($tname,$tpos,$wdfdec=1) { 493 Document_remove_posting($this->_cPtr,$tname,$tpos,$wdfdec); 494 } 495 496 function remove_term($tname) { 497 Document_remove_term($this->_cPtr,$tname); 498 } 499 500 function clear_terms() { 501 Document_clear_terms($this->_cPtr); 502 } 503 504 function termlist_count() { 505 return Document_termlist_count($this->_cPtr); 506 } 507 508 function termlist_begin() { 509 $r=Document_termlist_begin($this->_cPtr); 510 if (is_resource($r)) { 511 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 512 if (class_exists($c)) return new $c($r); 513 return new XapianTermIterator($r); 514 } 515 return $r; 516 } 517 518 function termlist_end() { 519 $r=Document_termlist_end($this->_cPtr); 520 if (is_resource($r)) { 521 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 522 if (class_exists($c)) return new $c($r); 523 return new XapianTermIterator($r); 524 } 525 return $r; 526 } 527 528 function values_count() { 529 return Document_values_count($this->_cPtr); 530 } 531 532 function values_begin() { 533 $r=Document_values_begin($this->_cPtr); 534 if (is_resource($r)) { 535 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 536 if (class_exists($c)) return new $c($r); 537 return new XapianValueIterator($r); 538 } 539 return $r; 540 } 541 542 function values_end() { 543 $r=Document_values_end($this->_cPtr); 544 if (is_resource($r)) { 545 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 546 if (class_exists($c)) return new $c($r); 547 return new XapianValueIterator($r); 548 } 549 return $r; 550 } 551 552 function get_docid() { 553 return Document_get_docid($this->_cPtr); 554 } 555 556 function serialise() { 557 return Document_serialise($this->_cPtr); 558 } 559 560 static function unserialise($s) { 561 $r=Document_unserialise($s); 562 if (is_resource($r)) { 563 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 564 if (class_exists($c)) return new $c($r); 565 return new XapianDocument($r); 566 } 567 return $r; 568 } 569 570 function get_description() { 571 return Document_get_description($this->_cPtr); 572 } 573} 574 575abstract class XapianPostingSource { 576 public $_cPtr=null; 577 protected $_pData=array(); 578 579 function __set($var,$value) { 580 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 581 $this->_pData[$var] = $value; 582 } 583 584 function __isset($var) { 585 if ($var === 'thisown') return true; 586 return array_key_exists($var, $this->_pData); 587 } 588 589 function __get($var) { 590 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 591 return $this->_pData[$var]; 592 } 593 594 function __construct($res=null) { 595 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__PostingSource') { 596 $this->_cPtr=$res; 597 return; 598 } 599 if (get_class($this) === 'XapianPostingSource') { 600 $_this = null; 601 } else { 602 $_this = $this; 603 } 604 $this->_cPtr=new_PostingSource($_this); 605 } 606 607 function get_termfreq_min() { 608 return PostingSource_get_termfreq_min($this->_cPtr); 609 } 610 611 function get_termfreq_est() { 612 return PostingSource_get_termfreq_est($this->_cPtr); 613 } 614 615 function get_termfreq_max() { 616 return PostingSource_get_termfreq_max($this->_cPtr); 617 } 618 619 function get_maxweight() { 620 return PostingSource_get_maxweight($this->_cPtr); 621 } 622 623 function get_weight() { 624 return PostingSource_get_weight($this->_cPtr); 625 } 626 627 function get_docid() { 628 return PostingSource_get_docid($this->_cPtr); 629 } 630 631 function next($min_wt) { 632 PostingSource_next($this->_cPtr,$min_wt); 633 } 634 635 function skip_to($did,$min_wt) { 636 PostingSource_skip_to($this->_cPtr,$did,$min_wt); 637 } 638 639 function check($did,$min_wt) { 640 return PostingSource_check($this->_cPtr,$did,$min_wt); 641 } 642 643 function at_end() { 644 return PostingSource_at_end($this->_cPtr); 645 } 646 647 function name() { 648 return PostingSource_name($this->_cPtr); 649 } 650 651 function init($db) { 652 PostingSource_init($this->_cPtr,$db); 653 } 654 655 function get_description() { 656 return PostingSource_get_description($this->_cPtr); 657 } 658} 659 660class XapianValuePostingSource extends XapianPostingSource { 661 public $_cPtr=null; 662 663 function __set($var,$value) { 664 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 665 XapianPostingSource::__set($var,$value); 666 } 667 668 function __isset($var) { 669 if ($var === 'thisown') return true; 670 return XapianPostingSource::__isset($var); 671 } 672 673 function __get($var) { 674 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 675 return XapianPostingSource::__get($var); 676 } 677 678 function __construct($slot_) { 679 if (is_resource($slot_) && get_resource_type($slot_) === '_p_Xapian__ValuePostingSource') { 680 $this->_cPtr=$slot_; 681 return; 682 } 683 $this->_cPtr=new_ValuePostingSource($slot_); 684 } 685 686 function get_termfreq_min() { 687 return ValuePostingSource_get_termfreq_min($this->_cPtr); 688 } 689 690 function get_termfreq_est() { 691 return ValuePostingSource_get_termfreq_est($this->_cPtr); 692 } 693 694 function get_termfreq_max() { 695 return ValuePostingSource_get_termfreq_max($this->_cPtr); 696 } 697 698 function next($min_wt) { 699 ValuePostingSource_next($this->_cPtr,$min_wt); 700 } 701 702 function skip_to($min_docid,$min_wt) { 703 ValuePostingSource_skip_to($this->_cPtr,$min_docid,$min_wt); 704 } 705 706 function check($min_docid,$min_wt) { 707 return ValuePostingSource_check($this->_cPtr,$min_docid,$min_wt); 708 } 709 710 function at_end() { 711 return ValuePostingSource_at_end($this->_cPtr); 712 } 713 714 function get_docid() { 715 return ValuePostingSource_get_docid($this->_cPtr); 716 } 717 718 function init($db_) { 719 ValuePostingSource_init($this->_cPtr,$db_); 720 } 721 722 function get_database() { 723 $r=ValuePostingSource_get_database($this->_cPtr); 724 if (is_resource($r)) { 725 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 726 if (class_exists($c)) return new $c($r); 727 return new XapianDatabase($r); 728 } 729 return $r; 730 } 731 732 function get_slot() { 733 return ValuePostingSource_get_slot($this->_cPtr); 734 } 735 736 function get_value() { 737 return ValuePostingSource_get_value($this->_cPtr); 738 } 739 740 function done() { 741 ValuePostingSource_done($this->_cPtr); 742 } 743 744 function get_started() { 745 return ValuePostingSource_get_started($this->_cPtr); 746 } 747 748 function set_termfreq_min($termfreq_min_) { 749 ValuePostingSource_set_termfreq_min($this->_cPtr,$termfreq_min_); 750 } 751 752 function set_termfreq_est($termfreq_est_) { 753 ValuePostingSource_set_termfreq_est($this->_cPtr,$termfreq_est_); 754 } 755 756 function set_termfreq_max($termfreq_max_) { 757 ValuePostingSource_set_termfreq_max($this->_cPtr,$termfreq_max_); 758 } 759} 760 761class XapianValueWeightPostingSource extends XapianValuePostingSource { 762 public $_cPtr=null; 763 764 function __set($var,$value) { 765 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 766 XapianValuePostingSource::__set($var,$value); 767 } 768 769 function __isset($var) { 770 if ($var === 'thisown') return true; 771 return XapianValuePostingSource::__isset($var); 772 } 773 774 function __get($var) { 775 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 776 return XapianValuePostingSource::__get($var); 777 } 778 779 function __construct($slot_) { 780 if (is_resource($slot_) && get_resource_type($slot_) === '_p_Xapian__ValueWeightPostingSource') { 781 $this->_cPtr=$slot_; 782 return; 783 } 784 $this->_cPtr=new_ValueWeightPostingSource($slot_); 785 } 786 787 function get_weight() { 788 return ValueWeightPostingSource_get_weight($this->_cPtr); 789 } 790 791 function name() { 792 return ValueWeightPostingSource_name($this->_cPtr); 793 } 794 795 function init($db_) { 796 ValueWeightPostingSource_init($this->_cPtr,$db_); 797 } 798 799 function get_description() { 800 return ValueWeightPostingSource_get_description($this->_cPtr); 801 } 802} 803 804class XapianDecreasingValueWeightPostingSource extends XapianValueWeightPostingSource { 805 public $_cPtr=null; 806 807 function __set($var,$value) { 808 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 809 XapianValueWeightPostingSource::__set($var,$value); 810 } 811 812 function __isset($var) { 813 if ($var === 'thisown') return true; 814 return XapianValueWeightPostingSource::__isset($var); 815 } 816 817 function __get($var) { 818 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 819 return XapianValueWeightPostingSource::__get($var); 820 } 821 822 function __construct($slot_,$range_start_=0,$range_end_=0) { 823 if (is_resource($slot_) && get_resource_type($slot_) === '_p_Xapian__DecreasingValueWeightPostingSource') { 824 $this->_cPtr=$slot_; 825 return; 826 } 827 $this->_cPtr=new_DecreasingValueWeightPostingSource($slot_,$range_start_,$range_end_); 828 } 829 830 function get_weight() { 831 return DecreasingValueWeightPostingSource_get_weight($this->_cPtr); 832 } 833 834 function name() { 835 return DecreasingValueWeightPostingSource_name($this->_cPtr); 836 } 837 838 function init($db_) { 839 DecreasingValueWeightPostingSource_init($this->_cPtr,$db_); 840 } 841 842 function next($min_wt) { 843 DecreasingValueWeightPostingSource_next($this->_cPtr,$min_wt); 844 } 845 846 function skip_to($min_docid,$min_wt) { 847 DecreasingValueWeightPostingSource_skip_to($this->_cPtr,$min_docid,$min_wt); 848 } 849 850 function check($min_docid,$min_wt) { 851 return DecreasingValueWeightPostingSource_check($this->_cPtr,$min_docid,$min_wt); 852 } 853 854 function get_description() { 855 return DecreasingValueWeightPostingSource_get_description($this->_cPtr); 856 } 857} 858 859class XapianValueMapPostingSource extends XapianValuePostingSource { 860 public $_cPtr=null; 861 862 function __set($var,$value) { 863 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 864 XapianValuePostingSource::__set($var,$value); 865 } 866 867 function __isset($var) { 868 if ($var === 'thisown') return true; 869 return XapianValuePostingSource::__isset($var); 870 } 871 872 function __get($var) { 873 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 874 return XapianValuePostingSource::__get($var); 875 } 876 877 function __construct($slot_) { 878 if (is_resource($slot_) && get_resource_type($slot_) === '_p_Xapian__ValueMapPostingSource') { 879 $this->_cPtr=$slot_; 880 return; 881 } 882 $this->_cPtr=new_ValueMapPostingSource($slot_); 883 } 884 885 function add_mapping($key,$wt) { 886 ValueMapPostingSource_add_mapping($this->_cPtr,$key,$wt); 887 } 888 889 function clear_mappings() { 890 ValueMapPostingSource_clear_mappings($this->_cPtr); 891 } 892 893 function set_default_weight($wt) { 894 ValueMapPostingSource_set_default_weight($this->_cPtr,$wt); 895 } 896 897 function get_weight() { 898 return ValueMapPostingSource_get_weight($this->_cPtr); 899 } 900 901 function name() { 902 return ValueMapPostingSource_name($this->_cPtr); 903 } 904 905 function init($db_) { 906 ValueMapPostingSource_init($this->_cPtr,$db_); 907 } 908 909 function get_description() { 910 return ValueMapPostingSource_get_description($this->_cPtr); 911 } 912} 913 914class XapianFixedWeightPostingSource extends XapianPostingSource { 915 public $_cPtr=null; 916 917 function __set($var,$value) { 918 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 919 XapianPostingSource::__set($var,$value); 920 } 921 922 function __isset($var) { 923 if ($var === 'thisown') return true; 924 return XapianPostingSource::__isset($var); 925 } 926 927 function __get($var) { 928 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 929 return XapianPostingSource::__get($var); 930 } 931 932 function __construct($wt) { 933 if (is_resource($wt) && get_resource_type($wt) === '_p_Xapian__FixedWeightPostingSource') { 934 $this->_cPtr=$wt; 935 return; 936 } 937 $this->_cPtr=new_FixedWeightPostingSource($wt); 938 } 939 940 function get_termfreq_min() { 941 return FixedWeightPostingSource_get_termfreq_min($this->_cPtr); 942 } 943 944 function get_termfreq_est() { 945 return FixedWeightPostingSource_get_termfreq_est($this->_cPtr); 946 } 947 948 function get_termfreq_max() { 949 return FixedWeightPostingSource_get_termfreq_max($this->_cPtr); 950 } 951 952 function get_weight() { 953 return FixedWeightPostingSource_get_weight($this->_cPtr); 954 } 955 956 function next($min_wt) { 957 FixedWeightPostingSource_next($this->_cPtr,$min_wt); 958 } 959 960 function skip_to($min_docid,$min_wt) { 961 FixedWeightPostingSource_skip_to($this->_cPtr,$min_docid,$min_wt); 962 } 963 964 function check($min_docid,$min_wt) { 965 return FixedWeightPostingSource_check($this->_cPtr,$min_docid,$min_wt); 966 } 967 968 function at_end() { 969 return FixedWeightPostingSource_at_end($this->_cPtr); 970 } 971 972 function get_docid() { 973 return FixedWeightPostingSource_get_docid($this->_cPtr); 974 } 975 976 function name() { 977 return FixedWeightPostingSource_name($this->_cPtr); 978 } 979 980 function init($db_) { 981 FixedWeightPostingSource_init($this->_cPtr,$db_); 982 } 983 984 function get_description() { 985 return FixedWeightPostingSource_get_description($this->_cPtr); 986 } 987} 988 989class XapianMSet { 990 public $_cPtr=null; 991 protected $_pData=array(); 992 993 function __set($var,$value) { 994 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 995 $this->_pData[$var] = $value; 996 } 997 998 function __isset($var) { 999 if ($var === 'thisown') return true; 1000 return array_key_exists($var, $this->_pData); 1001 } 1002 1003 function __get($var) { 1004 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1005 return $this->_pData[$var]; 1006 } 1007 1008 function __construct($other=null) { 1009 if (is_resource($other) && get_resource_type($other) === '_p_Xapian__MSet') { 1010 $this->_cPtr=$other; 1011 return; 1012 } 1013 switch (func_num_args()) { 1014 case 0: $this->_cPtr=new_MSet(); break; 1015 default: $this->_cPtr=new_MSet($other); 1016 } 1017 } 1018 1019 function fetch($begin_or_item=null,$end=null) { 1020 switch (func_num_args()) { 1021 case 0: MSet_fetch($this->_cPtr); break; 1022 case 1: MSet_fetch($this->_cPtr,$begin_or_item); break; 1023 default: MSet_fetch($this->_cPtr,$begin_or_item,$end); 1024 } 1025 } 1026 1027 function convert_to_percent($wt_or_item) { 1028 return MSet_convert_to_percent($this->_cPtr,$wt_or_item); 1029 } 1030 1031 function get_termfreq($tname) { 1032 return MSet_get_termfreq($this->_cPtr,$tname); 1033 } 1034 1035 function get_termweight($tname) { 1036 return MSet_get_termweight($this->_cPtr,$tname); 1037 } 1038 1039 function get_firstitem() { 1040 return MSet_get_firstitem($this->_cPtr); 1041 } 1042 1043 function get_matches_lower_bound() { 1044 return MSet_get_matches_lower_bound($this->_cPtr); 1045 } 1046 1047 function get_matches_estimated() { 1048 return MSet_get_matches_estimated($this->_cPtr); 1049 } 1050 1051 function get_matches_upper_bound() { 1052 return MSet_get_matches_upper_bound($this->_cPtr); 1053 } 1054 1055 function get_uncollapsed_matches_lower_bound() { 1056 return MSet_get_uncollapsed_matches_lower_bound($this->_cPtr); 1057 } 1058 1059 function get_uncollapsed_matches_estimated() { 1060 return MSet_get_uncollapsed_matches_estimated($this->_cPtr); 1061 } 1062 1063 function get_uncollapsed_matches_upper_bound() { 1064 return MSet_get_uncollapsed_matches_upper_bound($this->_cPtr); 1065 } 1066 1067 function get_max_possible() { 1068 return MSet_get_max_possible($this->_cPtr); 1069 } 1070 1071 function get_max_attained() { 1072 return MSet_get_max_attained($this->_cPtr); 1073 } 1074 1075 function size() { 1076 return MSet_size($this->_cPtr); 1077 } 1078 1079 function is_empty() { 1080 return MSet_is_empty($this->_cPtr); 1081 } 1082 1083 function begin() { 1084 $r=MSet_begin($this->_cPtr); 1085 if (is_resource($r)) { 1086 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 1087 if (class_exists($c)) return new $c($r); 1088 return new XapianMSetIterator($r); 1089 } 1090 return $r; 1091 } 1092 1093 function end() { 1094 $r=MSet_end($this->_cPtr); 1095 if (is_resource($r)) { 1096 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 1097 if (class_exists($c)) return new $c($r); 1098 return new XapianMSetIterator($r); 1099 } 1100 return $r; 1101 } 1102 1103 function back() { 1104 $r=MSet_back($this->_cPtr); 1105 if (is_resource($r)) { 1106 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 1107 if (class_exists($c)) return new $c($r); 1108 return new XapianMSetIterator($r); 1109 } 1110 return $r; 1111 } 1112 1113 function get_hit($i) { 1114 $r=MSet_get_hit($this->_cPtr,$i); 1115 if (is_resource($r)) { 1116 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 1117 if (class_exists($c)) return new $c($r); 1118 return new XapianMSetIterator($r); 1119 } 1120 return $r; 1121 } 1122 1123 function get_document_percentage($i) { 1124 return MSet_get_document_percentage($this->_cPtr,$i); 1125 } 1126 1127 function get_document($i) { 1128 $r=MSet_get_document($this->_cPtr,$i); 1129 if (is_resource($r)) { 1130 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 1131 if (class_exists($c)) return new $c($r); 1132 return new XapianDocument($r); 1133 } 1134 return $r; 1135 } 1136 1137 function get_docid($i) { 1138 return MSet_get_docid($this->_cPtr,$i); 1139 } 1140 1141 function get_description() { 1142 return MSet_get_description($this->_cPtr); 1143 } 1144} 1145 1146class XapianMSetIterator { 1147 public $_cPtr=null; 1148 protected $_pData=array(); 1149 1150 function __set($var,$value) { 1151 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 1152 $this->_pData[$var] = $value; 1153 } 1154 1155 function __isset($var) { 1156 if ($var === 'thisown') return true; 1157 return array_key_exists($var, $this->_pData); 1158 } 1159 1160 function __get($var) { 1161 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1162 return $this->_pData[$var]; 1163 } 1164 1165 function __construct($other=null) { 1166 if (is_resource($other) && get_resource_type($other) === '_p_Xapian__MSetIterator') { 1167 $this->_cPtr=$other; 1168 return; 1169 } 1170 switch (func_num_args()) { 1171 case 0: $this->_cPtr=new_MSetIterator(); break; 1172 default: $this->_cPtr=new_MSetIterator($other); 1173 } 1174 } 1175 1176 function get_docid() { 1177 return MSetIterator_get_docid($this->_cPtr); 1178 } 1179 1180 function next() { 1181 MSetIterator_next($this->_cPtr); 1182 } 1183 1184 function prev() { 1185 MSetIterator_prev($this->_cPtr); 1186 } 1187 1188 function equals($other) { 1189 return MSetIterator_equals($this->_cPtr,$other); 1190 } 1191 1192 function get_document() { 1193 $r=MSetIterator_get_document($this->_cPtr); 1194 if (is_resource($r)) { 1195 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 1196 if (class_exists($c)) return new $c($r); 1197 return new XapianDocument($r); 1198 } 1199 return $r; 1200 } 1201 1202 function get_rank() { 1203 return MSetIterator_get_rank($this->_cPtr); 1204 } 1205 1206 function get_weight() { 1207 return MSetIterator_get_weight($this->_cPtr); 1208 } 1209 1210 function get_collapse_key() { 1211 return MSetIterator_get_collapse_key($this->_cPtr); 1212 } 1213 1214 function get_collapse_count() { 1215 return MSetIterator_get_collapse_count($this->_cPtr); 1216 } 1217 1218 function get_percent() { 1219 return MSetIterator_get_percent($this->_cPtr); 1220 } 1221 1222 function get_description() { 1223 return MSetIterator_get_description($this->_cPtr); 1224 } 1225} 1226 1227class XapianESet { 1228 public $_cPtr=null; 1229 protected $_pData=array(); 1230 1231 function __set($var,$value) { 1232 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 1233 $this->_pData[$var] = $value; 1234 } 1235 1236 function __isset($var) { 1237 if ($var === 'thisown') return true; 1238 return array_key_exists($var, $this->_pData); 1239 } 1240 1241 function __get($var) { 1242 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1243 return $this->_pData[$var]; 1244 } 1245 1246 function __construct($other=null) { 1247 if (is_resource($other) && get_resource_type($other) === '_p_Xapian__ESet') { 1248 $this->_cPtr=$other; 1249 return; 1250 } 1251 switch (func_num_args()) { 1252 case 0: $this->_cPtr=new_ESet(); break; 1253 default: $this->_cPtr=new_ESet($other); 1254 } 1255 } 1256 1257 function get_ebound() { 1258 return ESet_get_ebound($this->_cPtr); 1259 } 1260 1261 function size() { 1262 return ESet_size($this->_cPtr); 1263 } 1264 1265 function is_empty() { 1266 return ESet_is_empty($this->_cPtr); 1267 } 1268 1269 function begin() { 1270 $r=ESet_begin($this->_cPtr); 1271 if (is_resource($r)) { 1272 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 1273 if (class_exists($c)) return new $c($r); 1274 return new XapianESetIterator($r); 1275 } 1276 return $r; 1277 } 1278 1279 function end() { 1280 $r=ESet_end($this->_cPtr); 1281 if (is_resource($r)) { 1282 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 1283 if (class_exists($c)) return new $c($r); 1284 return new XapianESetIterator($r); 1285 } 1286 return $r; 1287 } 1288 1289 function back() { 1290 $r=ESet_back($this->_cPtr); 1291 if (is_resource($r)) { 1292 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 1293 if (class_exists($c)) return new $c($r); 1294 return new XapianESetIterator($r); 1295 } 1296 return $r; 1297 } 1298 1299 function get_description() { 1300 return ESet_get_description($this->_cPtr); 1301 } 1302} 1303 1304class XapianESetIterator { 1305 public $_cPtr=null; 1306 protected $_pData=array(); 1307 1308 function __set($var,$value) { 1309 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 1310 $this->_pData[$var] = $value; 1311 } 1312 1313 function __isset($var) { 1314 if ($var === 'thisown') return true; 1315 return array_key_exists($var, $this->_pData); 1316 } 1317 1318 function __get($var) { 1319 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1320 return $this->_pData[$var]; 1321 } 1322 1323 function __construct($other=null) { 1324 if (is_resource($other) && get_resource_type($other) === '_p_Xapian__ESetIterator') { 1325 $this->_cPtr=$other; 1326 return; 1327 } 1328 switch (func_num_args()) { 1329 case 0: $this->_cPtr=new_ESetIterator(); break; 1330 default: $this->_cPtr=new_ESetIterator($other); 1331 } 1332 } 1333 1334 function get_term() { 1335 return ESetIterator_get_term($this->_cPtr); 1336 } 1337 1338 function next() { 1339 ESetIterator_next($this->_cPtr); 1340 } 1341 1342 function prev() { 1343 ESetIterator_prev($this->_cPtr); 1344 } 1345 1346 function equals($other) { 1347 return ESetIterator_equals($this->_cPtr,$other); 1348 } 1349 1350 function get_weight() { 1351 return ESetIterator_get_weight($this->_cPtr); 1352 } 1353 1354 function get_description() { 1355 return ESetIterator_get_description($this->_cPtr); 1356 } 1357} 1358 1359class XapianRSet { 1360 public $_cPtr=null; 1361 protected $_pData=array(); 1362 1363 function __set($var,$value) { 1364 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 1365 $this->_pData[$var] = $value; 1366 } 1367 1368 function __isset($var) { 1369 if ($var === 'thisown') return true; 1370 return array_key_exists($var, $this->_pData); 1371 } 1372 1373 function __get($var) { 1374 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1375 return $this->_pData[$var]; 1376 } 1377 1378 function __construct($other=null) { 1379 if (is_resource($other) && get_resource_type($other) === '_p_Xapian__RSet') { 1380 $this->_cPtr=$other; 1381 return; 1382 } 1383 switch (func_num_args()) { 1384 case 0: $this->_cPtr=new_RSet(); break; 1385 default: $this->_cPtr=new_RSet($other); 1386 } 1387 } 1388 1389 function size() { 1390 return RSet_size($this->_cPtr); 1391 } 1392 1393 function is_empty() { 1394 return RSet_is_empty($this->_cPtr); 1395 } 1396 1397 function add_document($did_or_i) { 1398 RSet_add_document($this->_cPtr,$did_or_i); 1399 } 1400 1401 function remove_document($did_or_i) { 1402 RSet_remove_document($this->_cPtr,$did_or_i); 1403 } 1404 1405 function contains($did_or_i) { 1406 return RSet_contains($this->_cPtr,$did_or_i); 1407 } 1408 1409 function get_description() { 1410 return RSet_get_description($this->_cPtr); 1411 } 1412} 1413 1414abstract class XapianMatchDecider { 1415 public $_cPtr=null; 1416 protected $_pData=array(); 1417 1418 function __set($var,$value) { 1419 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 1420 $this->_pData[$var] = $value; 1421 } 1422 1423 function __isset($var) { 1424 if ($var === 'thisown') return true; 1425 return array_key_exists($var, $this->_pData); 1426 } 1427 1428 function __get($var) { 1429 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1430 return $this->_pData[$var]; 1431 } 1432 1433 function apply($doc) { 1434 return MatchDecider_apply($this->_cPtr,$doc); 1435 } 1436 1437 function __construct($res=null) { 1438 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__MatchDecider') { 1439 $this->_cPtr=$res; 1440 return; 1441 } 1442 if (get_class($this) === 'XapianMatchDecider') { 1443 $_this = null; 1444 } else { 1445 $_this = $this; 1446 } 1447 $this->_cPtr=new_MatchDecider($_this); 1448 } 1449} 1450 1451abstract class XapianExpandDecider { 1452 public $_cPtr=null; 1453 protected $_pData=array(); 1454 1455 function __set($var,$value) { 1456 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 1457 $this->_pData[$var] = $value; 1458 } 1459 1460 function __isset($var) { 1461 if ($var === 'thisown') return true; 1462 return array_key_exists($var, $this->_pData); 1463 } 1464 1465 function __get($var) { 1466 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1467 return $this->_pData[$var]; 1468 } 1469 1470 function apply($term) { 1471 return ExpandDecider_apply($this->_cPtr,$term); 1472 } 1473 1474 function __construct($res=null) { 1475 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__ExpandDecider') { 1476 $this->_cPtr=$res; 1477 return; 1478 } 1479 if (get_class($this) === 'XapianExpandDecider') { 1480 $_this = null; 1481 } else { 1482 $_this = $this; 1483 } 1484 $this->_cPtr=new_ExpandDecider($_this); 1485 } 1486} 1487 1488class XapianEnquire { 1489 protected $_ps=null; 1490 protected $_sorter=null; 1491 protected $_spies=null; 1492 public $_cPtr=null; 1493 protected $_pData=array(); 1494 1495 function __set($var,$value) { 1496 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 1497 $this->_pData[$var] = $value; 1498 } 1499 1500 function __isset($var) { 1501 if ($var === 'thisown') return true; 1502 return array_key_exists($var, $this->_pData); 1503 } 1504 1505 function __get($var) { 1506 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1507 return $this->_pData[$var]; 1508 } 1509 1510 function __construct($databases) { 1511 if (is_resource($databases) && get_resource_type($databases) === '_p_Xapian__Enquire') { 1512 $this->_cPtr=$databases; 1513 return; 1514 } 1515 $this->_cPtr=new_Enquire($databases); 1516 } 1517 1518 function set_query($query,$qlen=0) { 1519 $this->_ps=$query->_ps; 1520 Enquire_set_query($this->_cPtr,$query,$qlen); 1521 } 1522 1523 function get_query() { 1524 $r=Enquire_get_query($this->_cPtr); 1525 if (is_resource($r)) { 1526 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 1527 if (class_exists($c)) return new $c($r); 1528 return new XapianQuery($r); 1529 } 1530 return $r; 1531 } 1532 1533 function add_matchspy($spy) { 1534 $this->_spies[]=$spy; 1535 Enquire_add_matchspy($this->_cPtr,$spy); 1536 } 1537 1538 function clear_matchspies() { 1539 $this->_spies=null; 1540 Enquire_clear_matchspies($this->_cPtr); 1541 } 1542 1543 function set_weighting_scheme($weight) { 1544 Enquire_set_weighting_scheme($this->_cPtr,$weight); 1545 } 1546 1547 function set_collapse_key($collapse_key,$collapse_max=1) { 1548 Enquire_set_collapse_key($this->_cPtr,$collapse_key,$collapse_max); 1549 } 1550 1551 const ASCENDING = 1; 1552 1553 const DESCENDING = 0; 1554 1555 const DONT_CARE = 2; 1556 1557 function set_docid_order($order) { 1558 Enquire_set_docid_order($this->_cPtr,$order); 1559 } 1560 1561 function set_cutoff($percent_cutoff,$weight_cutoff=0.0) { 1562 Enquire_set_cutoff($this->_cPtr,$percent_cutoff,$weight_cutoff); 1563 } 1564 1565 function set_sort_by_relevance() { 1566 Enquire_set_sort_by_relevance($this->_cPtr); 1567 } 1568 1569 function set_sort_by_value($sort_key,$reverse=null) { 1570 switch (func_num_args()) { 1571 case 1: Enquire_set_sort_by_value($this->_cPtr,$sort_key); break; 1572 default: Enquire_set_sort_by_value($this->_cPtr,$sort_key,$reverse); 1573 } 1574 } 1575 1576 function set_sort_by_value_then_relevance($sort_key,$reverse=null) { 1577 switch (func_num_args()) { 1578 case 1: Enquire_set_sort_by_value_then_relevance($this->_cPtr,$sort_key); break; 1579 default: Enquire_set_sort_by_value_then_relevance($this->_cPtr,$sort_key,$reverse); 1580 } 1581 } 1582 1583 function set_sort_by_relevance_then_value($sort_key,$reverse=null) { 1584 switch (func_num_args()) { 1585 case 1: Enquire_set_sort_by_relevance_then_value($this->_cPtr,$sort_key); break; 1586 default: Enquire_set_sort_by_relevance_then_value($this->_cPtr,$sort_key,$reverse); 1587 } 1588 } 1589 1590 function set_sort_by_key($sorter,$reverse=null) { 1591 $this->_sorter=$sorter; 1592 switch (func_num_args()) { 1593 case 1: Enquire_set_sort_by_key($this->_cPtr,$sorter); break; 1594 default: Enquire_set_sort_by_key($this->_cPtr,$sorter,$reverse); 1595 } 1596 } 1597 1598 function set_sort_by_key_then_relevance($sorter,$reverse=null) { 1599 $this->_sorter=$sorter; 1600 switch (func_num_args()) { 1601 case 1: Enquire_set_sort_by_key_then_relevance($this->_cPtr,$sorter); break; 1602 default: Enquire_set_sort_by_key_then_relevance($this->_cPtr,$sorter,$reverse); 1603 } 1604 } 1605 1606 function set_sort_by_relevance_then_key($sorter,$reverse=null) { 1607 $this->_sorter=$sorter; 1608 switch (func_num_args()) { 1609 case 1: Enquire_set_sort_by_relevance_then_key($this->_cPtr,$sorter); break; 1610 default: Enquire_set_sort_by_relevance_then_key($this->_cPtr,$sorter,$reverse); 1611 } 1612 } 1613 1614 const INCLUDE_QUERY_TERMS = Enquire_INCLUDE_QUERY_TERMS; 1615 1616 const USE_EXACT_TERMFREQ = Enquire_USE_EXACT_TERMFREQ; 1617 1618 function get_mset($first,$maxitems,$checkatleast_or_omrset=null,$omrset_or_mdecider=null,$mdecider=null,$matchspy=null) { 1619 switch (func_num_args()) { 1620 case 2: $r=Enquire_get_mset($this->_cPtr,$first,$maxitems); break; 1621 case 3: $r=Enquire_get_mset($this->_cPtr,$first,$maxitems,$checkatleast_or_omrset); break; 1622 case 4: $r=Enquire_get_mset($this->_cPtr,$first,$maxitems,$checkatleast_or_omrset,$omrset_or_mdecider); break; 1623 case 5: $r=Enquire_get_mset($this->_cPtr,$first,$maxitems,$checkatleast_or_omrset,$omrset_or_mdecider,$mdecider); break; 1624 default: $r=Enquire_get_mset($this->_cPtr,$first,$maxitems,$checkatleast_or_omrset,$omrset_or_mdecider,$mdecider,$matchspy); 1625 } 1626 if (is_resource($r)) { 1627 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 1628 if (class_exists($c)) return new $c($r); 1629 return new XapianMSet($r); 1630 } 1631 return $r; 1632 } 1633 1634 function get_eset($maxitems,$omrset,$flags_or_edecider=null,$k=null,$edecider=null,$min_wt=null) { 1635 switch (func_num_args()) { 1636 case 2: $r=Enquire_get_eset($this->_cPtr,$maxitems,$omrset); break; 1637 case 3: $r=Enquire_get_eset($this->_cPtr,$maxitems,$omrset,$flags_or_edecider); break; 1638 case 4: $r=Enquire_get_eset($this->_cPtr,$maxitems,$omrset,$flags_or_edecider,$k); break; 1639 case 5: $r=Enquire_get_eset($this->_cPtr,$maxitems,$omrset,$flags_or_edecider,$k,$edecider); break; 1640 default: $r=Enquire_get_eset($this->_cPtr,$maxitems,$omrset,$flags_or_edecider,$k,$edecider,$min_wt); 1641 } 1642 if (is_resource($r)) { 1643 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 1644 if (class_exists($c)) return new $c($r); 1645 return new XapianESet($r); 1646 } 1647 return $r; 1648 } 1649 1650 function get_matching_terms_begin($did_or_i) { 1651 $r=Enquire_get_matching_terms_begin($this->_cPtr,$did_or_i); 1652 if (is_resource($r)) { 1653 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 1654 if (class_exists($c)) return new $c($r); 1655 return new XapianTermIterator($r); 1656 } 1657 return $r; 1658 } 1659 1660 function get_matching_terms_end($did_or_i) { 1661 $r=Enquire_get_matching_terms_end($this->_cPtr,$did_or_i); 1662 if (is_resource($r)) { 1663 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 1664 if (class_exists($c)) return new $c($r); 1665 return new XapianTermIterator($r); 1666 } 1667 return $r; 1668 } 1669 1670 function get_matching_terms($hit) { 1671 return Enquire_get_matching_terms($this->_cPtr,$hit); 1672 } 1673 1674 function get_description() { 1675 return Enquire_get_description($this->_cPtr); 1676 } 1677} 1678 1679class XapianRegistry { 1680 public $_cPtr=null; 1681 protected $_pData=array(); 1682 1683 function __set($var,$value) { 1684 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 1685 $this->_pData[$var] = $value; 1686 } 1687 1688 function __isset($var) { 1689 if ($var === 'thisown') return true; 1690 return array_key_exists($var, $this->_pData); 1691 } 1692 1693 function __get($var) { 1694 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1695 return $this->_pData[$var]; 1696 } 1697 1698 function __construct($other=null) { 1699 if (is_resource($other) && get_resource_type($other) === '_p_Xapian__Registry') { 1700 $this->_cPtr=$other; 1701 return; 1702 } 1703 switch (func_num_args()) { 1704 case 0: $this->_cPtr=new_Registry(); break; 1705 default: $this->_cPtr=new_Registry($other); 1706 } 1707 } 1708 1709 function register_weighting_scheme($wt) { 1710 Registry_register_weighting_scheme($this->_cPtr,$wt); 1711 } 1712 1713 function get_weighting_scheme($name) { 1714 $r=Registry_get_weighting_scheme($this->_cPtr,$name); 1715 $this->_cPtr = $r; 1716 return $this; 1717 } 1718 1719 function register_posting_source($source) { 1720 Registry_register_posting_source($this->_cPtr,$source); 1721 } 1722 1723 function get_posting_source($name) { 1724 $r=Registry_get_posting_source($this->_cPtr,$name); 1725 $this->_cPtr = $r; 1726 return $this; 1727 } 1728 1729 function register_match_spy($spy) { 1730 Registry_register_match_spy($this->_cPtr,$spy); 1731 } 1732 1733 function get_match_spy($name) { 1734 $r=Registry_get_match_spy($this->_cPtr,$name); 1735 $this->_cPtr = $r; 1736 return $this; 1737 } 1738} 1739 1740abstract class XapianWeight { 1741 public $_cPtr=null; 1742 protected $_pData=array(); 1743 1744 function __set($var,$value) { 1745 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 1746 $this->_pData[$var] = $value; 1747 } 1748 1749 function __isset($var) { 1750 if ($var === 'thisown') return true; 1751 return array_key_exists($var, $this->_pData); 1752 } 1753 1754 function __get($var) { 1755 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1756 return $this->_pData[$var]; 1757 } 1758 function __construct($h) { 1759 $this->_cPtr=$h; 1760 } 1761 1762 function name() { 1763 return Weight_name($this->_cPtr); 1764 } 1765 1766 function get_sumpart($wdf,$doclen) { 1767 return Weight_get_sumpart($this->_cPtr,$wdf,$doclen); 1768 } 1769 1770 function get_maxpart() { 1771 return Weight_get_maxpart($this->_cPtr); 1772 } 1773 1774 function get_sumextra($doclen) { 1775 return Weight_get_sumextra($this->_cPtr,$doclen); 1776 } 1777 1778 function get_maxextra() { 1779 return Weight_get_maxextra($this->_cPtr); 1780 } 1781} 1782 1783class XapianBoolWeight extends XapianWeight { 1784 public $_cPtr=null; 1785 1786 function __set($var,$value) { 1787 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 1788 XapianWeight::__set($var,$value); 1789 } 1790 1791 function __isset($var) { 1792 if ($var === 'thisown') return true; 1793 return XapianWeight::__isset($var); 1794 } 1795 1796 function __get($var) { 1797 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1798 return XapianWeight::__get($var); 1799 } 1800 1801 function __construct($res=null) { 1802 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__BoolWeight') { 1803 $this->_cPtr=$res; 1804 return; 1805 } 1806 $this->_cPtr=new_BoolWeight(); 1807 } 1808 1809 function name() { 1810 return BoolWeight_name($this->_cPtr); 1811 } 1812 1813 function get_sumpart($wdf,$doclen) { 1814 return BoolWeight_get_sumpart($this->_cPtr,$wdf,$doclen); 1815 } 1816 1817 function get_maxpart() { 1818 return BoolWeight_get_maxpart($this->_cPtr); 1819 } 1820 1821 function get_sumextra($doclen) { 1822 return BoolWeight_get_sumextra($this->_cPtr,$doclen); 1823 } 1824 1825 function get_maxextra() { 1826 return BoolWeight_get_maxextra($this->_cPtr); 1827 } 1828} 1829 1830class XapianBM25Weight extends XapianWeight { 1831 public $_cPtr=null; 1832 1833 function __set($var,$value) { 1834 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 1835 XapianWeight::__set($var,$value); 1836 } 1837 1838 function __isset($var) { 1839 if ($var === 'thisown') return true; 1840 return XapianWeight::__isset($var); 1841 } 1842 1843 function __get($var) { 1844 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1845 return XapianWeight::__get($var); 1846 } 1847 1848 function __construct($k1=null,$k2=null,$k3=null,$b=null,$min_normlen=null) { 1849 if (is_resource($k1) && get_resource_type($k1) === '_p_Xapian__BM25Weight') { 1850 $this->_cPtr=$k1; 1851 return; 1852 } 1853 switch (func_num_args()) { 1854 case 0: $this->_cPtr=new_BM25Weight(); break; 1855 case 1: $this->_cPtr=new_BM25Weight($k1); break; 1856 case 2: $this->_cPtr=new_BM25Weight($k1,$k2); break; 1857 case 3: $this->_cPtr=new_BM25Weight($k1,$k2,$k3); break; 1858 case 4: $this->_cPtr=new_BM25Weight($k1,$k2,$k3,$b); break; 1859 default: $this->_cPtr=new_BM25Weight($k1,$k2,$k3,$b,$min_normlen); 1860 } 1861 } 1862 1863 function name() { 1864 return BM25Weight_name($this->_cPtr); 1865 } 1866 1867 function get_sumpart($wdf,$doclen) { 1868 return BM25Weight_get_sumpart($this->_cPtr,$wdf,$doclen); 1869 } 1870 1871 function get_maxpart() { 1872 return BM25Weight_get_maxpart($this->_cPtr); 1873 } 1874 1875 function get_sumextra($doclen) { 1876 return BM25Weight_get_sumextra($this->_cPtr,$doclen); 1877 } 1878 1879 function get_maxextra() { 1880 return BM25Weight_get_maxextra($this->_cPtr); 1881 } 1882} 1883 1884class XapianTradWeight extends XapianWeight { 1885 public $_cPtr=null; 1886 1887 function __set($var,$value) { 1888 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 1889 XapianWeight::__set($var,$value); 1890 } 1891 1892 function __isset($var) { 1893 if ($var === 'thisown') return true; 1894 return XapianWeight::__isset($var); 1895 } 1896 1897 function __get($var) { 1898 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1899 return XapianWeight::__get($var); 1900 } 1901 1902 function __construct($k=1.0) { 1903 if (is_resource($k) && get_resource_type($k) === '_p_Xapian__TradWeight') { 1904 $this->_cPtr=$k; 1905 return; 1906 } 1907 $this->_cPtr=new_TradWeight($k); 1908 } 1909 1910 function name() { 1911 return TradWeight_name($this->_cPtr); 1912 } 1913 1914 function get_sumpart($wdf,$doclen) { 1915 return TradWeight_get_sumpart($this->_cPtr,$wdf,$doclen); 1916 } 1917 1918 function get_maxpart() { 1919 return TradWeight_get_maxpart($this->_cPtr); 1920 } 1921 1922 function get_sumextra($doclen) { 1923 return TradWeight_get_sumextra($this->_cPtr,$doclen); 1924 } 1925 1926 function get_maxextra() { 1927 return TradWeight_get_maxextra($this->_cPtr); 1928 } 1929} 1930 1931abstract class XapianMatchSpy { 1932 public $_cPtr=null; 1933 protected $_pData=array(); 1934 1935 function __set($var,$value) { 1936 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 1937 $this->_pData[$var] = $value; 1938 } 1939 1940 function __isset($var) { 1941 if ($var === 'thisown') return true; 1942 return array_key_exists($var, $this->_pData); 1943 } 1944 1945 function __get($var) { 1946 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1947 return $this->_pData[$var]; 1948 } 1949 1950 function __construct($res=null) { 1951 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__MatchSpy') { 1952 $this->_cPtr=$res; 1953 return; 1954 } 1955 if (get_class($this) === 'XapianMatchSpy') { 1956 $_this = null; 1957 } else { 1958 $_this = $this; 1959 } 1960 $this->_cPtr=new_MatchSpy($_this); 1961 } 1962 1963 function apply($doc,$wt) { 1964 MatchSpy_apply($this->_cPtr,$doc,$wt); 1965 } 1966 1967 function name() { 1968 return MatchSpy_name($this->_cPtr); 1969 } 1970 1971 function merge_results($s) { 1972 MatchSpy_merge_results($this->_cPtr,$s); 1973 } 1974 1975 function get_description() { 1976 return MatchSpy_get_description($this->_cPtr); 1977 } 1978} 1979 1980class XapianValueCountMatchSpy extends XapianMatchSpy { 1981 public $_cPtr=null; 1982 1983 function __set($var,$value) { 1984 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 1985 XapianMatchSpy::__set($var,$value); 1986 } 1987 1988 function __isset($var) { 1989 if ($var === 'thisown') return true; 1990 return XapianMatchSpy::__isset($var); 1991 } 1992 1993 function __get($var) { 1994 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 1995 return XapianMatchSpy::__get($var); 1996 } 1997 1998 function __construct($slot_=null) { 1999 if (is_resource($slot_) && get_resource_type($slot_) === '_p_Xapian__ValueCountMatchSpy') { 2000 $this->_cPtr=$slot_; 2001 return; 2002 } 2003 switch (func_num_args()) { 2004 case 0: $this->_cPtr=new_ValueCountMatchSpy(); break; 2005 default: $this->_cPtr=new_ValueCountMatchSpy($slot_); 2006 } 2007 } 2008 2009 function get_total() { 2010 return ValueCountMatchSpy_get_total($this->_cPtr); 2011 } 2012 2013 function values_begin() { 2014 $r=ValueCountMatchSpy_values_begin($this->_cPtr); 2015 if (is_resource($r)) { 2016 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2017 if (class_exists($c)) return new $c($r); 2018 return new XapianTermIterator($r); 2019 } 2020 return $r; 2021 } 2022 2023 function values_end() { 2024 $r=ValueCountMatchSpy_values_end($this->_cPtr); 2025 if (is_resource($r)) { 2026 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2027 if (class_exists($c)) return new $c($r); 2028 return new XapianTermIterator($r); 2029 } 2030 return $r; 2031 } 2032 2033 function top_values_begin($maxvalues) { 2034 $r=ValueCountMatchSpy_top_values_begin($this->_cPtr,$maxvalues); 2035 if (is_resource($r)) { 2036 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2037 if (class_exists($c)) return new $c($r); 2038 return new XapianTermIterator($r); 2039 } 2040 return $r; 2041 } 2042 2043 function top_values_end($arg1) { 2044 $r=ValueCountMatchSpy_top_values_end($this->_cPtr,$arg1); 2045 if (is_resource($r)) { 2046 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2047 if (class_exists($c)) return new $c($r); 2048 return new XapianTermIterator($r); 2049 } 2050 return $r; 2051 } 2052 2053 function apply($doc,$wt) { 2054 ValueCountMatchSpy_apply($this->_cPtr,$doc,$wt); 2055 } 2056 2057 function name() { 2058 return ValueCountMatchSpy_name($this->_cPtr); 2059 } 2060 2061 function merge_results($s) { 2062 ValueCountMatchSpy_merge_results($this->_cPtr,$s); 2063 } 2064 2065 function get_description() { 2066 return ValueCountMatchSpy_get_description($this->_cPtr); 2067 } 2068} 2069 2070class XapianDatabase { 2071 public $_cPtr=null; 2072 protected $_pData=array(); 2073 2074 function __set($var,$value) { 2075 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 2076 $this->_pData[$var] = $value; 2077 } 2078 2079 function __isset($var) { 2080 if ($var === 'thisown') return true; 2081 return array_key_exists($var, $this->_pData); 2082 } 2083 2084 function __get($var) { 2085 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 2086 return $this->_pData[$var]; 2087 } 2088 2089 function add_database($database) { 2090 Database_add_database($this->_cPtr,$database); 2091 } 2092 2093 function __construct($path_or_other=null) { 2094 if (is_resource($path_or_other) && get_resource_type($path_or_other) === '_p_Xapian__Database') { 2095 $this->_cPtr=$path_or_other; 2096 return; 2097 } 2098 switch (func_num_args()) { 2099 case 0: $this->_cPtr=new_Database(); break; 2100 default: $this->_cPtr=new_Database($path_or_other); 2101 } 2102 } 2103 2104 function reopen() { 2105 Database_reopen($this->_cPtr); 2106 } 2107 2108 function close() { 2109 Database_close($this->_cPtr); 2110 } 2111 2112 function get_description() { 2113 return Database_get_description($this->_cPtr); 2114 } 2115 2116 function postlist_begin($tname) { 2117 $r=Database_postlist_begin($this->_cPtr,$tname); 2118 if (is_resource($r)) { 2119 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2120 if (class_exists($c)) return new $c($r); 2121 return new XapianPostingIterator($r); 2122 } 2123 return $r; 2124 } 2125 2126 function postlist_end($tname) { 2127 $r=Database_postlist_end($this->_cPtr,$tname); 2128 if (is_resource($r)) { 2129 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2130 if (class_exists($c)) return new $c($r); 2131 return new XapianPostingIterator($r); 2132 } 2133 return $r; 2134 } 2135 2136 function termlist_begin($did) { 2137 $r=Database_termlist_begin($this->_cPtr,$did); 2138 if (is_resource($r)) { 2139 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2140 if (class_exists($c)) return new $c($r); 2141 return new XapianTermIterator($r); 2142 } 2143 return $r; 2144 } 2145 2146 function termlist_end($did) { 2147 $r=Database_termlist_end($this->_cPtr,$did); 2148 if (is_resource($r)) { 2149 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2150 if (class_exists($c)) return new $c($r); 2151 return new XapianTermIterator($r); 2152 } 2153 return $r; 2154 } 2155 2156 function positionlist_begin($did,$tname) { 2157 $r=Database_positionlist_begin($this->_cPtr,$did,$tname); 2158 if (is_resource($r)) { 2159 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2160 if (class_exists($c)) return new $c($r); 2161 return new XapianPositionIterator($r); 2162 } 2163 return $r; 2164 } 2165 2166 function positionlist_end($did,$tname) { 2167 $r=Database_positionlist_end($this->_cPtr,$did,$tname); 2168 if (is_resource($r)) { 2169 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2170 if (class_exists($c)) return new $c($r); 2171 return new XapianPositionIterator($r); 2172 } 2173 return $r; 2174 } 2175 2176 function allterms_begin($prefix=null) { 2177 switch (func_num_args()) { 2178 case 0: $r=Database_allterms_begin($this->_cPtr); break; 2179 default: $r=Database_allterms_begin($this->_cPtr,$prefix); 2180 } 2181 if (is_resource($r)) { 2182 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2183 if (class_exists($c)) return new $c($r); 2184 return new XapianTermIterator($r); 2185 } 2186 return $r; 2187 } 2188 2189 function allterms_end($prefix=null) { 2190 switch (func_num_args()) { 2191 case 0: $r=Database_allterms_end($this->_cPtr); break; 2192 default: $r=Database_allterms_end($this->_cPtr,$prefix); 2193 } 2194 if (is_resource($r)) { 2195 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2196 if (class_exists($c)) return new $c($r); 2197 return new XapianTermIterator($r); 2198 } 2199 return $r; 2200 } 2201 2202 function get_doccount() { 2203 return Database_get_doccount($this->_cPtr); 2204 } 2205 2206 function get_lastdocid() { 2207 return Database_get_lastdocid($this->_cPtr); 2208 } 2209 2210 function get_avlength() { 2211 return Database_get_avlength($this->_cPtr); 2212 } 2213 2214 function get_termfreq($tname) { 2215 return Database_get_termfreq($this->_cPtr,$tname); 2216 } 2217 2218 function term_exists($tname) { 2219 return Database_term_exists($this->_cPtr,$tname); 2220 } 2221 2222 function get_collection_freq($tname) { 2223 return Database_get_collection_freq($this->_cPtr,$tname); 2224 } 2225 2226 function get_value_freq($valno) { 2227 return Database_get_value_freq($this->_cPtr,$valno); 2228 } 2229 2230 function get_value_lower_bound($valno) { 2231 return Database_get_value_lower_bound($this->_cPtr,$valno); 2232 } 2233 2234 function get_value_upper_bound($valno) { 2235 return Database_get_value_upper_bound($this->_cPtr,$valno); 2236 } 2237 2238 function get_doclength_lower_bound() { 2239 return Database_get_doclength_lower_bound($this->_cPtr); 2240 } 2241 2242 function get_doclength_upper_bound() { 2243 return Database_get_doclength_upper_bound($this->_cPtr); 2244 } 2245 2246 function get_wdf_upper_bound($term) { 2247 return Database_get_wdf_upper_bound($this->_cPtr,$term); 2248 } 2249 2250 function valuestream_begin($slot) { 2251 $r=Database_valuestream_begin($this->_cPtr,$slot); 2252 if (is_resource($r)) { 2253 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2254 if (class_exists($c)) return new $c($r); 2255 return new XapianValueIterator($r); 2256 } 2257 return $r; 2258 } 2259 2260 function valuestream_end($arg1) { 2261 $r=Database_valuestream_end($this->_cPtr,$arg1); 2262 if (is_resource($r)) { 2263 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2264 if (class_exists($c)) return new $c($r); 2265 return new XapianValueIterator($r); 2266 } 2267 return $r; 2268 } 2269 2270 function get_doclength($docid) { 2271 return Database_get_doclength($this->_cPtr,$docid); 2272 } 2273 2274 function keep_alive() { 2275 Database_keep_alive($this->_cPtr); 2276 } 2277 2278 function get_document($did) { 2279 $r=Database_get_document($this->_cPtr,$did); 2280 if (is_resource($r)) { 2281 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2282 if (class_exists($c)) return new $c($r); 2283 return new XapianDocument($r); 2284 } 2285 return $r; 2286 } 2287 2288 function get_spelling_suggestion($word,$max_edit_distance=2) { 2289 return Database_get_spelling_suggestion($this->_cPtr,$word,$max_edit_distance); 2290 } 2291 2292 function spellings_begin() { 2293 $r=Database_spellings_begin($this->_cPtr); 2294 if (is_resource($r)) { 2295 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2296 if (class_exists($c)) return new $c($r); 2297 return new XapianTermIterator($r); 2298 } 2299 return $r; 2300 } 2301 2302 function spellings_end() { 2303 $r=Database_spellings_end($this->_cPtr); 2304 if (is_resource($r)) { 2305 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2306 if (class_exists($c)) return new $c($r); 2307 return new XapianTermIterator($r); 2308 } 2309 return $r; 2310 } 2311 2312 function synonyms_begin($term) { 2313 $r=Database_synonyms_begin($this->_cPtr,$term); 2314 if (is_resource($r)) { 2315 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2316 if (class_exists($c)) return new $c($r); 2317 return new XapianTermIterator($r); 2318 } 2319 return $r; 2320 } 2321 2322 function synonyms_end($arg1) { 2323 $r=Database_synonyms_end($this->_cPtr,$arg1); 2324 if (is_resource($r)) { 2325 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2326 if (class_exists($c)) return new $c($r); 2327 return new XapianTermIterator($r); 2328 } 2329 return $r; 2330 } 2331 2332 function synonym_keys_begin($prefix=null) { 2333 switch (func_num_args()) { 2334 case 0: $r=Database_synonym_keys_begin($this->_cPtr); break; 2335 default: $r=Database_synonym_keys_begin($this->_cPtr,$prefix); 2336 } 2337 if (is_resource($r)) { 2338 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2339 if (class_exists($c)) return new $c($r); 2340 return new XapianTermIterator($r); 2341 } 2342 return $r; 2343 } 2344 2345 function synonym_keys_end($prefix=null) { 2346 switch (func_num_args()) { 2347 case 0: $r=Database_synonym_keys_end($this->_cPtr); break; 2348 default: $r=Database_synonym_keys_end($this->_cPtr,$prefix); 2349 } 2350 if (is_resource($r)) { 2351 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2352 if (class_exists($c)) return new $c($r); 2353 return new XapianTermIterator($r); 2354 } 2355 return $r; 2356 } 2357 2358 function get_metadata($key) { 2359 return Database_get_metadata($this->_cPtr,$key); 2360 } 2361 2362 function metadata_keys_begin($prefix=null) { 2363 switch (func_num_args()) { 2364 case 0: $r=Database_metadata_keys_begin($this->_cPtr); break; 2365 default: $r=Database_metadata_keys_begin($this->_cPtr,$prefix); 2366 } 2367 if (is_resource($r)) { 2368 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2369 if (class_exists($c)) return new $c($r); 2370 return new XapianTermIterator($r); 2371 } 2372 return $r; 2373 } 2374 2375 function metadata_keys_end($prefix=null) { 2376 switch (func_num_args()) { 2377 case 0: $r=Database_metadata_keys_end($this->_cPtr); break; 2378 default: $r=Database_metadata_keys_end($this->_cPtr,$prefix); 2379 } 2380 if (is_resource($r)) { 2381 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2382 if (class_exists($c)) return new $c($r); 2383 return new XapianTermIterator($r); 2384 } 2385 return $r; 2386 } 2387 2388 function get_uuid() { 2389 return Database_get_uuid($this->_cPtr); 2390 } 2391 2392 function has_positions() { 2393 return Database_has_positions($this->_cPtr); 2394 } 2395} 2396 2397class XapianWritableDatabase extends XapianDatabase { 2398 public $_cPtr=null; 2399 2400 function __set($var,$value) { 2401 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 2402 XapianDatabase::__set($var,$value); 2403 } 2404 2405 function __isset($var) { 2406 if ($var === 'thisown') return true; 2407 return XapianDatabase::__isset($var); 2408 } 2409 2410 function __get($var) { 2411 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 2412 return XapianDatabase::__get($var); 2413 } 2414 2415 function __construct($path_or_other=null,$action=null) { 2416 if (is_resource($path_or_other) && get_resource_type($path_or_other) === '_p_Xapian__WritableDatabase') { 2417 $this->_cPtr=$path_or_other; 2418 return; 2419 } 2420 switch (func_num_args()) { 2421 case 0: $this->_cPtr=new_WritableDatabase(); break; 2422 case 1: $this->_cPtr=new_WritableDatabase($path_or_other); break; 2423 default: $this->_cPtr=new_WritableDatabase($path_or_other,$action); 2424 } 2425 } 2426 2427 function commit() { 2428 WritableDatabase_commit($this->_cPtr); 2429 } 2430 2431 function flush() { 2432 WritableDatabase_flush($this->_cPtr); 2433 } 2434 2435 function begin_transaction($flushed=true) { 2436 WritableDatabase_begin_transaction($this->_cPtr,$flushed); 2437 } 2438 2439 function commit_transaction() { 2440 WritableDatabase_commit_transaction($this->_cPtr); 2441 } 2442 2443 function cancel_transaction() { 2444 WritableDatabase_cancel_transaction($this->_cPtr); 2445 } 2446 2447 function add_document($document) { 2448 return WritableDatabase_add_document($this->_cPtr,$document); 2449 } 2450 2451 function delete_document($did_or_unique_term) { 2452 WritableDatabase_delete_document($this->_cPtr,$did_or_unique_term); 2453 } 2454 2455 function replace_document($did_or_unique_term,$document) { 2456 return WritableDatabase_replace_document($this->_cPtr,$did_or_unique_term,$document); 2457 } 2458 2459 function add_spelling($word,$freqinc=1) { 2460 WritableDatabase_add_spelling($this->_cPtr,$word,$freqinc); 2461 } 2462 2463 function remove_spelling($word,$freqdec=1) { 2464 WritableDatabase_remove_spelling($this->_cPtr,$word,$freqdec); 2465 } 2466 2467 function add_synonym($term,$synonym) { 2468 WritableDatabase_add_synonym($this->_cPtr,$term,$synonym); 2469 } 2470 2471 function remove_synonym($term,$synonym) { 2472 WritableDatabase_remove_synonym($this->_cPtr,$term,$synonym); 2473 } 2474 2475 function clear_synonyms($term) { 2476 WritableDatabase_clear_synonyms($this->_cPtr,$term); 2477 } 2478 2479 function set_metadata($key,$value) { 2480 WritableDatabase_set_metadata($this->_cPtr,$key,$value); 2481 } 2482 2483 function get_description() { 2484 return WritableDatabase_get_description($this->_cPtr); 2485 } 2486} 2487 2488class XapianQuery { 2489 public $_ps=null; 2490 public $_cPtr=null; 2491 protected $_pData=array(); 2492 2493 function __set($var,$value) { 2494 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 2495 $this->_pData[$var] = $value; 2496 } 2497 2498 function __isset($var) { 2499 if ($var === 'thisown') return true; 2500 return array_key_exists($var, $this->_pData); 2501 } 2502 2503 function __get($var) { 2504 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 2505 return $this->_pData[$var]; 2506 } 2507 2508 const OP_AND = 0; 2509 2510 const OP_OR = Query_OP_OR; 2511 2512 const OP_AND_NOT = Query_OP_AND_NOT; 2513 2514 const OP_XOR = Query_OP_XOR; 2515 2516 const OP_AND_MAYBE = Query_OP_AND_MAYBE; 2517 2518 const OP_FILTER = Query_OP_FILTER; 2519 2520 const OP_NEAR = Query_OP_NEAR; 2521 2522 const OP_PHRASE = Query_OP_PHRASE; 2523 2524 const OP_VALUE_RANGE = Query_OP_VALUE_RANGE; 2525 2526 const OP_SCALE_WEIGHT = Query_OP_SCALE_WEIGHT; 2527 2528 const OP_ELITE_SET = Query_OP_ELITE_SET; 2529 2530 const OP_VALUE_GE = Query_OP_VALUE_GE; 2531 2532 const OP_VALUE_LE = Query_OP_VALUE_LE; 2533 2534 const OP_SYNONYM = Query_OP_SYNONYM; 2535 2536 static function MatchAll() { 2537 $r=Query_MatchAll_get(); 2538 if (is_resource($r)) { 2539 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2540 if (class_exists($c)) return new $c($r); 2541 return new XapianQuery($r); 2542 } 2543 return $r; 2544 } 2545 2546 static function MatchNothing() { 2547 $r=Query_MatchNothing_get(); 2548 if (is_resource($r)) { 2549 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2550 if (class_exists($c)) return new $c($r); 2551 return new XapianQuery($r); 2552 } 2553 return $r; 2554 } 2555 2556 function get_length() { 2557 return Query_get_length($this->_cPtr); 2558 } 2559 2560 function get_terms_begin() { 2561 $r=Query_get_terms_begin($this->_cPtr); 2562 if (is_resource($r)) { 2563 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2564 if (class_exists($c)) return new $c($r); 2565 return new XapianTermIterator($r); 2566 } 2567 return $r; 2568 } 2569 2570 function get_terms_end() { 2571 $r=Query_get_terms_end($this->_cPtr); 2572 if (is_resource($r)) { 2573 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2574 if (class_exists($c)) return new $c($r); 2575 return new XapianTermIterator($r); 2576 } 2577 return $r; 2578 } 2579 2580 function is_empty() { 2581 return Query_is_empty($this->_cPtr); 2582 } 2583 2584 function serialise() { 2585 return Query_serialise($this->_cPtr); 2586 } 2587 2588 static function unserialise($s,$registry=null) { 2589 switch (func_num_args()) { 2590 case 1: $r=Query_unserialise($s); break; 2591 default: $r=Query_unserialise($s,$registry); 2592 } 2593 if (is_resource($r)) { 2594 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2595 if (class_exists($c)) return new $c($r); 2596 return new XapianQuery($r); 2597 } 2598 return $r; 2599 } 2600 2601 function get_description() { 2602 return Query_get_description($this->_cPtr); 2603 } 2604 2605 function __construct($copyme_or_tname__or_op__or_external_source_or_op=null,$wqf__or_left_or_q_or_slot_or_subqs=null,$pos__or_right_or_parameter_or_begin_or_value_or_param=null,$end=null) { 2606 if ($copyme_or_tname__or_op__or_external_source_or_op instanceof XapianPostingSource) { 2607 $this->_ps[]=$copyme_or_tname__or_op__or_external_source_or_op; 2608 } else if (is_array($wqf__or_left_or_q_or_slot_or_subqs)) { 2609 foreach ($wqf__or_left_or_q_or_slot_or_subqs as $xxx) { 2610 if ($xxx instanceof XapianQuery) $this->_ps[]=$xxx->_ps; 2611 } 2612 } else { 2613 if ($copyme_or_tname__or_op__or_external_source_or_op instanceof XapianQuery) $this->_ps[]=$copyme_or_tname__or_op__or_external_source_or_op->_ps; 2614 if ($wqf__or_left_or_q_or_slot_or_subqs instanceof XapianQuery) $this->_ps[]=$wqf__or_left_or_q_or_slot_or_subqs->_ps; 2615 if ($pos__or_right_or_parameter_or_begin_or_value_or_param instanceof XapianQuery) $this->_ps[]=$pos__or_right_or_parameter_or_begin_or_value_or_param->_ps; 2616 } 2617 if (is_resource($copyme_or_tname__or_op__or_external_source_or_op) && get_resource_type($copyme_or_tname__or_op__or_external_source_or_op) === '_p_Xapian__Query') { 2618 $this->_cPtr=$copyme_or_tname__or_op__or_external_source_or_op; 2619 return; 2620 } 2621 switch (func_num_args()) { 2622 case 0: $this->_cPtr=new_Query(); break; 2623 case 1: $this->_cPtr=new_Query($copyme_or_tname__or_op__or_external_source_or_op); break; 2624 case 2: $this->_cPtr=new_Query($copyme_or_tname__or_op__or_external_source_or_op,$wqf__or_left_or_q_or_slot_or_subqs); break; 2625 case 3: $this->_cPtr=new_Query($copyme_or_tname__or_op__or_external_source_or_op,$wqf__or_left_or_q_or_slot_or_subqs,$pos__or_right_or_parameter_or_begin_or_value_or_param); break; 2626 default: $this->_cPtr=new_Query($copyme_or_tname__or_op__or_external_source_or_op,$wqf__or_left_or_q_or_slot_or_subqs,$pos__or_right_or_parameter_or_begin_or_value_or_param,$end); 2627 } 2628 } 2629} 2630 2631abstract class XapianStopper { 2632 public $_cPtr=null; 2633 protected $_pData=array(); 2634 2635 function __set($var,$value) { 2636 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 2637 $this->_pData[$var] = $value; 2638 } 2639 2640 function __isset($var) { 2641 if ($var === 'thisown') return true; 2642 return array_key_exists($var, $this->_pData); 2643 } 2644 2645 function __get($var) { 2646 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 2647 return $this->_pData[$var]; 2648 } 2649 2650 function apply($term) { 2651 return Stopper_apply($this->_cPtr,$term); 2652 } 2653 2654 function get_description() { 2655 return Stopper_get_description($this->_cPtr); 2656 } 2657 2658 function __construct($res=null) { 2659 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__Stopper') { 2660 $this->_cPtr=$res; 2661 return; 2662 } 2663 if (get_class($this) === 'XapianStopper') { 2664 $_this = null; 2665 } else { 2666 $_this = $this; 2667 } 2668 $this->_cPtr=new_Stopper($_this); 2669 } 2670} 2671 2672class XapianSimpleStopper extends XapianStopper { 2673 public $_cPtr=null; 2674 2675 function __set($var,$value) { 2676 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 2677 XapianStopper::__set($var,$value); 2678 } 2679 2680 function __isset($var) { 2681 if ($var === 'thisown') return true; 2682 return XapianStopper::__isset($var); 2683 } 2684 2685 function __get($var) { 2686 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 2687 return XapianStopper::__get($var); 2688 } 2689 2690 function __construct($res=null) { 2691 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__SimpleStopper') { 2692 $this->_cPtr=$res; 2693 return; 2694 } 2695 $this->_cPtr=new_SimpleStopper(); 2696 } 2697 2698 function add($word) { 2699 SimpleStopper_add($this->_cPtr,$word); 2700 } 2701 2702 function apply($term) { 2703 return SimpleStopper_apply($this->_cPtr,$term); 2704 } 2705 2706 function get_description() { 2707 return SimpleStopper_get_description($this->_cPtr); 2708 } 2709} 2710 2711abstract class XapianValueRangeProcessor { 2712 public $_cPtr=null; 2713 protected $_pData=array(); 2714 2715 function __set($var,$value) { 2716 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 2717 $this->_pData[$var] = $value; 2718 } 2719 2720 function __isset($var) { 2721 if ($var === 'thisown') return true; 2722 return array_key_exists($var, $this->_pData); 2723 } 2724 2725 function __get($var) { 2726 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 2727 return $this->_pData[$var]; 2728 } 2729 2730 function apply($begin,$end) { 2731 return ValueRangeProcessor_apply($this->_cPtr,$begin,$end); 2732 } 2733 2734 function __construct($res=null) { 2735 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__ValueRangeProcessor') { 2736 $this->_cPtr=$res; 2737 return; 2738 } 2739 if (get_class($this) === 'XapianValueRangeProcessor') { 2740 $_this = null; 2741 } else { 2742 $_this = $this; 2743 } 2744 $this->_cPtr=new_ValueRangeProcessor($_this); 2745 } 2746} 2747 2748class XapianStringValueRangeProcessor extends XapianValueRangeProcessor { 2749 public $_cPtr=null; 2750 2751 function __set($var,$value) { 2752 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 2753 XapianValueRangeProcessor::__set($var,$value); 2754 } 2755 2756 function __isset($var) { 2757 if ($var === 'thisown') return true; 2758 return XapianValueRangeProcessor::__isset($var); 2759 } 2760 2761 function __get($var) { 2762 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 2763 return XapianValueRangeProcessor::__get($var); 2764 } 2765 2766 function __construct($slot_,$str_=null,$prefix_=true) { 2767 if (is_resource($slot_) && get_resource_type($slot_) === '_p_Xapian__StringValueRangeProcessor') { 2768 $this->_cPtr=$slot_; 2769 return; 2770 } 2771 switch (func_num_args()) { 2772 case 1: $this->_cPtr=new_StringValueRangeProcessor($slot_); break; 2773 default: $this->_cPtr=new_StringValueRangeProcessor($slot_,$str_,$prefix_); 2774 } 2775 } 2776 2777 function apply($begin,$end) { 2778 return StringValueRangeProcessor_apply($this->_cPtr,$begin,$end); 2779 } 2780} 2781 2782class XapianDateValueRangeProcessor extends XapianStringValueRangeProcessor { 2783 public $_cPtr=null; 2784 2785 function __set($var,$value) { 2786 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 2787 XapianStringValueRangeProcessor::__set($var,$value); 2788 } 2789 2790 function __isset($var) { 2791 if ($var === 'thisown') return true; 2792 return XapianStringValueRangeProcessor::__isset($var); 2793 } 2794 2795 function __get($var) { 2796 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 2797 return XapianStringValueRangeProcessor::__get($var); 2798 } 2799 2800 function __construct($slot_,$prefer_mdy__or_str_=null,$epoch_year__or_prefix_=null,$prefer_mdy_=null,$epoch_year_=null) { 2801 if (is_resource($slot_) && get_resource_type($slot_) === '_p_Xapian__DateValueRangeProcessor') { 2802 $this->_cPtr=$slot_; 2803 return; 2804 } 2805 switch (func_num_args()) { 2806 case 1: $this->_cPtr=new_DateValueRangeProcessor($slot_); break; 2807 case 2: $this->_cPtr=new_DateValueRangeProcessor($slot_,$prefer_mdy__or_str_); break; 2808 case 3: $this->_cPtr=new_DateValueRangeProcessor($slot_,$prefer_mdy__or_str_,$epoch_year__or_prefix_); break; 2809 case 4: $this->_cPtr=new_DateValueRangeProcessor($slot_,$prefer_mdy__or_str_,$epoch_year__or_prefix_,$prefer_mdy_); break; 2810 default: $this->_cPtr=new_DateValueRangeProcessor($slot_,$prefer_mdy__or_str_,$epoch_year__or_prefix_,$prefer_mdy_,$epoch_year_); 2811 } 2812 } 2813 2814 function apply($begin,$end) { 2815 return DateValueRangeProcessor_apply($this->_cPtr,$begin,$end); 2816 } 2817} 2818 2819class XapianNumberValueRangeProcessor extends XapianStringValueRangeProcessor { 2820 public $_cPtr=null; 2821 2822 function __set($var,$value) { 2823 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 2824 XapianStringValueRangeProcessor::__set($var,$value); 2825 } 2826 2827 function __isset($var) { 2828 if ($var === 'thisown') return true; 2829 return XapianStringValueRangeProcessor::__isset($var); 2830 } 2831 2832 function __get($var) { 2833 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 2834 return XapianStringValueRangeProcessor::__get($var); 2835 } 2836 2837 function __construct($slot_,$str_=null,$prefix_=true) { 2838 if (is_resource($slot_) && get_resource_type($slot_) === '_p_Xapian__NumberValueRangeProcessor') { 2839 $this->_cPtr=$slot_; 2840 return; 2841 } 2842 switch (func_num_args()) { 2843 case 1: $this->_cPtr=new_NumberValueRangeProcessor($slot_); break; 2844 default: $this->_cPtr=new_NumberValueRangeProcessor($slot_,$str_,$prefix_); 2845 } 2846 } 2847 2848 function apply($begin,$end) { 2849 return NumberValueRangeProcessor_apply($this->_cPtr,$begin,$end); 2850 } 2851} 2852 2853class XapianQueryParser { 2854 protected $_vrps=null; 2855 protected $_stopper=null; 2856 public $_cPtr=null; 2857 protected $_pData=array(); 2858 2859 function __set($var,$value) { 2860 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 2861 $this->_pData[$var] = $value; 2862 } 2863 2864 function __isset($var) { 2865 if ($var === 'thisown') return true; 2866 return array_key_exists($var, $this->_pData); 2867 } 2868 2869 function __get($var) { 2870 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 2871 return $this->_pData[$var]; 2872 } 2873 2874 const FLAG_BOOLEAN = 1; 2875 2876 const FLAG_PHRASE = 2; 2877 2878 const FLAG_LOVEHATE = 4; 2879 2880 const FLAG_BOOLEAN_ANY_CASE = 8; 2881 2882 const FLAG_WILDCARD = 16; 2883 2884 const FLAG_PURE_NOT = 32; 2885 2886 const FLAG_PARTIAL = 64; 2887 2888 const FLAG_SPELLING_CORRECTION = 128; 2889 2890 const FLAG_SYNONYM = 256; 2891 2892 const FLAG_AUTO_SYNONYMS = 512; 2893 2894 const FLAG_AUTO_MULTIWORD_SYNONYMS = QueryParser_FLAG_AUTO_MULTIWORD_SYNONYMS; 2895 2896 const FLAG_CJK_NGRAM = 2048; 2897 2898 const FLAG_DEFAULT = QueryParser_FLAG_DEFAULT; 2899 2900 const STEM_NONE = 0; 2901 2902 const STEM_SOME = QueryParser_STEM_SOME; 2903 2904 const STEM_ALL = QueryParser_STEM_ALL; 2905 2906 const STEM_ALL_Z = QueryParser_STEM_ALL_Z; 2907 2908 function __construct($res=null) { 2909 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__QueryParser') { 2910 $this->_cPtr=$res; 2911 return; 2912 } 2913 $this->_cPtr=new_QueryParser(); 2914 } 2915 2916 function set_stemmer($stemmer) { 2917 QueryParser_set_stemmer($this->_cPtr,$stemmer); 2918 } 2919 2920 function set_stemming_strategy($strategy) { 2921 QueryParser_set_stemming_strategy($this->_cPtr,$strategy); 2922 } 2923 2924 function set_stopper($stop=null) { 2925 $this->_stopper=$stop; 2926 QueryParser_set_stopper($this->_cPtr,$stop); 2927 } 2928 2929 function set_default_op($default_op) { 2930 QueryParser_set_default_op($this->_cPtr,$default_op); 2931 } 2932 2933 function get_default_op() { 2934 return QueryParser_get_default_op($this->_cPtr); 2935 } 2936 2937 function set_database($db) { 2938 QueryParser_set_database($this->_cPtr,$db); 2939 } 2940 2941 function set_max_wildcard_expansion($limit) { 2942 QueryParser_set_max_wildcard_expansion($this->_cPtr,$limit); 2943 } 2944 2945 function parse_query($query_string,$flags=null,$default_prefix=null) { 2946 switch (func_num_args()) { 2947 case 1: $r=QueryParser_parse_query($this->_cPtr,$query_string); break; 2948 case 2: $r=QueryParser_parse_query($this->_cPtr,$query_string,$flags); break; 2949 default: $r=QueryParser_parse_query($this->_cPtr,$query_string,$flags,$default_prefix); 2950 } 2951 if (is_resource($r)) { 2952 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2953 if (class_exists($c)) return new $c($r); 2954 return new XapianQuery($r); 2955 } 2956 return $r; 2957 } 2958 2959 function add_prefix($field,$prefix) { 2960 QueryParser_add_prefix($this->_cPtr,$field,$prefix); 2961 } 2962 2963 function add_boolean_prefix($field,$prefix,$exclusive=null) { 2964 switch (func_num_args()) { 2965 case 2: QueryParser_add_boolean_prefix($this->_cPtr,$field,$prefix); break; 2966 default: QueryParser_add_boolean_prefix($this->_cPtr,$field,$prefix,$exclusive); 2967 } 2968 } 2969 2970 function stoplist_begin() { 2971 $r=QueryParser_stoplist_begin($this->_cPtr); 2972 if (is_resource($r)) { 2973 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2974 if (class_exists($c)) return new $c($r); 2975 return new XapianTermIterator($r); 2976 } 2977 return $r; 2978 } 2979 2980 function stoplist_end() { 2981 $r=QueryParser_stoplist_end($this->_cPtr); 2982 if (is_resource($r)) { 2983 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2984 if (class_exists($c)) return new $c($r); 2985 return new XapianTermIterator($r); 2986 } 2987 return $r; 2988 } 2989 2990 function unstem_begin($term) { 2991 $r=QueryParser_unstem_begin($this->_cPtr,$term); 2992 if (is_resource($r)) { 2993 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 2994 if (class_exists($c)) return new $c($r); 2995 return new XapianTermIterator($r); 2996 } 2997 return $r; 2998 } 2999 3000 function unstem_end($arg1) { 3001 $r=QueryParser_unstem_end($this->_cPtr,$arg1); 3002 if (is_resource($r)) { 3003 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 3004 if (class_exists($c)) return new $c($r); 3005 return new XapianTermIterator($r); 3006 } 3007 return $r; 3008 } 3009 3010 function add_valuerangeprocessor($vrproc) { 3011 $this->_vrps[]=$vrproc; 3012 QueryParser_add_valuerangeprocessor($this->_cPtr,$vrproc); 3013 } 3014 3015 function get_corrected_query_string() { 3016 return QueryParser_get_corrected_query_string($this->_cPtr); 3017 } 3018 3019 function get_description() { 3020 return QueryParser_get_description($this->_cPtr); 3021 } 3022} 3023 3024abstract class XapianStemImplementation { 3025 public $_cPtr=null; 3026 protected $_pData=array(); 3027 3028 function __set($var,$value) { 3029 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 3030 $this->_pData[$var] = $value; 3031 } 3032 3033 function __isset($var) { 3034 if ($var === 'thisown') return true; 3035 return array_key_exists($var, $this->_pData); 3036 } 3037 3038 function __get($var) { 3039 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 3040 return $this->_pData[$var]; 3041 } 3042 3043 function apply($word) { 3044 return StemImplementation_apply($this->_cPtr,$word); 3045 } 3046 3047 function get_description() { 3048 return StemImplementation_get_description($this->_cPtr); 3049 } 3050 3051 function __construct($res=null) { 3052 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__StemImplementation') { 3053 $this->_cPtr=$res; 3054 return; 3055 } 3056 if (get_class($this) === 'XapianStemImplementation') { 3057 $_this = null; 3058 } else { 3059 $_this = $this; 3060 } 3061 $this->_cPtr=new_StemImplementation($_this); 3062 } 3063} 3064 3065class XapianStem { 3066 public $_cPtr=null; 3067 protected $_pData=array(); 3068 3069 function __set($var,$value) { 3070 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 3071 $this->_pData[$var] = $value; 3072 } 3073 3074 function __isset($var) { 3075 if ($var === 'thisown') return true; 3076 return array_key_exists($var, $this->_pData); 3077 } 3078 3079 function __get($var) { 3080 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 3081 return $this->_pData[$var]; 3082 } 3083 3084 function __construct($language_or_p) { 3085 if (is_resource($language_or_p) && get_resource_type($language_or_p) === '_p_Xapian__Stem') { 3086 $this->_cPtr=$language_or_p; 3087 return; 3088 } 3089 $this->_cPtr=new_Stem($language_or_p); 3090 } 3091 3092 function apply($word) { 3093 return Stem_apply($this->_cPtr,$word); 3094 } 3095 3096 function get_description() { 3097 return Stem_get_description($this->_cPtr); 3098 } 3099 3100 static function get_available_languages() { 3101 return Stem_get_available_languages(); 3102 } 3103} 3104 3105class XapianTermGenerator { 3106 protected $_stopper=null; 3107 public $_cPtr=null; 3108 protected $_pData=array(); 3109 3110 function __set($var,$value) { 3111 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 3112 $this->_pData[$var] = $value; 3113 } 3114 3115 function __isset($var) { 3116 if ($var === 'thisown') return true; 3117 return array_key_exists($var, $this->_pData); 3118 } 3119 3120 function __get($var) { 3121 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 3122 return $this->_pData[$var]; 3123 } 3124 3125 function __construct($res=null) { 3126 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__TermGenerator') { 3127 $this->_cPtr=$res; 3128 return; 3129 } 3130 $this->_cPtr=new_TermGenerator(); 3131 } 3132 3133 function set_stemmer($stemmer) { 3134 TermGenerator_set_stemmer($this->_cPtr,$stemmer); 3135 } 3136 3137 function set_stopper($stop=null) { 3138 $this->_stopper=$stop; 3139 TermGenerator_set_stopper($this->_cPtr,$stop); 3140 } 3141 3142 function set_document($doc) { 3143 TermGenerator_set_document($this->_cPtr,$doc); 3144 } 3145 3146 function get_document() { 3147 $r=TermGenerator_get_document($this->_cPtr); 3148 if (is_resource($r)) { 3149 $c='Xapian'.substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); 3150 if (class_exists($c)) return new $c($r); 3151 return new XapianDocument($r); 3152 } 3153 return $r; 3154 } 3155 3156 function set_database($db) { 3157 TermGenerator_set_database($this->_cPtr,$db); 3158 } 3159 3160 const FLAG_SPELLING = 128; 3161 3162 const FLAG_CJK_NGRAM = 2048; 3163 3164 const STEM_NONE = 0; 3165 3166 const STEM_SOME = TermGenerator_STEM_SOME; 3167 3168 const STEM_ALL = TermGenerator_STEM_ALL; 3169 3170 const STEM_ALL_Z = TermGenerator_STEM_ALL_Z; 3171 3172 function set_flags($toggle,$mask=null) { 3173 switch (func_num_args()) { 3174 case 1: $r=TermGenerator_set_flags($this->_cPtr,$toggle); break; 3175 default: $r=TermGenerator_set_flags($this->_cPtr,$toggle,$mask); 3176 } 3177 return $r; 3178 } 3179 3180 function set_stemming_strategy($strategy) { 3181 TermGenerator_set_stemming_strategy($this->_cPtr,$strategy); 3182 } 3183 3184 function set_max_word_length($max_word_length) { 3185 TermGenerator_set_max_word_length($this->_cPtr,$max_word_length); 3186 } 3187 3188 function index_text($text,$wdf_inc=1,$prefix=null) { 3189 switch (func_num_args()) { 3190 case 1: case 2: TermGenerator_index_text($this->_cPtr,$text,$wdf_inc); break; 3191 default: TermGenerator_index_text($this->_cPtr,$text,$wdf_inc,$prefix); 3192 } 3193 } 3194 3195 function index_text_without_positions($text,$wdf_inc=1,$prefix=null) { 3196 switch (func_num_args()) { 3197 case 1: case 2: TermGenerator_index_text_without_positions($this->_cPtr,$text,$wdf_inc); break; 3198 default: TermGenerator_index_text_without_positions($this->_cPtr,$text,$wdf_inc,$prefix); 3199 } 3200 } 3201 3202 function increase_termpos($delta=100) { 3203 TermGenerator_increase_termpos($this->_cPtr,$delta); 3204 } 3205 3206 function get_termpos() { 3207 return TermGenerator_get_termpos($this->_cPtr); 3208 } 3209 3210 function set_termpos($termpos) { 3211 TermGenerator_set_termpos($this->_cPtr,$termpos); 3212 } 3213 3214 function get_description() { 3215 return TermGenerator_get_description($this->_cPtr); 3216 } 3217} 3218 3219abstract class XapianKeyMaker { 3220 public $_cPtr=null; 3221 protected $_pData=array(); 3222 3223 function __set($var,$value) { 3224 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 3225 $this->_pData[$var] = $value; 3226 } 3227 3228 function __isset($var) { 3229 if ($var === 'thisown') return true; 3230 return array_key_exists($var, $this->_pData); 3231 } 3232 3233 function __get($var) { 3234 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 3235 return $this->_pData[$var]; 3236 } 3237 3238 function apply($doc) { 3239 return KeyMaker_apply($this->_cPtr,$doc); 3240 } 3241 3242 function __construct($res=null) { 3243 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__KeyMaker') { 3244 $this->_cPtr=$res; 3245 return; 3246 } 3247 if (get_class($this) === 'XapianKeyMaker') { 3248 $_this = null; 3249 } else { 3250 $_this = $this; 3251 } 3252 $this->_cPtr=new_KeyMaker($_this); 3253 } 3254} 3255 3256class XapianMultiValueKeyMaker extends XapianKeyMaker { 3257 public $_cPtr=null; 3258 3259 function __set($var,$value) { 3260 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 3261 XapianKeyMaker::__set($var,$value); 3262 } 3263 3264 function __isset($var) { 3265 if ($var === 'thisown') return true; 3266 return XapianKeyMaker::__isset($var); 3267 } 3268 3269 function __get($var) { 3270 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 3271 return XapianKeyMaker::__get($var); 3272 } 3273 3274 function __construct($res=null) { 3275 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__MultiValueKeyMaker') { 3276 $this->_cPtr=$res; 3277 return; 3278 } 3279 $this->_cPtr=new_MultiValueKeyMaker(); 3280 } 3281 3282 function apply($doc) { 3283 return MultiValueKeyMaker_apply($this->_cPtr,$doc); 3284 } 3285 3286 function add_value($slot,$reverse=false) { 3287 MultiValueKeyMaker_add_value($this->_cPtr,$slot,$reverse); 3288 } 3289} 3290 3291abstract class XapianSorter extends XapianKeyMaker { 3292 public $_cPtr=null; 3293 3294 function __set($var,$value) { 3295 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 3296 XapianKeyMaker::__set($var,$value); 3297 } 3298 3299 function __isset($var) { 3300 if ($var === 'thisown') return true; 3301 return XapianKeyMaker::__isset($var); 3302 } 3303 3304 function __get($var) { 3305 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 3306 return XapianKeyMaker::__get($var); 3307 } 3308 function __construct($h) { 3309 $this->_cPtr=$h; 3310 } 3311} 3312 3313class XapianMultiValueSorter extends XapianSorter { 3314 public $_cPtr=null; 3315 3316 function __set($var,$value) { 3317 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 3318 XapianSorter::__set($var,$value); 3319 } 3320 3321 function __isset($var) { 3322 if ($var === 'thisown') return true; 3323 return XapianSorter::__isset($var); 3324 } 3325 3326 function __get($var) { 3327 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 3328 return XapianSorter::__get($var); 3329 } 3330 3331 function __construct($res=null) { 3332 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__MultiValueSorter') { 3333 $this->_cPtr=$res; 3334 return; 3335 } 3336 $this->_cPtr=new_MultiValueSorter(); 3337 } 3338 3339 function apply($doc) { 3340 return MultiValueSorter_apply($this->_cPtr,$doc); 3341 } 3342 3343 function add($slot,$forward=true) { 3344 MultiValueSorter_add($this->_cPtr,$slot,$forward); 3345 } 3346} 3347 3348class XapianValueSetMatchDecider extends XapianMatchDecider { 3349 public $_cPtr=null; 3350 3351 function __set($var,$value) { 3352 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 3353 XapianMatchDecider::__set($var,$value); 3354 } 3355 3356 function __isset($var) { 3357 if ($var === 'thisown') return true; 3358 return XapianMatchDecider::__isset($var); 3359 } 3360 3361 function __get($var) { 3362 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 3363 return XapianMatchDecider::__get($var); 3364 } 3365 3366 function __construct($slot,$inclusive_) { 3367 if (is_resource($slot) && get_resource_type($slot) === '_p_Xapian__ValueSetMatchDecider') { 3368 $this->_cPtr=$slot; 3369 return; 3370 } 3371 $this->_cPtr=new_ValueSetMatchDecider($slot,$inclusive_); 3372 } 3373 3374 function add_value($value) { 3375 ValueSetMatchDecider_add_value($this->_cPtr,$value); 3376 } 3377 3378 function remove_value($value) { 3379 ValueSetMatchDecider_remove_value($this->_cPtr,$value); 3380 } 3381 3382 function apply($doc) { 3383 return ValueSetMatchDecider_apply($this->_cPtr,$doc); 3384 } 3385} 3386 3387class XapianCompactor { 3388 public $_cPtr=null; 3389 protected $_pData=array(); 3390 3391 function __set($var,$value) { 3392 if ($var === 'thisown') return swig_xapian_alter_newobject($this->_cPtr,$value); 3393 $this->_pData[$var] = $value; 3394 } 3395 3396 function __isset($var) { 3397 if ($var === 'thisown') return true; 3398 return array_key_exists($var, $this->_pData); 3399 } 3400 3401 function __get($var) { 3402 if ($var === 'thisown') return swig_xapian_get_newobject($this->_cPtr); 3403 return $this->_pData[$var]; 3404 } 3405 3406 const STANDARD = 0; 3407 3408 const FULL = Compactor_FULL; 3409 3410 const FULLER = Compactor_FULLER; 3411 3412 function __construct($res=null) { 3413 if (is_resource($res) && get_resource_type($res) === '_p_Xapian__Compactor') { 3414 $this->_cPtr=$res; 3415 return; 3416 } 3417 if (get_class($this) === 'XapianCompactor') { 3418 $_this = null; 3419 } else { 3420 $_this = $this; 3421 } 3422 $this->_cPtr=new_Compactor($_this); 3423 } 3424 3425 function set_block_size($block_size) { 3426 Compactor_set_block_size($this->_cPtr,$block_size); 3427 } 3428 3429 function set_renumber($renumber) { 3430 Compactor_set_renumber($this->_cPtr,$renumber); 3431 } 3432 3433 function set_multipass($multipass) { 3434 Compactor_set_multipass($this->_cPtr,$multipass); 3435 } 3436 3437 function set_compaction_level($compaction) { 3438 Compactor_set_compaction_level($this->_cPtr,$compaction); 3439 } 3440 3441 function set_destdir($destdir) { 3442 Compactor_set_destdir($this->_cPtr,$destdir); 3443 } 3444 3445 function add_source($srcdir) { 3446 Compactor_add_source($this->_cPtr,$srcdir); 3447 } 3448 3449 function compact() { 3450 Compactor_compact($this->_cPtr); 3451 } 3452 3453 function set_status($table,$status) { 3454 Compactor_set_status($this->_cPtr,$table,$status); 3455 } 3456 3457 function resolve_duplicate_metadata($key,$num_tags,$tags) { 3458 return Compactor_resolve_duplicate_metadata($this->_cPtr,$key,$num_tags,$tags); 3459 } 3460} 3461 3462 3463?> 3464