92
92
<h3 class="section-bar">Methods</h3>
94
94
<div class="name-list">
95
<a href="#M000003">close</a>
96
<a href="#M000016">doc_num</a>
97
<a href="#M000011">edit_doc</a>
98
<a href="#M000001">err_msg</a>
99
<a href="#M000004">error</a>
100
<a href="#M000005">fatal</a>
101
<a href="#M000006">flush</a>
102
<a href="#M000012">get_doc</a>
103
<a href="#M000013">get_doc_attr</a>
104
<a href="#M000015">name</a>
105
<a href="#M000022">new</a>
106
<a href="#M000002">open</a>
107
<a href="#M000008">optimize</a>
108
<a href="#M000010">out_doc</a>
109
<a href="#M000009">put_doc</a>
110
<a href="#M000020">scan_doc</a>
111
<a href="#M000019">search</a>
112
<a href="#M000021">set_cache_size</a>
113
<a href="#M000018">size</a>
114
<a href="#M000007">sync</a>
115
<a href="#M000014">uri_to_id</a>
116
<a href="#M000017">word_num</a>
95
<a href="#M000007">add_attr_index</a>
96
<a href="#M000025">add_pseudo_index</a>
97
<a href="#M000004">close</a>
98
<a href="#M000019">doc_num</a>
99
<a href="#M000014">edit_doc</a>
100
<a href="#M000002">err_msg</a>
101
<a href="#M000005">error</a>
102
<a href="#M000006">fatal</a>
103
<a href="#M000008">flush</a>
104
<a href="#M000015">get_doc</a>
105
<a href="#M000016">get_doc_attr</a>
106
<a href="#M000011">merge</a>
107
<a href="#M000018">name</a>
108
<a href="#M000028">new</a>
109
<a href="#M000003">open</a>
110
<a href="#M000010">optimize</a>
111
<a href="#M000013">out_doc</a>
112
<a href="#M000012">put_doc</a>
113
<a href="#M000023">scan_doc</a>
114
<a href="#M000022">search</a>
115
<a href="#M000001">search_meta</a>
116
<a href="#M000024">set_cache_size</a>
117
<a href="#M000027">set_informer</a>
118
<a href="#M000026">set_wildmax</a>
119
<a href="#M000021">size</a>
120
<a href="#M000009">sync</a>
121
<a href="#M000017">uri_to_id</a>
122
<a href="#M000020">word_num</a>
293
299
<tr class="top-aligned-row context-row">
300
<td class="context-item-name">DBCHRCAT</td>
302
<td class="context-item-value">1 << 11</td>
303
<td width="3em"> </td>
304
<td class="context-item-desc">
305
open mode: use character category analyzer
309
<tr class="top-aligned-row context-row">
310
<td class="context-item-name">DBSMALL</td>
312
<td class="context-item-value">1 << 20</td>
313
<td width="3em"> </td>
314
<td class="context-item-desc">
315
open mode: small tuning
319
<tr class="top-aligned-row context-row">
320
<td class="context-item-name">DBLARGE</td>
322
<td class="context-item-value">1 << 21</td>
323
<td width="3em"> </td>
324
<td class="context-item-desc">
325
open mode: large tuning
329
<tr class="top-aligned-row context-row">
330
<td class="context-item-name">DBHUGE</td>
332
<td class="context-item-value">1 << 22</td>
333
<td width="3em"> </td>
334
<td class="context-item-desc">
335
open mode: huge tuning
339
<tr class="top-aligned-row context-row">
340
<td class="context-item-name">DBHUGE2</td>
342
<td class="context-item-value">1 << 23</td>
343
<td width="3em"> </td>
344
<td class="context-item-desc">
345
open mode: huge tuning second
349
<tr class="top-aligned-row context-row">
350
<td class="context-item-name">DBHUGE3</td>
352
<td class="context-item-value">1 << 24</td>
353
<td width="3em"> </td>
354
<td class="context-item-desc">
355
open mode: huge tuning third
359
<tr class="top-aligned-row context-row">
360
<td class="context-item-name">DBSCVOID</td>
362
<td class="context-item-value">1 << 25</td>
363
<td width="3em"> </td>
364
<td class="context-item-desc">
365
open mode: store scores as void
369
<tr class="top-aligned-row context-row">
370
<td class="context-item-name">DBSCINT</td>
372
<td class="context-item-value">1 << 26</td>
373
<td width="3em"> </td>
374
<td class="context-item-desc">
375
open mode: store scores as integer
379
<tr class="top-aligned-row context-row">
380
<td class="context-item-name">DBSCASIS</td>
382
<td class="context-item-value">1 << 27</td>
383
<td width="3em"> </td>
384
<td class="context-item-desc">
385
open mode: refrain from adjustment of scores
389
<tr class="top-aligned-row context-row">
390
<td class="context-item-name">IDXATTRSEQ</td>
392
<td class="context-item-value">0</td>
393
<td width="3em"> </td>
394
<td class="context-item-desc">
395
attribute index type: for multipurpose sequencial access method
399
<tr class="top-aligned-row context-row">
400
<td class="context-item-name">IDXATTRSTR</td>
402
<td class="context-item-value">1</td>
403
<td width="3em"> </td>
404
<td class="context-item-desc">
405
attribute index type: for narrowing with attributes as strings
409
<tr class="top-aligned-row context-row">
410
<td class="context-item-name">IDXATTRNUM</td>
412
<td class="context-item-value">2</td>
413
<td width="3em"> </td>
414
<td class="context-item-desc">
415
attribute index type: for narrowing with attributes as numbers
419
<tr class="top-aligned-row context-row">
294
420
<td class="context-item-name">OPTNOPURGE</td>
296
422
<td class="context-item-value">1 << 0</td>
313
439
<tr class="top-aligned-row context-row">
440
<td class="context-item-name">MGCLEAN</td>
442
<td class="context-item-value">1 << 0</td>
443
<td width="3em"> </td>
444
<td class="context-item-desc">
445
merge option: clean up dispensable regions
449
<tr class="top-aligned-row context-row">
314
450
<td class="context-item-name">PDCLEAN</td>
316
452
<td class="context-item-value">1 << 0</td>
317
453
<td width="3em"> </td>
318
454
<td class="context-item-desc">
319
<a href="Database.html#M000009">put_doc</a> option: clean up dispensable
455
<a href="Database.html#M000012">put_doc</a> option: clean up dispensable
324
460
<tr class="top-aligned-row context-row">
461
<td class="context-item-name">PDWEIGHT</td>
463
<td class="context-item-value">1 << 1</td>
464
<td width="3em"> </td>
465
<td class="context-item-desc">
466
<a href="Database.html#M000012">put_doc</a> option: weight scores
467
statically when indexing
471
<tr class="top-aligned-row context-row">
325
472
<td class="context-item-name">ODCLEAN</td>
327
474
<td class="context-item-value">1 << 0</td>
328
475
<td width="3em"> </td>
329
476
<td class="context-item-desc">
330
<a href="Database.html#M000010">out_doc</a> option: clean up dispensable
477
<a href="Database.html#M000013">out_doc</a> option: clean up dispensable
348
495
<td class="context-item-value">1 << 1</td>
349
496
<td width="3em"> </td>
350
497
<td class="context-item-desc">
351
<a href="Database.html#M000012">get_doc</a> option: no text
498
<a href="Database.html#M000015">get_doc</a> option: no text
502
<tr class="top-aligned-row context-row">
503
<td class="context-item-name">GDNOKWD</td>
505
<td class="context-item-value">1 << 2</td>
506
<td width="3em"> </td>
507
<td class="context-item-desc">
508
<a href="Database.html#M000015">get_doc</a> option: no keywords
542
<div id="method-M000001" class="method-detail">
543
<a name="M000001"></a>
545
<div class="method-heading">
546
<a href="Database.src/M000001.html" target="Code" class="method-signature"
547
onclick="popupCode('Database.src/M000001.html');return false;">
548
<span class="method-name">search_meta</span><span class="method-args">(dbs, cond)</span>
552
<div class="method-description">
554
Search plural databases for documents corresponding a condition.
555
`dbs’ specifies an array whose elements are database objects.
556
`cond’ specifies a condition object. The return value is a result
557
object. On error, `nil’ is returned.
385
562
<h3 class="section-bar">Public Instance methods</h3>
387
<div id="method-M000003" class="method-detail">
388
<a name="M000003"></a>
390
<div class="method-heading">
391
<a href="Database.src/M000003.html" target="Code" class="method-signature"
392
onclick="popupCode('Database.src/M000003.html');return false;">
564
<div id="method-M000007" class="method-detail">
565
<a name="M000007"></a>
567
<div class="method-heading">
568
<a href="Database.src/M000007.html" target="Code" class="method-signature"
569
onclick="popupCode('Database.src/M000007.html');return false;">
570
<span class="method-name">add_attr_index</span><span class="method-args">(name, type)</span>
574
<div class="method-description">
576
Add an index for narrowing or sorting with document attributes.
577
`name’ specifies the name of an attribute. `type’ specifies the
578
data type of attribute index; `Database::IDXATTRSEQ’ for multipurpose
579
sequencial access method, `Database::IDXATTRSTR’ for narrowing with
580
attributes as strings, `Database::IDXATTRNUM’ for narrowing with
581
attributes as numbers. The return value is true if success, else it is
587
<div id="method-M000025" class="method-detail">
588
<a name="M000025"></a>
590
<div class="method-heading">
591
<a href="Database.src/M000025.html" target="Code" class="method-signature"
592
onclick="popupCode('Database.src/M000025.html');return false;">
593
<span class="method-name">add_pseudo_index</span><span class="method-args">(path)</span>
597
<div class="method-description">
599
Add a pseudo index directory. `path’ specifies the path of a pseudo
600
index directory. The return value is true if success, else it is false.
605
<div id="method-M000004" class="method-detail">
606
<a name="M000004"></a>
608
<div class="method-heading">
609
<a href="Database.src/M000004.html" target="Code" class="method-signature"
610
onclick="popupCode('Database.src/M000004.html');return false;">
393
611
<span class="method-name">close</span><span class="method-args">()</span>
458
<div id="method-M000004" class="method-detail">
459
<a name="M000004"></a>
461
<div class="method-heading">
462
<a href="Database.src/M000004.html" target="Code" class="method-signature"
463
onclick="popupCode('Database.src/M000004.html');return false;">
464
<span class="method-name">error</span><span class="method-args">()</span>
468
<div class="method-description">
470
Get the last happened error code. The return value is the last happened
476
676
<div id="method-M000005" class="method-detail">
477
677
<a name="M000005"></a>
479
679
<div class="method-heading">
480
680
<a href="Database.src/M000005.html" target="Code" class="method-signature"
481
681
onclick="popupCode('Database.src/M000005.html');return false;">
482
<span class="method-name">fatal</span><span class="method-args">()</span>
682
<span class="method-name">error</span><span class="method-args">()</span>
486
686
<div class="method-description">
488
Check whether the database has a fatal error. The return value is true if
489
the database has fatal erroor, else it is false.
688
Get the last happened error code. The return value is the last happened
497
697
<div class="method-heading">
498
698
<a href="Database.src/M000006.html" target="Code" class="method-signature"
499
699
onclick="popupCode('Database.src/M000006.html');return false;">
700
<span class="method-name">fatal</span><span class="method-args">()</span>
704
<div class="method-description">
706
Check whether the database has a fatal error. The return value is true if
707
the database has fatal erroor, else it is false.
712
<div id="method-M000008" class="method-detail">
713
<a name="M000008"></a>
715
<div class="method-heading">
716
<a href="Database.src/M000008.html" target="Code" class="method-signature"
717
onclick="popupCode('Database.src/M000008.html');return false;">
500
718
<span class="method-name">flush</span><span class="method-args">(max)</span>
523
741
<div class="method-description">
525
743
Retrieve a document. `id’ specifies the ID number of a registered
526
document. `options’ specifies options: `Database.GDNOATTR’ to
527
ignore attributes, `Database.GDNOTEXT’ to ignore the body text. The
528
two can be specified at the same time by bitwise or. The return value is a
529
document object. On error, `nil’ is returned.
744
document. `options’ specifies options: `Database::GDNOATTR’ to
745
ignore attributes, `Database::GDNOTEXT’ to ignore the body text,
746
`Database::GDNOKWD’ to ignore keywords. The three can be specified at
747
the same time by bitwise or. The return value is a document object. On
748
error, `nil’ is returned.
534
<div id="method-M000013" class="method-detail">
535
<a name="M000013"></a>
753
<div id="method-M000016" class="method-detail">
754
<a name="M000016"></a>
537
756
<div class="method-heading">
538
<a href="Database.src/M000013.html" target="Code" class="method-signature"
539
onclick="popupCode('Database.src/M000013.html');return false;">
757
<a href="Database.src/M000016.html" target="Code" class="method-signature"
758
onclick="popupCode('Database.src/M000016.html');return false;">
540
759
<span class="method-name">get_doc_attr</span><span class="method-args">(id, name)</span>
554
<div id="method-M000015" class="method-detail">
555
<a name="M000015"></a>
557
<div class="method-heading">
558
<a href="Database.src/M000015.html" target="Code" class="method-signature"
559
onclick="popupCode('Database.src/M000015.html');return false;">
773
<div id="method-M000011" class="method-detail">
774
<a name="M000011"></a>
776
<div class="method-heading">
777
<a href="Database.src/M000011.html" target="Code" class="method-signature"
778
onclick="popupCode('Database.src/M000011.html');return false;">
779
<span class="method-name">merge</span><span class="method-args">(name, options)</span>
783
<div class="method-description">
785
Merge another database. `name’ specifies the name of another database
786
directory. `options’ specifies options: `Database::MGCLEAN’ to
787
clean up dispensable regions of the deleted document. The return value is
788
true if success, else it is false.
793
<div id="method-M000018" class="method-detail">
794
<a name="M000018"></a>
796
<div class="method-heading">
797
<a href="Database.src/M000018.html" target="Code" class="method-signature"
798
onclick="popupCode('Database.src/M000018.html');return false;">
560
799
<span class="method-name">name</span><span class="method-args">()</span>
593
832
performed without blocking. If `Database::DBNOLCK’ is used, the
594
833
application is responsible for exclusion control. `Database::DBCREAT’
595
834
can be added to by bitwise or: `Database::DBPERFNG’, which means
596
N-gram analysis is performed against European text also. The return value
597
is true if success, else it is false.
835
N-gram analysis is performed against European text also,
836
`Database::DBCHACAT’, which means character category analysis is
837
performed instead of N-gram analysis, `Database::DBSMALL’, which
838
means the index is tuned to register less than 50000 documents,
839
`Database::DBLARGE’, which means the index is tuned to register more
840
than 300000 documents, `Database::DBHUGE’, which means the index is
841
tuned to register more than 1000000 documents, `Database::DBHUGE2’,
842
which means the index is tuned to register more than 5000000 documents,
843
`Database::DBHUGE3’, which means the index is tuned to register more
844
than 10000000 documents, `Database::DBSCVOID’, which means scores are
845
stored as void, `Database::DBSCINT’, which means scores are stored as
846
32-bit integer, `Database::DBSCASIS’, which means scores are stored
847
as-is and marked not to be tuned when search. The return value is true if
848
success, else it is false.
602
<div id="method-M000008" class="method-detail">
603
<a name="M000008"></a>
853
<div id="method-M000010" class="method-detail">
854
<a name="M000010"></a>
605
856
<div class="method-heading">
606
<a href="Database.src/M000008.html" target="Code" class="method-signature"
607
onclick="popupCode('Database.src/M000008.html');return false;">
857
<a href="Database.src/M000010.html" target="Code" class="method-signature"
858
onclick="popupCode('Database.src/M000010.html');return false;">
608
859
<span class="method-name">optimize</span><span class="method-args">(options)</span>
633
884
<div class="method-description">
635
886
Remove a document. `id’ specifies the ID number of a registered
636
document. `options’ specifies options: `Database.ODCLEAN’ to
887
document. `options’ specifies options: `Database::ODCLEAN’ to
637
888
clean up dispensable regions of the deleted document. The return value is
638
889
true if success, else it is false.
643
<div id="method-M000009" class="method-detail">
644
<a name="M000009"></a>
894
<div id="method-M000012" class="method-detail">
895
<a name="M000012"></a>
646
897
<div class="method-heading">
647
<a href="Database.src/M000009.html" target="Code" class="method-signature"
648
onclick="popupCode('Database.src/M000009.html');return false;">
898
<a href="Database.src/M000012.html" target="Code" class="method-signature"
899
onclick="popupCode('Database.src/M000012.html');return false;">
649
900
<span class="method-name">put_doc</span><span class="method-args">(doc, options)</span>
655
906
Add a document. `doc’ specifies a document object. The document
656
907
object should have the URI attribute. `options’ specifies options:
657
`Database.PDCLEAN’ to clean up dispensable regions of the overwritten
658
document. The return value is true if success, else it is false.
908
`Database::PDCLEAN’ to clean up dispensable regions of the
909
overwritten document. The return value is true if success, else it is
663
<div id="method-M000020" class="method-detail">
664
<a name="M000020"></a>
915
<div id="method-M000023" class="method-detail">
916
<a name="M000023"></a>
666
918
<div class="method-heading">
667
<a href="Database.src/M000020.html" target="Code" class="method-signature"
668
onclick="popupCode('Database.src/M000020.html');return false;">
919
<a href="Database.src/M000023.html" target="Code" class="method-signature"
920
onclick="popupCode('Database.src/M000023.html');return false;">
669
921
<span class="method-name">scan_doc</span><span class="method-args">(doc, cond)</span>
684
<div id="method-M000019" class="method-detail">
685
<a name="M000019"></a>
936
<div id="method-M000022" class="method-detail">
937
<a name="M000022"></a>
687
939
<div class="method-heading">
688
<a href="Database.src/M000019.html" target="Code" class="method-signature"
689
onclick="popupCode('Database.src/M000019.html');return false;">
940
<a href="Database.src/M000022.html" target="Code" class="method-signature"
941
onclick="popupCode('Database.src/M000022.html');return false;">
690
942
<span class="method-name">search</span><span class="method-args">(cond)</span>
694
946
<div class="method-description">
696
Search documents corresponding a condition. `cond’ specifies a
948
Search for documents corresponding a condition. `cond’ specifies a
697
949
condition object. The return value is a result object. On error,
698
950
`nil’ is returned.
703
<div id="method-M000021" class="method-detail">
704
<a name="M000021"></a>
955
<div id="method-M000024" class="method-detail">
956
<a name="M000024"></a>
706
958
<div class="method-heading">
707
<a href="Database.src/M000021.html" target="Code" class="method-signature"
708
onclick="popupCode('Database.src/M000021.html');return false;">
959
<a href="Database.src/M000024.html" target="Code" class="method-signature"
960
onclick="popupCode('Database.src/M000024.html');return false;">
709
961
<span class="method-name">set_cache_size</span><span class="method-args">(size, anum, tnum, rnum)</span>
729
<div id="method-M000018" class="method-detail">
730
<a name="M000018"></a>
732
<div class="method-heading">
733
<a href="Database.src/M000018.html" target="Code" class="method-signature"
734
onclick="popupCode('Database.src/M000018.html');return false;">
981
<div id="method-M000027" class="method-detail">
982
<a name="M000027"></a>
984
<div class="method-heading">
985
<a href="Database.src/M000027.html" target="Code" class="method-signature"
986
onclick="popupCode('Database.src/M000027.html');return false;">
987
<span class="method-name">set_informer</span><span class="method-args">(informer)</span>
991
<div class="method-description">
993
Set the callback function to inform of database events. `informer’
994
specifies an arbitrary object with a method named as `inform’. The
995
method should have one parameter for a string of a message of each event.
996
The return value is always `nil’.
1001
<div id="method-M000026" class="method-detail">
1002
<a name="M000026"></a>
1004
<div class="method-heading">
1005
<a href="Database.src/M000026.html" target="Code" class="method-signature"
1006
onclick="popupCode('Database.src/M000026.html');return false;">
1007
<span class="method-name">set_wildmax</span><span class="method-args">(num)</span>
1011
<div class="method-description">
1013
Set the maximum number of expansion of wild cards. `num’ specifies
1014
the maximum number of expansion of wild cards. The return value is always
1020
<div id="method-M000021" class="method-detail">
1021
<a name="M000021"></a>
1023
<div class="method-heading">
1024
<a href="Database.src/M000021.html" target="Code" class="method-signature"
1025
onclick="popupCode('Database.src/M000021.html');return false;">
735
1026
<span class="method-name">size</span><span class="method-args">()</span>