This file is indexed.

/usr/share/doc/python-xapian/html/xapian.html is in python-xapian 1.4.3-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>xapian Package &#8212; Xapian Python Bindings 1.4.3 documentation</title>
    
    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '1.4.3',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="top" title="Xapian Python Bindings 1.4.3 documentation" href="index.html" />
    <link rel="prev" title="Examples" href="examples.html" /> 
  </head>
  <body role="document">
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="examples.html" title="Examples"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Xapian Python Bindings 1.4.3 documentation</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="xapian-package">
<h1>xapian Package<a class="headerlink" href="#xapian-package" title="Permalink to this headline"></a></h1>
<div class="section" id="id1">
<h2><a class="reference internal" href="#module-xapian" title="xapian"><code class="xref py py-mod docutils literal"><span class="pre">xapian</span></code></a> Package<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h2>
<span class="target" id="module-xapian"></span><p>Xapian is a highly adaptable toolkit which allows developers to easily
add advanced indexing and search facilities to their own
applications. It supports the Probabilistic Information Retrieval
model and also supports a rich set of boolean query operators.</p>
<p>In addition to the doc strings provided by this python library, you
may wish to look at the library&#8217;s overall documentation, either
installed along with the bindings or online at
&lt;<a class="reference external" href="https://xapian.org/docs/bindings/python/">https://xapian.org/docs/bindings/python/</a>&gt;, as well as the library&#8217;s
documentation, possibly installed with the library or with its
development files, or again online at &lt;<a class="reference external" href="https://xapian.org/docs/">https://xapian.org/docs/</a>&gt;.</p>
<dl class="exception">
<dt id="xapian.AssertionError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">AssertionError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#AssertionError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.AssertionError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.LogicError" title="xapian.LogicError"><code class="xref py py-class docutils literal"><span class="pre">xapian.LogicError</span></code></a></p>
<p>AssertionError is thrown if a logical assertion inside Xapian fails.</p>
<p>In a debug build of Xapian, a failed assertion in the core library
code will cause AssertionError to be thrown.</p>
<p>This represents a bug in Xapian (either an invariant, precondition,
etc has been violated, or the assertion is incorrect!)</p>
</dd></dl>

<dl class="class">
<dt id="xapian.BB2Weight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">BB2Weight</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#BB2Weight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.BB2Weight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>This class implements the BB2 weighting scheme.</p>
<p>BB2 is a representative scheme of the Divergence from Randomness
Framework by Gianni Amati.</p>
<p>It uses the Bose-Einstein probabilistic distribution (B) along with
Stirling&#8217;s power approximation, the Bernoulli method to find the
aftereffect of sampling (B) and the second wdf normalization proposed
by Amati to normalize the wdf in the document to the length of the
document (H2).</p>
<p>For more information about the DFR Framework and the BB2 scheme,
please refer to : Gianni Amati and Cornelis Joost Van Rijsbergen
Probabilistic models of information retrieval based on measuring the
divergence from randomness ACM Transactions on Information Systems
(TOIS) 20, (4), 2002, pp. 357-389.</p>
<dl class="attribute">
<dt id="xapian.BB2Weight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.BB2Weight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.BM25PlusWeight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">BM25PlusWeight</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#BM25PlusWeight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.BM25PlusWeight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>Xapian::Weight subclass implementing the BM25+ probabilistic formula.</p>
<dl class="attribute">
<dt id="xapian.BM25PlusWeight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.BM25PlusWeight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.BM25Weight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">BM25Weight</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#BM25Weight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.BM25Weight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>Xapian::Weight subclass implementing the BM25 probabilistic formula.</p>
<dl class="attribute">
<dt id="xapian.BM25Weight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.BM25Weight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.BoolWeight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">BoolWeight</code><a class="reference internal" href="_modules/xapian.html#BoolWeight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.BoolWeight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>Class implementing a &#8220;boolean&#8221; weighting scheme.</p>
<p>This weighting scheme gives all documents zero weight.</p>
<dl class="attribute">
<dt id="xapian.BoolWeight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.BoolWeight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.Compactor">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">Compactor</code><a class="reference internal" href="_modules/xapian.html#Compactor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Compactor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Compact a database, or merge and compact several.</p>
<dl class="attribute">
<dt id="xapian.Compactor.FULL">
<code class="descname">FULL</code><em class="property"> = 1</em><a class="headerlink" href="#xapian.Compactor.FULL" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Compactor.FULLER">
<code class="descname">FULLER</code><em class="property"> = 2</em><a class="headerlink" href="#xapian.Compactor.FULLER" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Compactor.STANDARD">
<code class="descname">STANDARD</code><em class="property"> = 0</em><a class="headerlink" href="#xapian.Compactor.STANDARD" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.Compactor.add_source">
<code class="descname">add_source</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Compactor.add_source" title="Permalink to this definition"></a></dt>
<dd><p>Add a source database.</p>
<p>void Xapian::Compactor::add_source(const std::string &amp;srcdir)</p>
<p>Deprecated Use Database::compact(destdir[, compactor]) instead.</p>
<p>srcdir:  The path to the source database to add.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Compactor.compact">
<code class="descname">compact</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Compactor.compact" title="Permalink to this definition"></a></dt>
<dd><p>Perform the actual compaction/merging operation.</p>
<p>void Xapian::Compactor::compact()</p>
<p>Deprecated Use Database::compact(destdir[, compactor]) instead.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Compactor.resolve_duplicate_metadata">
<code class="descname">resolve_duplicate_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Compactor.resolve_duplicate_metadata" title="Permalink to this definition"></a></dt>
<dd><p>Resolve multiple user metadata entries with the same key.</p>
<p>virtual std::string
Xapian::Compactor::resolve_duplicate_metadata(const std::string &amp;key,
size_t num_tags, const std::string tags[])</p>
<p>When merging, if the same user metadata key is set in more than one
input, then this method is called to allow this to be resolving in an
appropriate way.</p>
<p>The default implementation just returns tags[0].</p>
<p>For multipass this will currently get called multiple times for the
same key if there are duplicates to resolve in each pass, but this may
change in the future.</p>
<p>key:  The metadata key with duplicate entries.</p>
<p>num_tags:  How many tags there are.</p>
<p>tags:  An array of num_tags strings containing the tags to merge.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Compactor.set_block_size">
<code class="descname">set_block_size</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Compactor.set_block_size" title="Permalink to this definition"></a></dt>
<dd><p>Set the block size to use for tables in the output database.</p>
<p>void Xapian::Compactor::set_block_size(size_t block_size)</p>
<p>block_size:  The block size to use. Valid block sizes are currently
powers of two between 2048 and 65536, with the default being 8192, but
the valid sizes and default may change in the future.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Compactor.set_compaction_level">
<code class="descname">set_compaction_level</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Compactor.set_compaction_level" title="Permalink to this definition"></a></dt>
<dd><p>Set the compaction level.</p>
<p>void Xapian::Compactor::set_compaction_level(compaction_level
compaction)</p>
<p>compaction:  Available values are:  Xapian::Compactor::STANDARD -
Don&#8217;t split items unnecessarily.</p>
<p>Xapian::Compactor::FULL - Split items whenever it saves space (the
default).</p>
<p>Xapian::Compactor::FULLER - Allow oversize items to save more space
(not recommended if you ever plan to update the compacted database).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Compactor.set_destdir">
<code class="descname">set_destdir</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Compactor.set_destdir" title="Permalink to this definition"></a></dt>
<dd><p>Set where to write the output.</p>
<p>void Xapian::Compactor::set_destdir(const std::string &amp;destdir)</p>
<p>Deprecated Use Database::compact(destdir[, compactor]) instead.</p>
<p>destdir:  Output path. This can be the same as an input if that input
is a stub database (in which case the database(s) listed in the stub
will be compacted to a new database and then the stub will be
atomically updated to point to this new database).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Compactor.set_multipass">
<code class="descname">set_multipass</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Compactor.set_multipass" title="Permalink to this definition"></a></dt>
<dd><p>Set whether to merge postlists in multiple passes.</p>
<p>void Xapian::Compactor::set_multipass(bool multipass)</p>
<p>multipass:  If true and merging more than 3 databases, merge the
postlists in multiple passes, which is generally faster but requires
more disk space for temporary files. By default we don&#8217;t do this.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Compactor.set_renumber">
<code class="descname">set_renumber</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Compactor.set_renumber" title="Permalink to this definition"></a></dt>
<dd><p>Set whether to preserve existing document id values.</p>
<p>void Xapian::Compactor::set_renumber(bool renumber)</p>
<p>renumber:  The default is true, which means that document ids will be
renumbered - currently by applying the same offset to all the document
ids in a particular source database.</p>
<p>If false, then the document ids must be unique over all source
databases. Currently the ranges of document ids in each source must
not overlap either, though this restriction may be removed in the
future.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Compactor.set_status">
<code class="descname">set_status</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Compactor.set_status" title="Permalink to this definition"></a></dt>
<dd><p>Update progress.</p>
<p>virtual void Xapian::Compactor::set_status(const std::string &amp;table,
const std::string &amp;status)</p>
<p>Subclass this method if you want to get progress updates during
compaction. This is called for each table first with empty status, And
then one or more times with non-empty status.</p>
<p>The default implementation does nothing.</p>
<p>table:  The table currently being compacted.</p>
<p>status:  A status message.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.Compactor.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.Compactor.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.CoordWeight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">CoordWeight</code><a class="reference internal" href="_modules/xapian.html#CoordWeight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.CoordWeight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>Xapian::Weight subclass implementing Coordinate Matching.</p>
<p>Each matching term score one point. See Managing Gigabytes, Second
Edition p181.</p>
<dl class="method">
<dt id="xapian.CoordWeight.init">
<code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.CoordWeight.init" title="Permalink to this definition"></a></dt>
<dd><p>Allow the subclass to perform any initialisation it needs to.</p>
<p>void Xapian::CoordWeight::init(double <a href="#id36"><span class="problematic" id="id37">factor_</span></a>)</p>
<p>factor:  Any scaling factor (e.g. from OP_SCALE_WEIGHT). If the Weight
object is for the term-independent weight supplied by
get_sumextra()/get_maxextra(), then init(0.0) is called (starting from
Xapian 1.2.11 and 1.3.1 - earlier versions failed to call init() for
such Weight objects).</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.CoordWeight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.CoordWeight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.DLHWeight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">DLHWeight</code><a class="reference internal" href="_modules/xapian.html#DLHWeight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.DLHWeight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>This class implements the DLH weighting scheme, which is a
representative scheme of the Divergence from Randomness Framework by
Gianni Amati.</p>
<p>This is a parameter free weighting scheme and it should be used with
query expansion to obtain better results. It uses the HyperGeometric
Probabilistic model and Laplace&#8217;s normalization to calculate the risk
gain.</p>
<p>For more information about the DFR Framework and the DLH scheme,
please refer to : a.) Gianni Amati and Cornelis Joost Van Rijsbergen
Probabilistic models of information retrieval based on measuring the
divergence from randomness ACM Transactions on Information Systems
(TOIS) 20, (4), 2002, pp. 357-389. b.) FUB, IASI-CNR and University of
Tor Vergata at TREC 2007 Blog Track. G. Amati and E. Ambrosi and M.
Bianchi and C. Gaibisso and G. Gambosi. Proceedings of the 16th Text
REtrieval Conference (TREC-2007), 2008.</p>
<dl class="attribute">
<dt id="xapian.DLHWeight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.DLHWeight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.DPHWeight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">DPHWeight</code><a class="reference internal" href="_modules/xapian.html#DPHWeight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.DPHWeight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>This class implements the DPH weighting scheme.</p>
<p>DPH is a representative scheme of the Divergence from Randomness
Framework by Gianni Amati.</p>
<p>This is a parameter free weighting scheme and it should be used with
query expansion to obtain better results. It uses the HyperGeometric
Probabilistic model and Popper&#8217;s normalization to calculate the risk
gain.</p>
<p>For more information about the DFR Framework and the DPH scheme,
please refer to : a.) Gianni Amati and Cornelis Joost Van Rijsbergen
Probabilistic models of information retrieval based on measuring the
divergence from randomness ACM Transactions on Information Systems
(TOIS) 20, (4), 2002, pp. 357-389. b.) FUB, IASI-CNR and University of
Tor Vergata at TREC 2007 Blog Track. G. Amati and E. Ambrosi and M.
Bianchi and C. Gaibisso and G. Gambosi. Proceedings of the 16th Text
Retrieval Conference (TREC-2007), 2008.</p>
<dl class="attribute">
<dt id="xapian.DPHWeight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.DPHWeight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.Database">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">Database</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#Database"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Database" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>This class is used to access a database, or a group of databases.</p>
<p>For searching, this class is used in conjunction with an Enquire
object.</p>
<p>InvalidArgumentError:  will be thrown if an invalid argument is
supplied, for example, an unknown database type.</p>
<p>DatabaseOpeningError:  may be thrown if the database cannot be opened
(for example, a required file cannot be found).</p>
<p>DatabaseVersionError:  may be thrown if the database is in an
unsupported format (for example, created by a newer version of Xapian
which uses an incompatible format).</p>
<dl class="method">
<dt id="xapian.Database.add_database">
<code class="descname">add_database</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.add_database" title="Permalink to this definition"></a></dt>
<dd><p>Add an existing database (or group of databases) to those accessed by
this object.</p>
<p>void Xapian::Database::add_database(const Database &amp;database)</p>
<p>database:  the database(s) to add.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.allterms">
<code class="descname">allterms</code><span class="sig-paren">(</span><em>prefix=None</em><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.allterms" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator over all the terms in the database.</p>
<p>The iterator will return TermListItem objects, but these will not support
access to wdf, or position information.</p>
<p>Access to term frequency information is only available until the iterator
has moved on.</p>
<p>If prefix is supplied, only terms which start with that prefix will be
returned.</p>
</dd></dl>

<dl class="staticmethod">
<dt id="xapian.Database.check">
<em class="property">static </em><code class="descname">check</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.check" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.Database.close">
<code class="descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.close" title="Permalink to this definition"></a></dt>
<dd><p>Close the database.</p>
<p>virtual void Xapian::Database::close()</p>
<p>This closes the database and closes all its file handles.</p>
<p>For a WritableDatabase, if a transaction is active it will be aborted,
while if no transaction is active commit() will be implicitly called.
Also the write lock is released.</p>
<p>Closing a database cannot be undone - in particular, calling reopen()
after close() will not reopen it, but will instead throw a
Xapian::DatabaseError exception.</p>
<p>Calling close() again on a database which has already been closed has
no effect (and doesn&#8217;t raise an exception).</p>
<p>After close() has been called, calls to other methods of the database,
and to methods of other objects associated with the database, will
either:</p>
<p>behave exactly as they would have done if the database had not been
closed (this can only happen if all the required data is cached)</p>
<p>raise a Xapian::DatabaseError exception indicating that the database
is closed.</p>
<p>The reason for this behaviour is that otherwise we&#8217;d have to check
that the database is still open on every method call on every object
associated with a Database, when in many cases they are working on
data which has already been loaded and so they are able to just behave
correctly.</p>
<p>This method was added in Xapian 1.1.0.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.compact">
<code class="descname">compact</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.compact" title="Permalink to this definition"></a></dt>
<dd><p>Produce a compact version of this database.</p>
<p>void Xapian::Database::compact(int fd, unsigned flags, int block_size,
Xapian::Compactor &amp;compactor)</p>
<p>New 1.3.4. Various methods of the Compactor class were deprecated in
1.3.4.</p>
<p>The compactor functor allows handling progress output and specifying
how user metadata is merged.</p>
<p>This variant writes a single-file database to the specified file
descriptor. Only the glass backend supports such databases, so this
form is only supported for this backend.</p>
<p>fd:  File descriptor to write the compact version to. The descriptor
needs to be readable and writable (open with O_RDWR) and seekable. The
current file offset is used, allowing compacting to a single file
database embedded within another file. Xapian takes ownership of the
file descriptor and will close it before returning.</p>
<p>flags:  Any of the following combined using bitwise-or (| in C++):
Xapian::DBCOMPACT_NO_RENUMBER By default the document ids will be
renumbered the output - currently by applying the same offset to all
the document ids in a particular source database. If this flag is
specified, then this renumbering doesn&#8217;t happen, but all the document
ids must be unique over all source databases. Currently the ranges of
document ids in each source must not overlap either, though this
restriction may be removed in the future.</p>
<p>Xapian::DBCOMPACT_MULTIPASS If merging more than 3 databases, merge
the postlists in multiple passes, which is generally faster but
requires more disk space for temporary files.</p>
<p>Xapian::DBCOMPACT_SINGLE_FILE Produce a single-file database (only
supported for glass currently) - this flag is implied in this form and
need not be specified explicitly.</p>
<p>block_size:  This specifies the block size (in bytes) for to use for
the output. For glass, the block size must be a power of 2 between
2048 and 65536 (inclusive), and the default (also used if an invalid
value is passed) is 8192 bytes.</p>
<p>compactor:  Functor</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_avlength">
<code class="descname">get_avlength</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_avlength" title="Permalink to this definition"></a></dt>
<dd><p>Get the average length of the documents in the database.</p>
<p>Xapian::doclength Xapian::Database::get_avlength() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_collection_freq">
<code class="descname">get_collection_freq</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_collection_freq" title="Permalink to this definition"></a></dt>
<dd><p>Return the total number of occurrences of the given term.</p>
<p>Xapian::termcount Xapian::Database::get_collection_freq(const
std::string &amp;tname) const</p>
<p>This is the sum of the number of occurrences of the term in each
document it indexes: i.e., the sum of the within document frequencies
of the term.</p>
<p>tname:  The term whose collection frequency is being requested.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_doccount">
<code class="descname">get_doccount</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_doccount" title="Permalink to this definition"></a></dt>
<dd><p>Get the number of documents in the database.</p>
<p>Xapian::doccount Xapian::Database::get_doccount() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_doclength">
<code class="descname">get_doclength</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_doclength" title="Permalink to this definition"></a></dt>
<dd><p>Get the length of a document.</p>
<p>Xapian::termcount Xapian::Database::get_doclength(Xapian::docid did)
const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_doclength_lower_bound">
<code class="descname">get_doclength_lower_bound</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_doclength_lower_bound" title="Permalink to this definition"></a></dt>
<dd><p>Get a lower bound on the length of a document in this DB.</p>
<p>Xapian::termcount Xapian::Database::get_doclength_lower_bound() const</p>
<p>This bound does not include any zero-length documents.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_doclength_upper_bound">
<code class="descname">get_doclength_upper_bound</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_doclength_upper_bound" title="Permalink to this definition"></a></dt>
<dd><p>Get an upper bound on the length of a document in this DB.</p>
<p>Xapian::termcount Xapian::Database::get_doclength_upper_bound() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_document">
<code class="descname">get_document</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_document" title="Permalink to this definition"></a></dt>
<dd><p>Get a document from the database, given its document id.</p>
<p>Xapian::Document Xapian::Database::get_document(Xapian::docid did,
unsigned flags) const</p>
<p>This method returns a Xapian::Document object which provides the
information about a document.</p>
<p>did:  The document id of the document to retrieve.</p>
<p>flags:  Zero or more flags bitwise-or-ed together (currently only
Xapian::DOC_ASSUME_VALID is supported).</p>
<p>A Xapian::Document object containing the document data</p>
<p>Xapian::DocNotFoundError:  The document specified could not be found
in the database.</p>
<p>Xapian::InvalidArgumentError:  did was 0, which is not a valid
document id.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_lastdocid">
<code class="descname">get_lastdocid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_lastdocid" title="Permalink to this definition"></a></dt>
<dd><p>Get the highest document id which has been used in the database.</p>
<p>Xapian::docid Xapian::Database::get_lastdocid() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_metadata">
<code class="descname">get_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_metadata" title="Permalink to this definition"></a></dt>
<dd><p>Get the user-specified metadata associated with a given key.</p>
<p>std::string Xapian::Database::get_metadata(const std::string &amp;key)
const</p>
<p>User-specified metadata allows you to store arbitrary information in
the form of (key,tag) pairs. See  WritableDatabase::set_metadata() for
more information.</p>
<p>When invoked on a Xapian::Database object representing multiple
databases, currently only the metadata for the first is considered but
this behaviour may change in the future.</p>
<p>If there is no piece of metadata associated with the specified key, an
empty string is returned (this applies even for backends which don&#8217;t
support metadata).</p>
<p>Empty keys are not valid, and specifying one will cause an exception.</p>
<p>key:  The key of the metadata item to access.</p>
<p>The retrieved metadata item&#8217;s value.</p>
<p>Xapian::InvalidArgumentError:  will be thrown if the key supplied is
empty.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_revision">
<code class="descname">get_revision</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_revision" title="Permalink to this definition"></a></dt>
<dd><p>Get the revision of the database.</p>
<p>Xapian::rev Xapian::Database::get_revision() const</p>
<p>The revision is an unsigned integer which increases with each commit.</p>
<p>The database must have exactly one sub-database, which must be of type
chert or glass. Otherwise an exception will be thrown.</p>
<p>Experimental - seehttps://xapian.org/docs/deprecation#experimental-
features</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_spelling_suggestion">
<code class="descname">get_spelling_suggestion</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_spelling_suggestion" title="Permalink to this definition"></a></dt>
<dd><p>Suggest a spelling correction.</p>
<p>std::string Xapian::Database::get_spelling_suggestion(const
std::string &amp;word, unsigned max_edit_distance=2) const</p>
<p>word:  The potentially misspelled word.</p>
<p>max_edit_distance:  Only consider words which are at most
max_edit_distance edits from word. An edit is a character insertion,
deletion, or the transposition of two adjacent characters (default is
2).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_termfreq">
<code class="descname">get_termfreq</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_termfreq" title="Permalink to this definition"></a></dt>
<dd><p>Get the number of documents in the database indexed by a given term.</p>
<p>Xapian::doccount Xapian::Database::get_termfreq(const std::string
&amp;tname) const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_unique_terms">
<code class="descname">get_unique_terms</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_unique_terms" title="Permalink to this definition"></a></dt>
<dd><p>Get the number of unique terms in document.</p>
<p>Xapian::termcount Xapian::Database::get_unique_terms(Xapian::docid
did) const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_uuid">
<code class="descname">get_uuid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_uuid" title="Permalink to this definition"></a></dt>
<dd><p>Get a UUID for the database.</p>
<p>std::string Xapian::Database::get_uuid() const</p>
<p>The UUID will persist for the lifetime of the database.</p>
<p>Replicas (eg, made with the replication protocol, or by copying all
the database files) will have the same UUID. However, copies (made
with copydatabase, or xapian-compact) will have different UUIDs.</p>
<p>If the backend does not support UUIDs or this database has no
subdatabases, the UUID will be empty.</p>
<p>If this database has multiple sub-databases, the UUID string will
contain the UUIDs of all the sub-databases.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_value_freq">
<code class="descname">get_value_freq</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_value_freq" title="Permalink to this definition"></a></dt>
<dd><p>Return the frequency of a given value slot.</p>
<p>Xapian::doccount Xapian::Database::get_value_freq(Xapian::valueno
slot) const</p>
<p>This is the number of documents which have a (non-empty) value stored
in the slot.</p>
<p>slot:  The value slot to examine.</p>
<p>UnimplementedError:  The frequency of the value isn&#8217;t available for
this database type.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_value_lower_bound">
<code class="descname">get_value_lower_bound</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_value_lower_bound" title="Permalink to this definition"></a></dt>
<dd><p>Get a lower bound on the values stored in the given value slot.</p>
<p>std::string Xapian::Database::get_value_lower_bound(Xapian::valueno
slot) const</p>
<p>If there are no values stored in the given value slot, this will
return an empty string.</p>
<p>If the lower bound isn&#8217;t available for the given database type, this
will return the lowest possible bound - the empty string.</p>
<p>slot:  The value slot to examine.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_value_upper_bound">
<code class="descname">get_value_upper_bound</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_value_upper_bound" title="Permalink to this definition"></a></dt>
<dd><p>Get an upper bound on the values stored in the given value slot.</p>
<p>std::string Xapian::Database::get_value_upper_bound(Xapian::valueno
slot) const</p>
<p>If there are no values stored in the given value slot, this will
return an empty string.</p>
<p>slot:  The value slot to examine.</p>
<p>UnimplementedError:  The upper bound of the values isn&#8217;t available for
this database type.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.get_wdf_upper_bound">
<code class="descname">get_wdf_upper_bound</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.get_wdf_upper_bound" title="Permalink to this definition"></a></dt>
<dd><p>Get an upper bound on the wdf of term term.</p>
<p>Xapian::termcount Xapian::Database::get_wdf_upper_bound(const
std::string &amp;term) const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.has_positions">
<code class="descname">has_positions</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.has_positions" title="Permalink to this definition"></a></dt>
<dd><p>Does this database have any positional information?</p>
<p>bool Xapian::Database::has_positions() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.keep_alive">
<code class="descname">keep_alive</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.keep_alive" title="Permalink to this definition"></a></dt>
<dd><p>Send a &#8220;keep-alive&#8221; to remote databases to stop them timing out.</p>
<p>void Xapian::Database::keep_alive()</p>
<p>Has no effect on non-remote databases.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.locked">
<code class="descname">locked</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.locked" title="Permalink to this definition"></a></dt>
<dd><p>Test if this database is currently locked for writing.</p>
<p>bool Xapian::Database::locked() const</p>
<p>If the underlying object is actually a WritableDatabase, always
returns true.</p>
<p>Otherwise tests if there&#8217;s a writer holding the lock (or if we can&#8217;t
test for a lock without taking it on the current platform, throw
Xapian::UnimplementedError). If there&#8217;s an error while trying to test
the lock, throws Xapian::DatabaseLockError.</p>
<p>For multi-databases, this tests each sub-database and returns true if
any of them are locked.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.metadata_keys">
<code class="descname">metadata_keys</code><span class="sig-paren">(</span><em>prefix=''</em><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.metadata_keys" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator which returns all the metadata keys.</p>
<p>The iterator will return string objects.</p>
<p>If <cite>prefix</cite> is non-empty, only metadata keys with this prefix are returned.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.positionlist">
<code class="descname">positionlist</code><span class="sig-paren">(</span><em>docid</em>, <em>tname</em><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.positionlist" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator over all the positions in a given document of a term.</p>
<p>The iterator will return integers, in ascending order.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.postlist">
<code class="descname">postlist</code><span class="sig-paren">(</span><em>tname</em><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.postlist" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator over the postings which are indexed by a given term.</p>
<p>If <cite>tname</cite> is empty, an iterator over all the documents will be returned
(this will contain one entry for each document, will always return a wdf of
1, and will not allow access to a position iterator).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.reopen">
<code class="descname">reopen</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.reopen" title="Permalink to this definition"></a></dt>
<dd><p>Re-open the database.</p>
<p>bool Xapian::Database::reopen()</p>
<p>This re-opens the database(s) to the latest available version(s). It
can be used either to make sure the latest results are returned, or to
recover from a Xapian::DatabaseModifiedError.</p>
<p>Calling reopen() on a database which has been closed (with  close())
will always raise a Xapian::DatabaseError.</p>
<p>true if the database might have been reopened (if false is returned,
the database definitely hasn&#8217;t been reopened, which applications may
find useful when caching results, etc). In Xapian &lt; 1.3.0, this method
did not return a value.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.spellings">
<code class="descname">spellings</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.spellings" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator which returns all the spelling correction targets</p>
<p>The iterator will return TermListItem objects.  Only the term frequency is
available; wdf and positions are not meaningful.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.synonym_keys">
<code class="descname">synonym_keys</code><span class="sig-paren">(</span><em>prefix=''</em><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.synonym_keys" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator which returns all the terms which have synonyms.</p>
<p>The iterator will return string objects.</p>
<p>If <cite>prefix</cite> is non-empty, only terms with this prefix are returned.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.synonyms">
<code class="descname">synonyms</code><span class="sig-paren">(</span><em>term</em><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.synonyms" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator which returns all the synonyms for a given term.</p>
<p>The term to return synonyms for is specified by the <cite>term</cite> parameter.</p>
<p>The iterator will return string objects.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.term_exists">
<code class="descname">term_exists</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.term_exists" title="Permalink to this definition"></a></dt>
<dd><p>Check if a given term exists in the database.</p>
<p>bool Xapian::Database::term_exists(const std::string &amp;tname) const</p>
<p>tname:  The term to test the existence of.</p>
<p>true if and only if the term exists in the database. This is the same
as (get_termfreq(tname) != 0), but will often be more efficient.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.termlist">
<code class="descname">termlist</code><span class="sig-paren">(</span><em>docid</em><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.termlist" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator over all the terms which index a given document ID.</p>
<p>The iterator will return TermListItem objects.</p>
<p>Access to term frequency and position information is only available until
the iterator has moved on.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.Database.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.Database.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Database.valuestream">
<code class="descname">valuestream</code><span class="sig-paren">(</span><em>slot</em><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database.valuestream" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator over all the values stored in a slot in the database.</p>
<p>The iterator will return ValueStreamItem objects, in ascending order of
document id.</p>
</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="xapian.DatabaseCorruptError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">DatabaseCorruptError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#DatabaseCorruptError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.DatabaseCorruptError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.DatabaseError" title="xapian.DatabaseError"><code class="xref py py-class docutils literal"><span class="pre">xapian.DatabaseError</span></code></a></p>
<p>DatabaseCorruptError indicates database corruption was detected.</p>
</dd></dl>

<dl class="exception">
<dt id="xapian.DatabaseCreateError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">DatabaseCreateError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#DatabaseCreateError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.DatabaseCreateError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.DatabaseError" title="xapian.DatabaseError"><code class="xref py py-class docutils literal"><span class="pre">xapian.DatabaseError</span></code></a></p>
<p>DatabaseCreateError indicates a failure to create a database.</p>
</dd></dl>

<dl class="exception">
<dt id="xapian.DatabaseError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">DatabaseError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#DatabaseError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.DatabaseError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.RuntimeError" title="xapian.RuntimeError"><code class="xref py py-class docutils literal"><span class="pre">xapian.RuntimeError</span></code></a></p>
<p>DatabaseError indicates some sort of database related error.</p>
</dd></dl>

<dl class="exception">
<dt id="xapian.DatabaseLockError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">DatabaseLockError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#DatabaseLockError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.DatabaseLockError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.DatabaseError" title="xapian.DatabaseError"><code class="xref py py-class docutils literal"><span class="pre">xapian.DatabaseError</span></code></a></p>
<p>DatabaseLockError indicates failure to lock a database.</p>
</dd></dl>

<dl class="exception">
<dt id="xapian.DatabaseModifiedError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">DatabaseModifiedError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#DatabaseModifiedError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.DatabaseModifiedError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.DatabaseError" title="xapian.DatabaseError"><code class="xref py py-class docutils literal"><span class="pre">xapian.DatabaseError</span></code></a></p>
<p>DatabaseModifiedError indicates a database was modified.</p>
<p>To recover after catching this error, you need to call
Xapian::Database::reopen() on the Database and repeat the operation
which failed.</p>
</dd></dl>

<dl class="exception">
<dt id="xapian.DatabaseOpeningError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">DatabaseOpeningError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#DatabaseOpeningError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.DatabaseOpeningError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.DatabaseError" title="xapian.DatabaseError"><code class="xref py py-class docutils literal"><span class="pre">xapian.DatabaseError</span></code></a></p>
<p>DatabaseOpeningError indicates failure to open a database.</p>
</dd></dl>

<dl class="exception">
<dt id="xapian.DatabaseVersionError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">DatabaseVersionError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#DatabaseVersionError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.DatabaseVersionError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.DatabaseOpeningError" title="xapian.DatabaseOpeningError"><code class="xref py py-class docutils literal"><span class="pre">xapian.DatabaseOpeningError</span></code></a></p>
<p>DatabaseVersionError indicates that a database is in an unsupported
format.</p>
<p>From time to time, new versions of Xapian will require the database
format to be changed, to allow new information to be stored or new
optimisations to be performed. Backwards compatibility will sometimes
be maintained, so that new versions of Xapian can open old databases,
but in some cases Xapian will be unable to open a database because it
is in too old (or new) a format. This can be resolved either be
upgrading or downgrading the version of Xapian in use, or by
rebuilding the database from scratch with the current version of
Xapian.</p>
</dd></dl>

<dl class="function">
<dt id="xapian.Database_check">
<code class="descclassname">xapian.</code><code class="descname">Database_check</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Database_check" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="class">
<dt id="xapian.DateRangeProcessor">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">DateRangeProcessor</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#DateRangeProcessor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.DateRangeProcessor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.RangeProcessor" title="xapian.RangeProcessor"><code class="xref py py-class docutils literal"><span class="pre">xapian.RangeProcessor</span></code></a></p>
<p>Handle a date range.</p>
<p>Begin and end must be dates in a recognised format.</p>
<dl class="attribute">
<dt id="xapian.DateRangeProcessor.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.DateRangeProcessor.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.DateValueRangeProcessor">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">DateValueRangeProcessor</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#DateValueRangeProcessor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.DateValueRangeProcessor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.StringValueRangeProcessor" title="xapian.StringValueRangeProcessor"><code class="xref py py-class docutils literal"><span class="pre">xapian.StringValueRangeProcessor</span></code></a></p>
<p>Handle a date range.</p>
<p>Begin and end must be dates in a recognised format.</p>
<p>Deprecated Use Xapian::DateRangeProcessor instead (added in 1.3.6).</p>
<dl class="attribute">
<dt id="xapian.DateValueRangeProcessor.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.DateValueRangeProcessor.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.DecreasingValueWeightPostingSource">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">DecreasingValueWeightPostingSource</code><span class="sig-paren">(</span><em>slot_</em>, <em>range_start_=0</em>, <em>range_end_=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#DecreasingValueWeightPostingSource"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.DecreasingValueWeightPostingSource" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.ValueWeightPostingSource" title="xapian.ValueWeightPostingSource"><code class="xref py py-class docutils literal"><span class="pre">xapian.ValueWeightPostingSource</span></code></a></p>
<p>Read weights from a value which is known to decrease as docid
increases.</p>
<p>This posting source can be used, like ValueWeightPostingSource, to add
a weight contribution to a query based on the values stored in a slot.
The values in the slot must be serialised as by  sortable_serialise().</p>
<p>However, this posting source is additionally given a range of document
IDs, within which the weight is known to be decreasing. ie, for all
documents with ids A and B within this range (including the
endpoints), where A is less than B, the weight of A is less than or
equal to the weight of B. This can allow the posting source to skip to
the end of the range quickly if insufficient weight is left in the
posting source for a particular source.</p>
<p>By default, the range is assumed to cover all document IDs.</p>
<p>The ordering property can be arranged at index time, or by sorting an
indexed database to produce a new, sorted, database.</p>
<dl class="attribute">
<dt id="xapian.DecreasingValueWeightPostingSource.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.DecreasingValueWeightPostingSource.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="xapian.DocNotFoundError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">DocNotFoundError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#DocNotFoundError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.DocNotFoundError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.RuntimeError" title="xapian.RuntimeError"><code class="xref py py-class docutils literal"><span class="pre">xapian.RuntimeError</span></code></a></p>
<p>Indicates an attempt to access a document not present in the database.</p>
</dd></dl>

<dl class="class">
<dt id="xapian.Document">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">Document</code><a class="reference internal" href="_modules/xapian.html#Document"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Document" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>A handle representing a document in a Xapian database.</p>
<p>The Document class fetches information from the database lazily.
Usually this behaviour isn&#8217;t visible to users (except for the speed
benefits), but if the document in the database is modified or deleted,
then preexisting Document objects may return the old or new versions
of data (or throw Xapian::DocNotFoundError in the case of deletion).</p>
<p>Since Database objects work on a snapshot of the database&#8217;s state, the
situation above can only happen with a WritableDatabase object, or if
you call Database::reopen() on a Database object.</p>
<p>We recommend you avoid designs where this behaviour is an issue, but
if you need a way to make a non-lazy version of a Document object, you
can do this like so:doc =
Xapian::Document::unserialise(doc.serialise());</p>
<dl class="method">
<dt id="xapian.Document.add_boolean_term">
<code class="descname">add_boolean_term</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.add_boolean_term" title="Permalink to this definition"></a></dt>
<dd><p>Add a boolean filter term to the document.</p>
<p>void Xapian::Document::add_boolean_term(const std::string &amp;term)</p>
<p>This method adds term to the document with wdf of 0 - this is
generally what you want for a term used for boolean filtering as the
wdf of such terms is ignored, and it doesn&#8217;t make sense for them to
contribute to the document&#8217;s length.</p>
<p>If the specified term already indexes this document, this method has
no effect.</p>
<p>It is exactly the same as add_term(term, 0).</p>
<p>This method was added in Xapian 1.0.18.</p>
<p>term:  The term to add.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.add_posting">
<code class="descname">add_posting</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.add_posting" title="Permalink to this definition"></a></dt>
<dd><p>Add an occurrence of a term at a particular position.</p>
<p>void Xapian::Document::add_posting(const std::string &amp;tname,
Xapian::termpos tpos, Xapian::termcount wdfinc=1)</p>
<p>Multiple occurrences of the term at the same position are represented
only once in the positional information, but do increase the wdf.</p>
<p>If the term is not already in the document, it will be added to it.</p>
<p>tname:  The name of the term.</p>
<p>tpos:  The position of the term.</p>
<p>wdfinc:  The increment that will be applied to the wdf for this term.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.add_term">
<code class="descname">add_term</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.add_term" title="Permalink to this definition"></a></dt>
<dd><p>Add a term to the document, without positional information.</p>
<p>void Xapian::Document::add_term(const std::string &amp;tname,
Xapian::termcount wdfinc=1)</p>
<p>Any existing positional information for the term will be left
unmodified.</p>
<p>tname:  The name of the term.</p>
<p>wdfinc:  The increment that will be applied to the wdf for this term
(default: 1).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.add_value">
<code class="descname">add_value</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.add_value" title="Permalink to this definition"></a></dt>
<dd><p>Add a new value.</p>
<p>void Xapian::Document::add_value(Xapian::valueno slot, const
std::string &amp;value)</p>
<p>The new value will replace any existing value with the same number (or
if the new value is empty, it will remove any existing value with the
same number).</p>
<p>slot:  The value slot to add the value in.</p>
<p>value:  The value to set.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.clear_terms">
<code class="descname">clear_terms</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.clear_terms" title="Permalink to this definition"></a></dt>
<dd><p>Remove all terms (and postings) from the document.</p>
<p>void Xapian::Document::clear_terms()</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.clear_values">
<code class="descname">clear_values</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.clear_values" title="Permalink to this definition"></a></dt>
<dd><p>Remove all values associated with the document.</p>
<p>void Xapian::Document::clear_values()</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.get_data">
<code class="descname">get_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.get_data" title="Permalink to this definition"></a></dt>
<dd><p>Get data stored in the document.</p>
<p>std::string Xapian::Document::get_data() const</p>
<p>This is potentially a relatively expensive operation, and shouldn&#8217;t
normally be used during the match (e.g. in a PostingSource or match
decider functor. Put data for use by match deciders in a value
instead.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.get_docid">
<code class="descname">get_docid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.get_docid" title="Permalink to this definition"></a></dt>
<dd><p>Get the document id which is associated with this document (if any).</p>
<p>docid Xapian::Document::get_docid() const</p>
<p>NB If multiple databases are being searched together, then this will
be the document id in the individual database, not the merged
database!</p>
<p>If this document came from a database, return the document id in that
database. Otherwise, return 0 (in Xapian 1.0.22/1.2.4 or later; prior
to this the returned value was uninitialised).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.get_value">
<code class="descname">get_value</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.get_value" title="Permalink to this definition"></a></dt>
<dd><p>Get value by number.</p>
<p>std::string Xapian::Document::get_value(Xapian::valueno slot) const</p>
<p>Returns an empty string if no value with the given number is present
in the document.</p>
<p>slot:  The number of the value.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.remove_posting">
<code class="descname">remove_posting</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.remove_posting" title="Permalink to this definition"></a></dt>
<dd><p>Remove a posting of a term from the document.</p>
<p>void Xapian::Document::remove_posting(const std::string &amp;tname,
Xapian::termpos tpos, Xapian::termcount wdfdec=1)</p>
<p>Note that the term will still index the document even if all
occurrences are removed. To remove a term from a document completely,
use remove_term().</p>
<p>tname:  The name of the term.</p>
<p>tpos:  The position of the term.</p>
<p>wdfdec:  The decrement that will be applied to the wdf when removing
this posting. The wdf will not go below the value of 0.</p>
<p>Xapian::InvalidArgumentError:  will be thrown if the term is not at
the position specified in the position list for this term in this
document.</p>
<p>Xapian::InvalidArgumentError:  will be thrown if the term is not in
the document</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.remove_term">
<code class="descname">remove_term</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.remove_term" title="Permalink to this definition"></a></dt>
<dd><p>Remove a term and all postings associated with it.</p>
<p>void Xapian::Document::remove_term(const std::string &amp;tname)</p>
<p>tname:  The name of the term.</p>
<p>Xapian::InvalidArgumentError:  will be thrown if the term is not in
the document</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.remove_value">
<code class="descname">remove_value</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.remove_value" title="Permalink to this definition"></a></dt>
<dd><p>Remove any value with the given number.</p>
<p>void Xapian::Document::remove_value(Xapian::valueno slot)</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.serialise">
<code class="descname">serialise</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.serialise" title="Permalink to this definition"></a></dt>
<dd><p>Serialise document into a string.</p>
<p>std::string Xapian::Document::serialise() const</p>
<p>The document representation may change between Xapian releases: even
between minor versions. However, it is guaranteed not to change if the
remote database protocol has not changed between releases.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.set_data">
<code class="descname">set_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.set_data" title="Permalink to this definition"></a></dt>
<dd><p>Set data stored in the document.</p>
<p>void Xapian::Document::set_data(const std::string &amp;data)</p>
<p>Xapian treats the data as an opaque blob. It may try to compress it,
but other than that it will just store it and return it when
requested.</p>
<p>data:  The data to store.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.termlist">
<code class="descname">termlist</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.termlist" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator over all the terms in a document.</p>
<p>The iterator will return TermListItem objects.</p>
<p>Access to term frequency and position information is only available until
the iterator has moved on.</p>
<p>Note that term frequency information is only meaningful for a document
retrieved from a database.  If term frequency information is requested for
a document which was freshly created, an InvalidOperationError will be
raised.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.termlist_count">
<code class="descname">termlist_count</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.termlist_count" title="Permalink to this definition"></a></dt>
<dd><p>The length of the termlist - i.e.</p>
<p>Xapian::termcount Xapian::Document::termlist_count() const</p>
<p>the number of different terms which index this document.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.Document.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.Document.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

<dl class="staticmethod">
<dt id="xapian.Document.unserialise">
<em class="property">static </em><code class="descname">unserialise</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.unserialise" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.Document.values">
<code class="descname">values</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.values" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator over all the values stored in a document.</p>
<p>The iterator will return ValueItem objects, in ascending order of value number.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Document.values_count">
<code class="descname">values_count</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Document.values_count" title="Permalink to this definition"></a></dt>
<dd><p>Count the values in this document.</p>
<p>Xapian::termcount Xapian::Document::values_count() const</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ESet">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ESet</code><a class="reference internal" href="_modules/xapian.html#ESet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ESet" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Class representing a list of search results.</p>
<dl class="method">
<dt id="xapian.ESet.back">
<code class="descname">back</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ESet.back" title="Permalink to this definition"></a></dt>
<dd><p>Return iterator pointing to the last object in this ESet.</p>
<p>ESetIterator Xapian::ESet::back() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ESet.empty">
<code class="descname">empty</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ESet.empty" title="Permalink to this definition"></a></dt>
<dd><p>Return true if this ESet object is empty.</p>
<p>bool Xapian::ESet::empty() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ESet.get_ebound">
<code class="descname">get_ebound</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ESet.get_ebound" title="Permalink to this definition"></a></dt>
<dd><p>Return a bound on the full size of this ESet object.</p>
<p>Xapian::termcount Xapian::ESet::get_ebound() const</p>
<p>This is a bound on size() if get_eset() had been called with maxitems
set high enough that all results were returned.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.ESet.items">
<code class="descname">items</code><a class="headerlink" href="#xapian.ESet.items" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.ESet.size">
<code class="descname">size</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ESet.size" title="Permalink to this definition"></a></dt>
<dd><p>Return number of items in this ESet object.</p>
<p>Xapian::doccount Xapian::ESet::size() const</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.ESet.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.ESet.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ESetItem">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ESetItem</code><span class="sig-paren">(</span><em>iter</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ESetItem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ESetItem" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>An item returned from iteration of the ESet.</p>
<p>The item supports access to the following attributes:</p>
<blockquote>
<div><ul class="simple">
<li><cite>term</cite>: The term corresponding to this ESet item.</li>
<li><cite>weight</cite>: The weight corresponding to this ESet item.</li>
</ul>
</div></blockquote>
<dl class="attribute">
<dt id="xapian.ESetItem.term">
<code class="descname">term</code><a class="headerlink" href="#xapian.ESetItem.term" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.ESetItem.weight">
<code class="descname">weight</code><a class="headerlink" href="#xapian.ESetItem.weight" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ESetIter">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ESetIter</code><span class="sig-paren">(</span><em>eset</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ESetIter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ESetIter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>An iterator over the items in an ESet.</p>
<p>The iterator will return ESetItem objects.</p>
<dl class="method">
<dt id="xapian.ESetIter.next">
<code class="descname">next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ESetIter.next"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ESetIter.next" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.Enquire">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">Enquire</code><span class="sig-paren">(</span><em>database</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#Enquire"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Enquire" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>This class provides an interface to the information retrieval system
for the purpose of searching.</p>
<p>Databases are usually opened lazily, so exceptions may not be thrown
where you would expect them to be. You should catch Xapian::Error
exceptions when calling any method in Xapian::Enquire.</p>
<p>Xapian::InvalidArgumentError:  will be thrown if an invalid argument
is supplied, for example, an unknown database type.</p>
<dl class="attribute">
<dt id="xapian.Enquire.ASCENDING">
<code class="descname">ASCENDING</code><em class="property"> = 1</em><a class="headerlink" href="#xapian.Enquire.ASCENDING" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Enquire.DESCENDING">
<code class="descname">DESCENDING</code><em class="property"> = 0</em><a class="headerlink" href="#xapian.Enquire.DESCENDING" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Enquire.DONT_CARE">
<code class="descname">DONT_CARE</code><em class="property"> = 2</em><a class="headerlink" href="#xapian.Enquire.DONT_CARE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Enquire.INCLUDE_QUERY_TERMS">
<code class="descname">INCLUDE_QUERY_TERMS</code><em class="property"> = 1</em><a class="headerlink" href="#xapian.Enquire.INCLUDE_QUERY_TERMS" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Enquire.USE_EXACT_TERMFREQ">
<code class="descname">USE_EXACT_TERMFREQ</code><em class="property"> = 2</em><a class="headerlink" href="#xapian.Enquire.USE_EXACT_TERMFREQ" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.Enquire.add_matchspy">
<code class="descname">add_matchspy</code><span class="sig-paren">(</span><em>decider</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#Enquire.add_matchspy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Enquire.add_matchspy" title="Permalink to this definition"></a></dt>
<dd><p>Add a matchspy.</p>
<p>void Xapian::Enquire::add_matchspy(MatchSpy <a href="#id2"><span class="problematic" id="id3">*</span></a>spy)</p>
<p>This matchspy will be called with some of the documents which match
the query, during the match process. Exactly which of the matching
documents are passed to it depends on exactly when certain
optimisations occur during the match process, but it can be controlled
to some extent by setting the checkatleast parameter to  get_mset().</p>
<p>In particular, if there are enough matching documents, at least the
number specified by checkatleast will be passed to the matchspy. This
means that you can force the matchspy to be shown all matching
documents by setting checkatleast to the number of documents in the
database.</p>
<p>spy:  The MatchSpy subclass to add. The caller must ensure that this
remains valid while the Enquire object remains active, or until
clear_matchspies() is called.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.clear_matchspies">
<code class="descname">clear_matchspies</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#Enquire.clear_matchspies"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Enquire.clear_matchspies" title="Permalink to this definition"></a></dt>
<dd><p>Remove all the matchspies.</p>
<p>void Xapian::Enquire::clear_matchspies()</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.get_eset">
<code class="descname">get_eset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Enquire.get_eset" title="Permalink to this definition"></a></dt>
<dd><p>Get the expand set for the given rset.</p>
<p>ESet Xapian::Enquire::get_eset(Xapian::termcount maxitems, const RSet
&amp;rset, int flags, double k, const Xapian::ExpandDecider
<a href="#id4"><span class="problematic" id="id5">*</span></a>edecider=NULL, double min_wt=0.0) const</p>
<p>maxitems:  the maximum number of items to return.</p>
<p>rset:  the relevance set to use when performing the expand operation.</p>
<p>flags:  zero or more of these values <a href="#id6"><span class="problematic" id="id7">|</span></a>-ed together:
Xapian::Enquire::INCLUDE_QUERY_TERMS query terms may be returned from
expand</p>
<p>Xapian::Enquire::USE_EXACT_TERMFREQ for multi dbs, calculate the exact
termfreq; otherwise an approximation is used which can greatly improve
efficiency, but still returns good results.</p>
<p>k:  the parameter k in the query expansion algorithm (default is 1.0)</p>
<p>edecider:  a decision functor to use to decide whether a given term
should be put in the ESet</p>
<p>min_wt:  the minimum weight for included terms</p>
<p>An ESet object containing the results of the expand.</p>
<p>Xapian::InvalidArgumentError:  See class documentation.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.get_mset">
<code class="descname">get_mset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Enquire.get_mset" title="Permalink to this definition"></a></dt>
<dd><p>Get (a portion of) the match set for the current query.</p>
<p>MSet Xapian::Enquire::get_mset(Xapian::doccount first,
Xapian::doccount maxitems, const RSet <a href="#id8"><span class="problematic" id="id9">*</span></a>omrset, const MatchDecider
<a href="#id10"><span class="problematic" id="id11">*</span></a>mdecider=0) const</p>
<p>first:  the first item in the result set to return. A value of zero
corresponds to the first item returned being that with the highest
score. A value of 10 corresponds to the first 10 items being ignored,
and the returned items starting at the eleventh.</p>
<p>maxitems:  the maximum number of items to return. If you want all
matches, then you can pass the result of calling get_doccount() on the
Database object (though if you are doing this so you can filter
results, you are likely to get much better performance by using
Xapian&#8217;s match-time filtering features instead). You can pass 0 for
maxitems which will give you an empty MSet with valid statistics (such
as get_matches_estimated()) calculated without looking at any
postings, which is very quick, but means the estimates may be more
approximate and the bounds may be much looser.</p>
<p>omrset:  the relevance set to use when performing the query.</p>
<p>mdecider:  a decision functor to use to decide whether a given
document should be put in the MSet.</p>
<p>A Xapian::MSet object containing the results of the query.</p>
<p>Xapian::InvalidArgumentError:  See class documentation.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.get_query">
<code class="descname">get_query</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#Enquire.get_query"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Enquire.get_query" title="Permalink to this definition"></a></dt>
<dd><p>Get the current query.</p>
<p>const Xapian::Query&amp; Xapian::Enquire::get_query() const</p>
<p>If called before set_query(), this will return a default initialised
Query object.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.matching_terms">
<code class="descname">matching_terms</code><span class="sig-paren">(</span><em>which</em><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Enquire.matching_terms" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator over the terms which match a given match set item.</p>
<p>The match set item to consider is specified by the <cite>which</cite> parameter, which
may be a document ID, or an MSetItem object.</p>
<p>The iterator will return string objects.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.set_collapse_key">
<code class="descname">set_collapse_key</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Enquire.set_collapse_key" title="Permalink to this definition"></a></dt>
<dd><p>Set the collapse key to use for queries.</p>
<p>void Xapian::Enquire::set_collapse_key(Xapian::valueno collapse_key,
Xapian::doccount collapse_max=1)</p>
<p>collapse_key:  value number to collapse on - at most one MSet entry
with each particular value will be returned (default is
Xapian::BAD_VALUENO which means no collapsing).</p>
<p>collapse_max:  Max number of items with the same key to leave after
collapsing (default 1).</p>
<p>The MSet returned by get_mset() will have only the &#8220;best&#8221; (at most)
collapse_max entries with each particular value of collapse_key
(&#8220;best&#8221; being highest ranked - i.e. highest weight or highest
sorting key).</p>
<p>An example use might be to create a value for each document containing
an MD5 hash of the document contents. Then duplicate documents from
different sources can be eliminated at search time by collapsing with
collapse_max = 1 (it&#8217;s better to eliminate duplicates at index time,
but this may not be always be possible - for example the search may be
over more than one Xapian database).</p>
<p>Another use is to group matches in a particular category (e.g. you
might collapse a mailing list search on the Subject: so that there&#8217;s
only one result per discussion thread). In this case you can use
get_collapse_count() to give the user some idea how many other results
there are. And if you index the Subject: as a boolean term as well as
putting it in a value, you can offer a link to a non-collapsed search
restricted to that thread using a boolean filter.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.set_cutoff">
<code class="descname">set_cutoff</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Enquire.set_cutoff" title="Permalink to this definition"></a></dt>
<dd><p>Set the percentage and/or weight cutoffs.</p>
<p>void Xapian::Enquire::set_cutoff(int percent_cutoff, double
weight_cutoff=0)</p>
<p>percent_cutoff:  Minimum percentage score for returned documents. If a
document has a lower percentage score than this, it will not appear in
the MSet. If your intention is to return only matches which contain
all the terms in the query, then it&#8217;s more efficient to use
Xapian::Query::OP_AND instead of Xapian::Query::OP_OR in the query
than to use set_cutoff(100). (default 0 =&gt; no percentage cut-off).</p>
<p>weight_cutoff:  Minimum weight for a document to be returned. If a
document has a lower score that this, it will not appear in the MSet.
It is usually only possible to choose an appropriate weight for cutoff
based on the results of a previous run of the same query; this is thus
mainly useful for alerting operations. The other potential use is with
a user specified weighting scheme. (default 0 =&gt; no weight cut-off).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.set_docid_order">
<code class="descname">set_docid_order</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Enquire.set_docid_order" title="Permalink to this definition"></a></dt>
<dd><p>Set the direction in which documents are ordered by document id in the
returned MSet.</p>
<p>void Xapian::Enquire::set_docid_order(docid_order order)</p>
<p>This order only has an effect on documents which would otherwise have
equal rank. For a weighted probabilistic match with no sort value,
this means documents with equal weight. For a boolean match, with no
sort value, this means all documents. And if a sort value is used,
this means documents with equal sort value (and also equal weight if
ordering on relevance after the sort).</p>
<p>order:  This can be:  Xapian::Enquire::ASCENDING docids sort in
ascending order (default)</p>
<p>Xapian::Enquire::DESCENDING docids sort in descending order</p>
<p>Xapian::Enquire::DONT_CARE docids sort in whatever order is most
efficient for the backend</p>
<p>Note: If you add documents in strict date order, then a boolean search
- i.e. set_weighting_scheme(Xapian::BoolWeight()) - with
set_docid_order(Xapian::Enquire::DESCENDING) is an efficient way to
perform &#8220;sort by date, newest first&#8221;, and with
set_docid_order(Xapian::Enquire::ASCENDING) a very efficient way to
perform &#8220;sort by date, oldest first&#8221;.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.set_expansion_scheme">
<code class="descname">set_expansion_scheme</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Enquire.set_expansion_scheme" title="Permalink to this definition"></a></dt>
<dd><p>Set the weighting scheme to use for expansion.</p>
<p>void Xapian::Enquire::set_expansion_scheme(const std::string
&amp;eweightname_, double expand_k_=1.0) const</p>
<p>If you don&#8217;t call this method, the default is as if you&#8217;d used:</p>
<p>get_expansion_scheme(&#8220;trad&#8221;);</p>
<p><a href="#id38"><span class="problematic" id="id39">eweightname_</span></a>:  A string in lowercase specifying the name of the scheme
to be used. The following schemes are currently available: &#8220;bo1&#8221; :
The Bo1 scheme for query expansion. &#8220;trad&#8221; : The TradWeight scheme
for query expansion.</p>
<p><a href="#id40"><span class="problematic" id="id41">expand_k_</span></a>:  The parameter required for TradWeight query expansion. A
default value of 1.0 is used if none is specified.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.set_query">
<code class="descname">set_query</code><span class="sig-paren">(</span><em>query</em>, <em>qlen=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#Enquire.set_query"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Enquire.set_query" title="Permalink to this definition"></a></dt>
<dd><p>Set the query to run.</p>
<p>void Xapian::Enquire::set_query(const Xapian::Query &amp;query,
Xapian::termcount qlen=0)</p>
<p>query:  the new query to run.</p>
<p>qlen:  the query length to use in weight calculations - by default the
sum of the wqf of all terms is used.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.set_sort_by_key">
<code class="descname">set_sort_by_key</code><span class="sig-paren">(</span><em>sorter</em>, <em>reverse</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#Enquire.set_sort_by_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Enquire.set_sort_by_key" title="Permalink to this definition"></a></dt>
<dd><p>Set the sorting to be by key generated from values only.</p>
<p>void Xapian::Enquire::set_sort_by_key(Xapian::KeyMaker <a href="#id12"><span class="problematic" id="id13">*</span></a>sorter, bool
reverse)</p>
<p>sorter:  The functor to use for generating keys.</p>
<p>reverse:  If true, reverses the sort order.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.set_sort_by_key_then_relevance">
<code class="descname">set_sort_by_key_then_relevance</code><span class="sig-paren">(</span><em>sorter</em>, <em>reverse</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#Enquire.set_sort_by_key_then_relevance"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Enquire.set_sort_by_key_then_relevance" title="Permalink to this definition"></a></dt>
<dd><p>Set the sorting to be by keys generated from values, then by relevance
for documents with identical keys.</p>
<p>void Xapian::Enquire::set_sort_by_key_then_relevance(Xapian::KeyMaker
<a href="#id14"><span class="problematic" id="id15">*</span></a>sorter, bool reverse)</p>
<p>sorter:  The functor to use for generating keys.</p>
<p>reverse:  If true, reverses the sort order.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.set_sort_by_relevance">
<code class="descname">set_sort_by_relevance</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Enquire.set_sort_by_relevance" title="Permalink to this definition"></a></dt>
<dd><p>Set the sorting to be by relevance only.</p>
<p>void Xapian::Enquire::set_sort_by_relevance()</p>
<p>This is the default.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.set_sort_by_relevance_then_key">
<code class="descname">set_sort_by_relevance_then_key</code><span class="sig-paren">(</span><em>sorter</em>, <em>reverse</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#Enquire.set_sort_by_relevance_then_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Enquire.set_sort_by_relevance_then_key" title="Permalink to this definition"></a></dt>
<dd><p>Set the sorting to be by relevance, then by keys generated from
values.</p>
<p>void Xapian::Enquire::set_sort_by_relevance_then_key(Xapian::KeyMaker
<a href="#id16"><span class="problematic" id="id17">*</span></a>sorter, bool reverse)</p>
<p>Note that with the default BM25 weighting scheme parameters, non-
identical documents will rarely have the same weight, so this setting
will give very similar results to set_sort_by_relevance(). It becomes
more useful with particular BM25 parameter settings (e.g.
BM25Weight(1,0,1,0,0)) or custom weighting schemes.</p>
<p>sorter:  The functor to use for generating keys.</p>
<p>reverse:  If true, reverses the sort order of the generated keys.
Beware that in 1.2.16 and earlier, the sense of this parameter was
incorrectly inverted and inconsistent with the other <a href="#id42"><span class="problematic" id="id43">set_sort_by_</span></a>...
methods. This was fixed in 1.2.17, so make that version a minimum
requirement if this detail matters to your application.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.set_sort_by_relevance_then_value">
<code class="descname">set_sort_by_relevance_then_value</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Enquire.set_sort_by_relevance_then_value" title="Permalink to this definition"></a></dt>
<dd><p>Set the sorting to be by relevance then value.</p>
<p>void Xapian::Enquire::set_sort_by_relevance_then_value(Xapian::valueno
sort_key, bool reverse)</p>
<p>Note that sorting by values uses a string comparison, so to use this
to sort by a numeric value you&#8217;ll need to store the numeric values in
a manner which sorts appropriately. For example, you could use
Xapian::sortable_serialise() (which works for floating point numbers
as well as integers), or store numbers padded with leading zeros or
spaces, or with the number of digits prepended.</p>
<p>Note that with the default BM25 weighting scheme parameters, non-
identical documents will rarely have the same weight, so this setting
will give very similar results to set_sort_by_relevance(). It becomes
more useful with particular BM25 parameter settings (e.g.
BM25Weight(1,0,1,0,0)) or custom weighting schemes.</p>
<p>sort_key:  value number to sort on.</p>
<p>reverse:  If true, reverses the sort order of sort_key. Beware that in
1.2.16 and earlier, the sense of this parameter was incorrectly
inverted and inconsistent with the other <a href="#id44"><span class="problematic" id="id45">set_sort_by_</span></a>... methods. This
was fixed in 1.2.17, so make that version a minimum requirement if
this detail matters to your application.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.set_sort_by_value">
<code class="descname">set_sort_by_value</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Enquire.set_sort_by_value" title="Permalink to this definition"></a></dt>
<dd><p>Set the sorting to be by value only.</p>
<p>void Xapian::Enquire::set_sort_by_value(Xapian::valueno sort_key, bool
reverse)</p>
<p>Note that sorting by values uses a string comparison, so to use this
to sort by a numeric value you&#8217;ll need to store the numeric values in
a manner which sorts appropriately. For example, you could use
Xapian::sortable_serialise() (which works for floating point numbers
as well as integers), or store numbers padded with leading zeros or
spaces, or with the number of digits prepended.</p>
<p>sort_key:  value number to sort on.</p>
<p>reverse:  If true, reverses the sort order.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.set_sort_by_value_then_relevance">
<code class="descname">set_sort_by_value_then_relevance</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Enquire.set_sort_by_value_then_relevance" title="Permalink to this definition"></a></dt>
<dd><p>Set the sorting to be by value, then by relevance for documents with
the same value.</p>
<p>void Xapian::Enquire::set_sort_by_value_then_relevance(Xapian::valueno
sort_key, bool reverse)</p>
<p>Note that sorting by values uses a string comparison, so to use this
to sort by a numeric value you&#8217;ll need to store the numeric values in
a manner which sorts appropriately. For example, you could use
Xapian::sortable_serialise() (which works for floating point numbers
as well as integers), or store numbers padded with leading zeros or
spaces, or with the number of digits prepended.</p>
<p>sort_key:  value number to sort on.</p>
<p>reverse:  If true, reverses the sort order.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.set_time_limit">
<code class="descname">set_time_limit</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Enquire.set_time_limit" title="Permalink to this definition"></a></dt>
<dd><p>Set a time limit for the match.</p>
<p>void Xapian::Enquire::set_time_limit(double time_limit)</p>
<p>Matches with check_at_least set high can take a long time in some
cases. You can set a time limit on this, after which check_at_least
will be turned off.</p>
<p>time_limit:  time in seconds after which to disable check_at_least
(default: 0.0 which means no time limit)</p>
<p>Limitations:</p>
<p>This feature is currently supported on platforms which support POSIX
interval timers. Interaction with the remote backend when using
multiple databases may have bugs. There&#8217;s not currently a way to force
the match to end after a certain time.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Enquire.set_weighting_scheme">
<code class="descname">set_weighting_scheme</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Enquire.set_weighting_scheme" title="Permalink to this definition"></a></dt>
<dd><p>Set the weighting scheme to use for queries.</p>
<p>void Xapian::Enquire::set_weighting_scheme(const Weight &amp;weight_)</p>
<p><a href="#id46"><span class="problematic" id="id47">weight_</span></a>:  the new weighting scheme. If no weighting scheme is
specified, the default is BM25 with the default parameters.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.Enquire.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.Enquire.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="xapian.Error">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">Error</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#Error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Error" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></code></p>
<p>All exceptions thrown by Xapian are subclasses of Xapian::Error.</p>
<p>This class can not be instantiated directly - instead a subclass
should be used.</p>
<dl class="method">
<dt id="xapian.Error.get_context">
<code class="descname">get_context</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Error.get_context" title="Permalink to this definition"></a></dt>
<dd><p>Optional context information.</p>
<p>const std::string&amp; Xapian::Error::get_context() const</p>
<p>This context is intended for use by Xapian::ErrorHandler (for example
so it can know which remote server is unreliable and report the
problem and remove that server from those being searched). But it&#8217;s
typically a plain-text string, and so also fit for human consumption.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Error.get_error_string">
<code class="descname">get_error_string</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Error.get_error_string" title="Permalink to this definition"></a></dt>
<dd><p>Returns any system error string associated with this exception.</p>
<p>const char* Xapian::Error::get_error_string() const</p>
<p>The system error string may come from errno, h_errno (on UNIX), or
GetLastError() (on MS Windows). If there is no associated system error
string, NULL is returned.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Error.get_msg">
<code class="descname">get_msg</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Error.get_msg" title="Permalink to this definition"></a></dt>
<dd><p>Message giving details of the error, intended for human consumption.</p>
<p>const std::string&amp; Xapian::Error::get_msg() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Error.get_type">
<code class="descname">get_type</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Error.get_type" title="Permalink to this definition"></a></dt>
<dd><p>The type of this error (e.g. &#8220;DocNotFoundError&#8221;.)</p>
<p>const char* Xapian::Error::get_type() const</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ExpandDecider">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ExpandDecider</code><a class="reference internal" href="_modules/xapian.html#ExpandDecider"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ExpandDecider" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Virtual base class for expand decider functor.</p>
<dl class="method">
<dt id="xapian.ExpandDecider.release">
<code class="descname">release</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ExpandDecider.release" title="Permalink to this definition"></a></dt>
<dd><p>Start reference counting this object.</p>
<p>const ExpandDecider* Xapian::ExpandDecider::release() const</p>
<p>You can hand ownership of a dynamically allocated ErrorHandler object
to Xapian by calling release() and then passing the object to a Xapian
method. Xapian will arrange to delete the object once it is no longer
required.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.ExpandDecider.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.ExpandDecider.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ExpandDeciderAnd">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ExpandDeciderAnd</code><span class="sig-paren">(</span><em>first_</em>, <em>second_</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ExpandDeciderAnd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ExpandDeciderAnd" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.ExpandDecider" title="xapian.ExpandDecider"><code class="xref py py-class docutils literal"><span class="pre">xapian.ExpandDecider</span></code></a></p>
<p>ExpandDecider subclass which rejects terms using two ExpandDeciders.</p>
<p>Terms are only accepted if they are accepted by both of the specified
ExpandDecider objects.</p>
<dl class="attribute">
<dt id="xapian.ExpandDeciderAnd.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.ExpandDeciderAnd.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ExpandDeciderFilterPrefix">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ExpandDeciderFilterPrefix</code><span class="sig-paren">(</span><em>prefix_</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ExpandDeciderFilterPrefix"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ExpandDeciderFilterPrefix" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.ExpandDecider" title="xapian.ExpandDecider"><code class="xref py py-class docutils literal"><span class="pre">xapian.ExpandDecider</span></code></a></p>
<p>ExpandDecider subclass which restrict terms to a particular prefix.</p>
<p>ExpandDeciderFilterPrefix provides an easy way to choose terms with a
particular prefix when generating an ESet.</p>
<dl class="attribute">
<dt id="xapian.ExpandDeciderFilterPrefix.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.ExpandDeciderFilterPrefix.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="xapian.FeatureUnavailableError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">FeatureUnavailableError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#FeatureUnavailableError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.FeatureUnavailableError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.RuntimeError" title="xapian.RuntimeError"><code class="xref py py-class docutils literal"><span class="pre">xapian.RuntimeError</span></code></a></p>
<p>Indicates an attempt to use a feature which is unavailable.</p>
<p>Typically a feature is unavailable because it wasn&#8217;t compiled in, or
because it requires other software or facilities which aren&#8217;t
available.</p>
</dd></dl>

<dl class="class">
<dt id="xapian.FieldProcessor">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">FieldProcessor</code><a class="reference internal" href="_modules/xapian.html#FieldProcessor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.FieldProcessor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Base class for field processors.</p>
<dl class="method">
<dt id="xapian.FieldProcessor.release">
<code class="descname">release</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.FieldProcessor.release" title="Permalink to this definition"></a></dt>
<dd><p>Start reference counting this object.</p>
<p>const FieldProcessor* Xapian::FieldProcessor::release() const</p>
<p>You can hand ownership of a dynamically allocated FieldProcessor
object to Xapian by calling release() and then passing the object to a
Xapian method. Xapian will arrange to delete the object once it is no
longer required.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.FieldProcessor.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.FieldProcessor.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.FixedWeightPostingSource">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">FixedWeightPostingSource</code><span class="sig-paren">(</span><em>wt</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#FixedWeightPostingSource"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.FixedWeightPostingSource" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.PostingSource" title="xapian.PostingSource"><code class="xref py py-class docutils literal"><span class="pre">xapian.PostingSource</span></code></a></p>
<p>A posting source which returns a fixed weight for all documents.</p>
<p>This returns entries for all documents in the given database, with a
fixed weight (specified by a parameter to the constructor).</p>
<dl class="attribute">
<dt id="xapian.FixedWeightPostingSource.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.FixedWeightPostingSource.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.GreatCircleMetric">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">GreatCircleMetric</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#GreatCircleMetric"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.GreatCircleMetric" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.LatLongMetric" title="xapian.LatLongMetric"><code class="xref py py-class docutils literal"><span class="pre">xapian.LatLongMetric</span></code></a></p>
<p>Calculate the great-circle distance between two coordinates on a
sphere.</p>
<p>Experimental - seehttps://xapian.org/docs/deprecation#experimental-
features</p>
<p>This uses the haversine formula to calculate the distance. Note that
this formula is subject to inaccuracy due to numerical errors for
coordinates on the opposite side of the sphere.</p>
<p>Seehttp://en.wikipedia.org/wiki/Haversine_formula</p>
<dl class="attribute">
<dt id="xapian.GreatCircleMetric.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.GreatCircleMetric.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.IfB2Weight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">IfB2Weight</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#IfB2Weight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.IfB2Weight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>This class implements the IfB2 weighting scheme.</p>
<p>IfB2 is a representative scheme of the Divergence from Randomness
Framework by Gianni Amati.</p>
<p>It uses the Inverse term frequency model (If), the Bernoulli method to
find the aftereffect of sampling (B) and the second wdf normalization
proposed by Amati to normalize the wdf in the document to the length
of the document (H2).</p>
<p>For more information about the DFR Framework and the IfB2 scheme,
please refer to: Gianni Amati and Cornelis Joost Van Rijsbergen
Probabilistic models of information retrieval based on measuring the
divergence from randomness ACM Transactions on Information Systems
(TOIS) 20, (4), 2002, pp. 357-389.</p>
<dl class="attribute">
<dt id="xapian.IfB2Weight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.IfB2Weight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.InL2Weight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">InL2Weight</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#InL2Weight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.InL2Weight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>This class implements the InL2 weighting scheme.</p>
<p>InL2 is a representative scheme of the Divergence from Randomness
Framework by Gianni Amati.</p>
<p>This weighting scheme is useful for tasks that require early
precision.</p>
<p>It uses the Inverse document frequency model (In), the Laplace method
to find the aftereffect of sampling (L) and the second wdf
normalization proposed by Amati to normalize the wdf in the document
to the length of the document (H2).</p>
<p>For more information about the DFR Framework and the InL2 scheme,
please refer to: Gianni Amati and Cornelis Joost Van Rijsbergen
Probabilistic models of information retrieval based on measuring the
divergence from randomness ACM Transactions on Information Systems
(TOIS) 20, (4), 2002, pp. 357-389.</p>
<dl class="attribute">
<dt id="xapian.InL2Weight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.InL2Weight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.IneB2Weight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">IneB2Weight</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#IneB2Weight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.IneB2Weight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>This class implements the IneB2 weighting scheme.</p>
<p>IneB2 is a representative scheme of the Divergence from Randomness
Framework by Gianni Amati.</p>
<p>It uses the Inverse expected document frequency model (Ine), the
Bernoulli method to find the aftereffect of sampling (B) and the
second wdf normalization proposed by Amati to normalize the wdf in the
document to the length of the document (H2).</p>
<p>For more information about the DFR Framework and the IneB2 scheme,
please refer to: Gianni Amati and Cornelis Joost Van Rijsbergen
Probabilistic models of information retrieval based on measuring the
divergence from randomness ACM Transactions on Information Systems
(TOIS) 20, (4), 2002, pp. 357-389.</p>
<dl class="attribute">
<dt id="xapian.IneB2Weight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.IneB2Weight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="xapian.InternalError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">InternalError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#InternalError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.InternalError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.RuntimeError" title="xapian.RuntimeError"><code class="xref py py-class docutils literal"><span class="pre">xapian.RuntimeError</span></code></a></p>
<p>InternalError indicates a runtime problem of some sort.</p>
</dd></dl>

<dl class="exception">
<dt id="xapian.InvalidArgumentError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">InvalidArgumentError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#InvalidArgumentError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.InvalidArgumentError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.LogicError" title="xapian.LogicError"><code class="xref py py-class docutils literal"><span class="pre">xapian.LogicError</span></code></a></p>
<p>InvalidArgumentError indicates an invalid parameter value was passed
to the API.</p>
</dd></dl>

<dl class="exception">
<dt id="xapian.InvalidOperationError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">InvalidOperationError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#InvalidOperationError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.InvalidOperationError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.LogicError" title="xapian.LogicError"><code class="xref py py-class docutils literal"><span class="pre">xapian.LogicError</span></code></a></p>
<p>InvalidOperationError indicates the API was used in an invalid way.</p>
</dd></dl>

<dl class="class">
<dt id="xapian.KeyMaker">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">KeyMaker</code><a class="reference internal" href="_modules/xapian.html#KeyMaker"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.KeyMaker" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Virtual base class for key making functors.</p>
<dl class="method">
<dt id="xapian.KeyMaker.release">
<code class="descname">release</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.KeyMaker.release" title="Permalink to this definition"></a></dt>
<dd><p>Start reference counting this object.</p>
<p>const KeyMaker* Xapian::KeyMaker::release() const</p>
<p>You can hand ownership of a dynamically allocated KeyMaker object to
Xapian by calling release() and then passing the object to a Xapian
method. Xapian will arrange to delete the object once it is no longer
required.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.KeyMaker.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.KeyMaker.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.LMWeight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">LMWeight</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#LMWeight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.LMWeight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>Xapian::Weight subclass implementing the Language Model formula.</p>
<p>This class implements the &#8220;Language Model&#8221; Weighting scheme, as
described by the early papers on LM by Bruce Croft.</p>
<p>LM works by comparing the query to a Language Model of the document.
The language model itself is parameter-free, though LMWeight takes
parameters which specify the smoothing used.</p>
<dl class="attribute">
<dt id="xapian.LMWeight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.LMWeight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.LatLongCoord">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">LatLongCoord</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#LatLongCoord"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.LatLongCoord" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>A latitude-longitude coordinate.</p>
<p>Experimental - seehttps://xapian.org/docs/deprecation#experimental-
features</p>
<p>Note that latitude-longitude coordinates are only precisely meaningful
if the datum used to define them is specified. This class ignores this
issue - it is up to the caller to ensure that the datum used for each
coordinate in a system is consistent.</p>
<dl class="attribute">
<dt id="xapian.LatLongCoord.latitude">
<code class="descname">latitude</code><a class="headerlink" href="#xapian.LatLongCoord.latitude" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.LatLongCoord.longitude">
<code class="descname">longitude</code><a class="headerlink" href="#xapian.LatLongCoord.longitude" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.LatLongCoord.serialise">
<code class="descname">serialise</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.LatLongCoord.serialise" title="Permalink to this definition"></a></dt>
<dd><p>Return a serialised representation of the coordinate.</p>
<p>std::string Xapian::LatLongCoord::serialise() const</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.LatLongCoord.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.LatLongCoord.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

<dl class="method">
<dt id="xapian.LatLongCoord.unserialise">
<code class="descname">unserialise</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.LatLongCoord.unserialise" title="Permalink to this definition"></a></dt>
<dd><p>Unserialise a buffer and set this object to its coordinate.</p>
<p>void Xapian::LatLongCoord::unserialise(const char <a href="#id18"><span class="problematic" id="id19">**</span></a>ptr, const char
<a href="#id20"><span class="problematic" id="id21">*</span></a>end)</p>
<p>The buffer may contain further data after that for the coordinate.</p>
<p>ptr:  A pointer to the start of the string. This will be updated to
point to the end of the data representing the coordinate.</p>
<p>end:  A pointer to the end of the string.</p>
<p>Xapian::SerialisationError:  if the string does not start with a valid
serialised latitude- longitude pair.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.LatLongCoords">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">LatLongCoords</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#LatLongCoords"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.LatLongCoords" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>A sequence of latitude-longitude coordinates.</p>
<p>Experimental - seehttps://xapian.org/docs/deprecation#experimental-
features</p>
<dl class="method">
<dt id="xapian.LatLongCoords.append">
<code class="descname">append</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.LatLongCoords.append" title="Permalink to this definition"></a></dt>
<dd><p>Append a coordinate to the end of the sequence.</p>
<p>void Xapian::LatLongCoords::append(const LatLongCoord &amp;coord)</p>
</dd></dl>

<dl class="method">
<dt id="xapian.LatLongCoords.begin">
<code class="descname">begin</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.LatLongCoords.begin" title="Permalink to this definition"></a></dt>
<dd><p>Get a begin iterator for the coordinates.</p>
<p>LatLongCoordsIterator Xapian::LatLongCoords::begin() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.LatLongCoords.empty">
<code class="descname">empty</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.LatLongCoords.empty" title="Permalink to this definition"></a></dt>
<dd><p>Return true if and only if there are no coordinates in the container.</p>
<p>bool Xapian::LatLongCoords::empty() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.LatLongCoords.end">
<code class="descname">end</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.LatLongCoords.end" title="Permalink to this definition"></a></dt>
<dd><p>Get an end iterator for the coordinates.</p>
<p>LatLongCoordsIterator Xapian::LatLongCoords::end() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.LatLongCoords.serialise">
<code class="descname">serialise</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.LatLongCoords.serialise" title="Permalink to this definition"></a></dt>
<dd><p>Return a serialised form of the coordinate list.</p>
<p>std::string Xapian::LatLongCoords::serialise() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.LatLongCoords.size">
<code class="descname">size</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.LatLongCoords.size" title="Permalink to this definition"></a></dt>
<dd><p>Get the number of coordinates in the container.</p>
<p>size_t Xapian::LatLongCoords::size() const</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.LatLongCoords.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.LatLongCoords.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

<dl class="method">
<dt id="xapian.LatLongCoords.unserialise">
<code class="descname">unserialise</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.LatLongCoords.unserialise" title="Permalink to this definition"></a></dt>
<dd><p>Unserialise a string and set this object to the coordinates in it.</p>
<p>void Xapian::LatLongCoords::unserialise(const std::string &amp;serialised)</p>
<p>serialised:  the string to unserialise the coordinates from.</p>
<p>Xapian::SerialisationError:  if the string does not contain a valid
serialised latitude-longitude pair, or contains junk at the end of it.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.LatLongCoordsIter">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">LatLongCoordsIter</code><span class="sig-paren">(</span><em>start</em>, <em>end</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#LatLongCoordsIter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.LatLongCoordsIter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>An iterator over all the coordinates in a LatLongCoords object.</p>
<p>The iterator returns LatLongCoord objects.</p>
<dl class="method">
<dt id="xapian.LatLongCoordsIter.next">
<code class="descname">next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#LatLongCoordsIter.next"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.LatLongCoordsIter.next" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.LatLongDistanceKeyMaker">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">LatLongDistanceKeyMaker</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#LatLongDistanceKeyMaker"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.LatLongDistanceKeyMaker" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.KeyMaker" title="xapian.KeyMaker"><code class="xref py py-class docutils literal"><span class="pre">xapian.KeyMaker</span></code></a></p>
<p>KeyMaker subclass which sorts by distance from a latitude/longitude.</p>
<p>Experimental - seehttps://xapian.org/docs/deprecation#experimental-
features</p>
<p>Results are ordered by the distance from a fixed point, or list of
points, calculated according to the metric supplied. If multiple
points are supplied (either in the constructor, or in the coordinates
stored in a document), the closest pointwise distance is used.</p>
<p>If a document contains no coordinate stored in the specified slot, a
special value for the distance will be used. This defaults to a large
number, so that such results get a low rank, but may be specified by a
constructor parameter.</p>
<dl class="attribute">
<dt id="xapian.LatLongDistanceKeyMaker.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.LatLongDistanceKeyMaker.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.LatLongDistancePostingSource">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">LatLongDistancePostingSource</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#LatLongDistancePostingSource"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.LatLongDistancePostingSource" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.ValuePostingSource" title="xapian.ValuePostingSource"><code class="xref py py-class docutils literal"><span class="pre">xapian.ValuePostingSource</span></code></a></p>
<p>Posting source which returns a weight based on geospatial distance.</p>
<p>Experimental - seehttps://xapian.org/docs/deprecation#experimental-
features</p>
<p>Results are weighted by the distance from a fixed point, or list of
points, calculated according to the metric supplied. If multiple
points are supplied (either in the constructor, or in the coordinates
stored in a document), the closest pointwise distance is used.</p>
<p>Documents further away than a specified maximum range (or with no
location stored in the specified slot) will not be returned.</p>
<p>The weight returned is computed from the distance using the formula:</p>
<p>k1 * pow(distance + k1, -k2)</p>
<p>(Where k1 and k2 are (strictly) positive, floating point constants,
which default to 1000 and 1, respectively. Distance is measured in
metres, so this means that something at the centre gets a weight of
1.0, something 1km away gets a weight of 0.5, and something 3km away
gets a weight of 0.25, etc)</p>
<dl class="attribute">
<dt id="xapian.LatLongDistancePostingSource.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.LatLongDistancePostingSource.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.LatLongMetric">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">LatLongMetric</code><a class="reference internal" href="_modules/xapian.html#LatLongMetric"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.LatLongMetric" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Base class for calculating distances between two lat/long coordinates.</p>
<p>Experimental - seehttps://xapian.org/docs/deprecation#experimental-
features</p>
<dl class="method">
<dt id="xapian.LatLongMetric.name">
<code class="descname">name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.LatLongMetric.name" title="Permalink to this definition"></a></dt>
<dd><p>Return the full name of the metric.</p>
<p>virtual std::string Xapian::LatLongMetric::name() const =0</p>
<p>This is used when serialising and unserialising metrics; for example,
for performing remote searches.</p>
<p>If the subclass is in a C++ namespace, the namespace should be
included in the name, using &#8221;::&#8221; as a separator. For example, for a
LatLongMetric subclass called &#8220;FooLatLongMetric&#8221; in the &#8220;Xapian&#8221;
namespace the result of this call should be
&#8220;Xapian::FooLatLongMetric&#8221;.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.LatLongMetric.pointwise_distance">
<code class="descname">pointwise_distance</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.LatLongMetric.pointwise_distance" title="Permalink to this definition"></a></dt>
<dd><p>Return the distance between two coordinates, in metres.</p>
<p>virtual double Xapian::LatLongMetric::pointwise_distance(const
LatLongCoord &amp;a, const LatLongCoord &amp;b) const =0</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.LatLongMetric.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.LatLongMetric.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="xapian.LogicError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">LogicError</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#LogicError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.LogicError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Error" title="xapian.Error"><code class="xref py py-class docutils literal"><span class="pre">xapian.Error</span></code></a></p>
<p>The base class for exceptions indicating errors in the program logic.</p>
<p>A subclass of LogicError will be thrown if Xapian detects a violation
of a class invariant or a logical precondition or postcondition, etc.</p>
</dd></dl>

<dl class="class">
<dt id="xapian.MSet">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">MSet</code><a class="reference internal" href="_modules/xapian.html#MSet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.MSet" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Class representing a list of search results.</p>
<dl class="attribute">
<dt id="xapian.MSet.SNIPPET_BACKGROUND_MODEL">
<code class="descname">SNIPPET_BACKGROUND_MODEL</code><em class="property"> = 1</em><a class="headerlink" href="#xapian.MSet.SNIPPET_BACKGROUND_MODEL" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.MSet.SNIPPET_EMPTY_WITHOUT_MATCH">
<code class="descname">SNIPPET_EMPTY_WITHOUT_MATCH</code><em class="property"> = 4</em><a class="headerlink" href="#xapian.MSet.SNIPPET_EMPTY_WITHOUT_MATCH" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.MSet.SNIPPET_EXHAUSTIVE">
<code class="descname">SNIPPET_EXHAUSTIVE</code><em class="property"> = 2</em><a class="headerlink" href="#xapian.MSet.SNIPPET_EXHAUSTIVE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.MSet.back">
<code class="descname">back</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.back" title="Permalink to this definition"></a></dt>
<dd><p>Return iterator pointing to the last object in this MSet.</p>
<p>MSetIterator Xapian::MSet::back() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.convert_to_percent">
<code class="descname">convert_to_percent</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.convert_to_percent" title="Permalink to this definition"></a></dt>
<dd><p>Convert the weight of the current iterator position to a percentage.</p>
<p>int Xapian::MSet::convert_to_percent(const MSetIterator &amp;it) const</p>
<p>The matching document with the highest weight will get 100% if it
matches all the weighted query terms, and proportionally less if it
only matches some, and other weights are scaled by the same factor.</p>
<p>Documents with a non-zero score will always score at least 1%.</p>
<p>Note that these generally aren&#8217;t percentages of anything meaningful
(unless you use a custom weighting formula where they are!)</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.empty">
<code class="descname">empty</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.empty" title="Permalink to this definition"></a></dt>
<dd><p>Return true if this MSet object is empty.</p>
<p>bool Xapian::MSet::empty() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.fetch">
<code class="descname">fetch</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.fetch" title="Permalink to this definition"></a></dt>
<dd><p>Prefetch hint the whole MSet.</p>
<p>void Xapian::MSet::fetch() const</p>
<p>For a remote database, this may start a pipelined fetched of the
requested documents from the remote server.</p>
<p>For a disk-based database, this may send prefetch hints to the
operating system such that the disk blocks the requested documents are
stored in are more likely to be in the cache when we come to actually
read them.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_docid">
<code class="descname">get_docid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_docid" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_document">
<code class="descname">get_document</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_document" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_document_percentage">
<code class="descname">get_document_percentage</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_document_percentage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_firstitem">
<code class="descname">get_firstitem</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_firstitem" title="Permalink to this definition"></a></dt>
<dd><p>Rank of first item in this MSet.</p>
<p>Xapian::doccount Xapian::MSet::get_firstitem() const</p>
<p>This is the parameter first passed to Xapian::Enquire::get_mset().</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_hit">
<code class="descname">get_hit</code><span class="sig-paren">(</span><em>index</em><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_hit" title="Permalink to this definition"></a></dt>
<dd><p>Get an item from the MSet.</p>
<p>The supplied index is relative to the start of the MSet, not the absolute
rank of the item.</p>
<p>Returns an MSetItem.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_matches_estimated">
<code class="descname">get_matches_estimated</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_matches_estimated" title="Permalink to this definition"></a></dt>
<dd><p>Estimate of the total number of matching documents.</p>
<p>Xapian::doccount Xapian::MSet::get_matches_estimated() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_matches_lower_bound">
<code class="descname">get_matches_lower_bound</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_matches_lower_bound" title="Permalink to this definition"></a></dt>
<dd><p>Lower bound on the total number of matching documents.</p>
<p>Xapian::doccount Xapian::MSet::get_matches_lower_bound() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_matches_upper_bound">
<code class="descname">get_matches_upper_bound</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_matches_upper_bound" title="Permalink to this definition"></a></dt>
<dd><p>Upper bound on the total number of matching documents.</p>
<p>Xapian::doccount Xapian::MSet::get_matches_upper_bound() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_max_attained">
<code class="descname">get_max_attained</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_max_attained" title="Permalink to this definition"></a></dt>
<dd><p>The maximum weight attained by any document.</p>
<p>double Xapian::MSet::get_max_attained() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_max_possible">
<code class="descname">get_max_possible</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_max_possible" title="Permalink to this definition"></a></dt>
<dd><p>The maximum possible weight any document could achieve.</p>
<p>double Xapian::MSet::get_max_possible() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_termfreq">
<code class="descname">get_termfreq</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_termfreq" title="Permalink to this definition"></a></dt>
<dd><p>Get the termfreq of a term.</p>
<p>Xapian::doccount Xapian::MSet::get_termfreq(const std::string &amp;term)
const</p>
<p>The number of documents term occurs in.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_termweight">
<code class="descname">get_termweight</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_termweight" title="Permalink to this definition"></a></dt>
<dd><p>Get the term weight of a term.</p>
<p>double Xapian::MSet::get_termweight(const std::string &amp;term) const</p>
<p>The maximum weight that term could have contributed to a document.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_uncollapsed_matches_estimated">
<code class="descname">get_uncollapsed_matches_estimated</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_uncollapsed_matches_estimated" title="Permalink to this definition"></a></dt>
<dd><p>Estimate of the total number of matching documents before collapsing.</p>
<p>Xapian::doccount Xapian::MSet::get_uncollapsed_matches_estimated()
const</p>
<p>Conceptually the same as get_matches_estimated() for the same query
without any collapse part (though the actual value may differ).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_uncollapsed_matches_lower_bound">
<code class="descname">get_uncollapsed_matches_lower_bound</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_uncollapsed_matches_lower_bound" title="Permalink to this definition"></a></dt>
<dd><p>Lower bound on the total number of matching documents before
collapsing.</p>
<p>Xapian::doccount Xapian::MSet::get_uncollapsed_matches_lower_bound()
const</p>
<p>Conceptually the same as get_matches_lower_bound() for the same query
without any collapse part (though the actual value may differ).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.get_uncollapsed_matches_upper_bound">
<code class="descname">get_uncollapsed_matches_upper_bound</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.get_uncollapsed_matches_upper_bound" title="Permalink to this definition"></a></dt>
<dd><p>Upper bound on the total number of matching documents before
collapsing.</p>
<p>Xapian::doccount Xapian::MSet::get_uncollapsed_matches_upper_bound()
const</p>
<p>Conceptually the same as get_matches_upper_bound() for the same query
without any collapse part (though the actual value may differ).</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.MSet.items">
<code class="descname">items</code><a class="headerlink" href="#xapian.MSet.items" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.MSet.size">
<code class="descname">size</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.size" title="Permalink to this definition"></a></dt>
<dd><p>Return number of items in this MSet object.</p>
<p>Xapian::doccount Xapian::MSet::size() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MSet.snippet">
<code class="descname">snippet</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MSet.snippet" title="Permalink to this definition"></a></dt>
<dd><p>Generate a snippet.</p>
<p>std::string Xapian::MSet::snippet(const std::string &amp;text, size_t
length=500, const Xapian::Stem &amp;stemmer=Xapian::Stem(), unsigned
flags=SNIPPET_BACKGROUND_MODEL|SNIPPET_EXHAUSTIVE, const std::string
&amp;hi_start=&#8221;&lt;b&gt;&#8221;, const std::string &amp;hi_end=&#8221;&lt;/b&gt;&#8221;, const
std::string &amp;omit=&#8221;...&#8221;) const</p>
<p>This method selects a continuous run of words of less than about
length bytes from text, based mainly on where the query matches
(currently terms, exact phrases and wildcards are taken into account),
but also on the non- query terms in the text.</p>
<p>The returned text can be escaped (by default, it is escaped to make it
suitable for use in HTML), and matches with the query will be
highlighted using hi_start and hi_end.</p>
<p>If the snippet seems to start or end mid-sentence, then omit is
prepended or append (respectively) to indicate this.</p>
<p>The stemmer used to build the query should be specified in stemmer.</p>
<p>And flags contains flags controlling behaviour.</p>
<p>Added in 1.3.5.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.MSet.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.MSet.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.MSetItem">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">MSetItem</code><span class="sig-paren">(</span><em>iter</em>, <em>mset</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#MSetItem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.MSetItem" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>An item returned from iteration of the MSet.</p>
<p>The item supports access to the following attributes and properties:</p>
<blockquote>
<div><ul class="simple">
<li><cite>docid</cite>: The Xapian document ID corresponding to this MSet item.</li>
<li><cite>weight</cite>: The weight corresponding to this MSet item.</li>
<li><cite>rank</cite>: The rank of this MSet item.  The rank is the position in the
total set of matching documents of this item.  The highest document is
given a rank of 0.  If the MSet did not start at the highest matching
document, because a non-zero &#8216;start&#8217; parameter was supplied to
get_mset(), the first document in the MSet will have a rank greater than
0 (in fact, it will be equal to the value of &#8216;start&#8217; supplied to
get_mset()).</li>
<li><cite>percent</cite>: The percentage score assigned to this MSet item.</li>
<li><cite>document</cite>: The document for this MSet item.  This can be used to access
the document data, or any other information stored in the document (such
as term lists).  It is lazily evaluated.</li>
<li><cite>collapse_key</cite>: The value of the key which was used for collapsing.</li>
<li><cite>collapse_count</cite>: An estimate of the number of documents that have been
collapsed into this one.</li>
</ul>
</div></blockquote>
<p>The collapse count estimate will always be less than or equal to the actual
number of other documents satisfying the match criteria with the same
collapse key as this document.  If may be 0 even though there are other
documents with the same collapse key which satisfying the match criteria.
However if this method returns non-zero, there definitely are other such
documents.  So this method may be used to inform the user that there are
&#8220;at least N other matches in this group&#8221;, or to control whether to offer a
&#8220;show other documents in this group&#8221; feature (but note that it may not
offer it in every case where it would show other documents).</p>
<dl class="attribute">
<dt id="xapian.MSetItem.collapse_count">
<code class="descname">collapse_count</code><a class="headerlink" href="#xapian.MSetItem.collapse_count" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.MSetItem.collapse_key">
<code class="descname">collapse_key</code><a class="headerlink" href="#xapian.MSetItem.collapse_key" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.MSetItem.docid">
<code class="descname">docid</code><a class="headerlink" href="#xapian.MSetItem.docid" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.MSetItem.document">
<code class="descname">document</code><a class="headerlink" href="#xapian.MSetItem.document" title="Permalink to this definition"></a></dt>
<dd><p>The document object corresponding to this MSet item.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.MSetItem.percent">
<code class="descname">percent</code><a class="headerlink" href="#xapian.MSetItem.percent" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.MSetItem.rank">
<code class="descname">rank</code><a class="headerlink" href="#xapian.MSetItem.rank" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.MSetItem.weight">
<code class="descname">weight</code><a class="headerlink" href="#xapian.MSetItem.weight" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.MSetIter">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">MSetIter</code><span class="sig-paren">(</span><em>mset</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#MSetIter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.MSetIter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>An iterator over the items in an MSet.</p>
<p>The iterator will return MSetItem objects, which will be evaluated lazily
where appropriate.</p>
<dl class="method">
<dt id="xapian.MSetIter.next">
<code class="descname">next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#MSetIter.next"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.MSetIter.next" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.MatchDecider">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">MatchDecider</code><a class="reference internal" href="_modules/xapian.html#MatchDecider"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.MatchDecider" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Base class for matcher decision functor.</p>
<dl class="attribute">
<dt id="xapian.MatchDecider.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.MatchDecider.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.MatchSpy">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">MatchSpy</code><a class="reference internal" href="_modules/xapian.html#MatchSpy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.MatchSpy" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Abstract base class for match spies.</p>
<p>The subclasses will generally accumulate information seen during the
match, to calculate aggregate functions, or other profiles of the
matching documents.</p>
<dl class="method">
<dt id="xapian.MatchSpy.merge_results">
<code class="descname">merge_results</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MatchSpy.merge_results" title="Permalink to this definition"></a></dt>
<dd><p>Unserialise some results, and merge them into this matchspy.</p>
<p>virtual void Xapian::MatchSpy::merge_results(const std::string
&amp;serialised)</p>
<p>The order in which results are merged should not be significant, since
this order is not specified (and will vary depending on the speed of
the search in each sub-database).</p>
<p>If you don&#8217;t want to support the remote backend in your match spy, you
can use the default implementation which simply throws
Xapian::UnimplementedError.</p>
<p>serialised:  A string containing the serialised results.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MatchSpy.name">
<code class="descname">name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MatchSpy.name" title="Permalink to this definition"></a></dt>
<dd><p>Return the name of this match spy.</p>
<p>virtual std::string Xapian::MatchSpy::name() const</p>
<p>This name is used by the remote backend. It is passed with the
serialised parameters to the remote server so that it knows which
class to create.</p>
<p>Return the full namespace-qualified name of your class here - if your
class is called MyApp::FooMatchSpy, return &#8220;MyApp::FooMatchSpy&#8221; from
this method.</p>
<p>If you don&#8217;t want to support the remote backend in your match spy, you
can use the default implementation which simply throws
Xapian::UnimplementedError.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.MatchSpy.release">
<code class="descname">release</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MatchSpy.release" title="Permalink to this definition"></a></dt>
<dd><p>Start reference counting this object.</p>
<p>const MatchSpy* Xapian::MatchSpy::release() const</p>
<p>You can hand ownership of a dynamically allocated MatchSpy object to
Xapian by calling release() and then passing the object to a Xapian
method. Xapian will arrange to delete the object once it is no longer
required.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.MatchSpy.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.MatchSpy.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.MultiValueKeyMaker">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">MultiValueKeyMaker</code><a class="reference internal" href="_modules/xapian.html#MultiValueKeyMaker"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.MultiValueKeyMaker" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.KeyMaker" title="xapian.KeyMaker"><code class="xref py py-class docutils literal"><span class="pre">xapian.KeyMaker</span></code></a></p>
<p>KeyMaker subclass which combines several values.</p>
<p>When the result is used for sorting, results are ordered by the first
value. In the event of a tie, the second is used. If this is the same
for both, the third is used, and so on. If reverse is true for a
value, then the sort order for that value is reversed.</p>
<p>When used for collapsing, the documents will only be considered equal
if all the values specified match. If none of the specified values are
set then the generated key will be empty, so such documents won&#8217;t be
collapsed (which is consistent with the behaviour in the &#8220;collapse on
a value&#8221; case). If you&#8217;d prefer that documents with none of the keys
set are collapsed together, then you can set reverse for at least one
of the values. Other than this, it isn&#8217;t useful to set reverse for
collapsing.</p>
<dl class="method">
<dt id="xapian.MultiValueKeyMaker.add_value">
<code class="descname">add_value</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.MultiValueKeyMaker.add_value" title="Permalink to this definition"></a></dt>
<dd><p>Add a value slot to the list to build a key from.</p>
<p>void Xapian::MultiValueKeyMaker::add_value(Xapian::valueno slot, bool
reverse=false, const std::string &amp;defvalue=std::string())</p>
<p>slot:  The value slot to add</p>
<p>reverse:  Adjust values from this slot to reverse their sort order
(default: false)</p>
<p>defvalue:  Value to use for documents which don&#8217;t have a value set in
this slot (default: empty). This can be used to make such documents
sort after all others by passing get_value_upper_bound(slot) + &#8220;x&#8221;
this is guaranteed to be greater than any value in this slot.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.MultiValueKeyMaker.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.MultiValueKeyMaker.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="xapian.NetworkError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">NetworkError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#NetworkError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.NetworkError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.RuntimeError" title="xapian.RuntimeError"><code class="xref py py-class docutils literal"><span class="pre">xapian.RuntimeError</span></code></a></p>
<p>Indicates a problem communicating with a remote database.</p>
</dd></dl>

<dl class="exception">
<dt id="xapian.NetworkTimeoutError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">NetworkTimeoutError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#NetworkTimeoutError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.NetworkTimeoutError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.NetworkError" title="xapian.NetworkError"><code class="xref py py-class docutils literal"><span class="pre">xapian.NetworkError</span></code></a></p>
<p>Indicates a timeout expired while communicating with a remote
database.</p>
</dd></dl>

<dl class="class">
<dt id="xapian.NumberRangeProcessor">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">NumberRangeProcessor</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#NumberRangeProcessor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.NumberRangeProcessor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.RangeProcessor" title="xapian.RangeProcessor"><code class="xref py py-class docutils literal"><span class="pre">xapian.RangeProcessor</span></code></a></p>
<p>Handle a number range.</p>
<p>This class must be used on values which have been encoded using
Xapian::sortable_serialise() which turns numbers into strings which
will sort in the same order as the numbers (the same values can be
used to implement a numeric sort).</p>
<dl class="attribute">
<dt id="xapian.NumberRangeProcessor.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.NumberRangeProcessor.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.NumberValueRangeProcessor">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">NumberValueRangeProcessor</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#NumberValueRangeProcessor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.NumberValueRangeProcessor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.StringValueRangeProcessor" title="xapian.StringValueRangeProcessor"><code class="xref py py-class docutils literal"><span class="pre">xapian.StringValueRangeProcessor</span></code></a></p>
<p>Handle a number range.</p>
<p>This class must be used on values which have been encoded using
Xapian::sortable_serialise() which turns numbers into strings which
will sort in the same order as the numbers (the same values can be
used to implement a numeric sort).</p>
<p>Deprecated Use Xapian::NumberRangeProcessor instead (added in 1.3.6).</p>
<dl class="attribute">
<dt id="xapian.NumberValueRangeProcessor.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.NumberValueRangeProcessor.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.PL2PlusWeight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">PL2PlusWeight</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#PL2PlusWeight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.PL2PlusWeight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>Xapian::Weight subclass implementing the PL2+ probabilistic formula.</p>
<dl class="attribute">
<dt id="xapian.PL2PlusWeight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.PL2PlusWeight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.PL2Weight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">PL2Weight</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#PL2Weight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.PL2Weight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>This class implements the PL2 weighting scheme.</p>
<p>PL2 is a representative scheme of the Divergence from Randomness
Framework by Gianni Amati.</p>
<p>This weighting scheme is useful for tasks that require early
precision.</p>
<p>It uses the Poisson approximation of the Binomial Probabilistic
distribution (P) along with Stirling&#8217;s approximation for the factorial
value, the Laplace method to find the aftereffect of sampling (L) and
the second wdf normalization proposed by Amati to normalize the wdf in
the document to the length of the document (H2).</p>
<p>For more information about the DFR Framework and the PL2 scheme,
please refer to : Gianni Amati and Cornelis Joost Van Rijsbergen
Probabilistic models of information retrieval based on measuring the
divergence from randomness ACM Transactions on Information Systems
(TOIS) 20, (4), 2002, pp. 357-389.</p>
<dl class="attribute">
<dt id="xapian.PL2Weight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.PL2Weight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.PositionIter">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">PositionIter</code><span class="sig-paren">(</span><em>start=0</em>, <em>end=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#PositionIter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.PositionIter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>An iterator over a position list.</p>
<p>The iterator will return integers, in ascending order.</p>
<dl class="method">
<dt id="xapian.PositionIter.next">
<code class="descname">next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#PositionIter.next"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.PositionIter.next" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.PostingItem">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">PostingItem</code><span class="sig-paren">(</span><em>iter</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#PostingItem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.PostingItem" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>An item returned from iteration of a posting list.</p>
<p>The item supports access to the following attributes and properties:</p>
<blockquote>
<div><ul class="simple">
<li><cite>docid</cite>: The document ID corresponding to this PostingItem.</li>
<li><cite>doclength</cite>: The length of the document corresponding to this
PostingItem.</li>
<li><cite>wdf</cite>: The within document frequency of the term which the posting list
is for in the document corresponding to this PostingItem.</li>
<li><cite>positer</cite>: An iterator over the positions which the term corresponing to
this posting list occurs at in the document corresponding to this
PostingItem.  This is only available until the iterator which returned
this item next moves.</li>
</ul>
</div></blockquote>
<dl class="attribute">
<dt id="xapian.PostingItem.docid">
<code class="descname">docid</code><a class="headerlink" href="#xapian.PostingItem.docid" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.PostingItem.doclength">
<code class="descname">doclength</code><a class="headerlink" href="#xapian.PostingItem.doclength" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.PostingItem.positer">
<code class="descname">positer</code><a class="headerlink" href="#xapian.PostingItem.positer" title="Permalink to this definition"></a></dt>
<dd><p>A position iterator for the current posting (if meaningful).</p>
<p>The iterator will return integers representing the positions that the term
occurs at.</p>
<p>This will raise a InvalidOperationError exception if the iterator this item
came from doesn&#8217;t support position lists, or if the iterator has moved on
since the item was returned from it.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.PostingItem.wdf">
<code class="descname">wdf</code><a class="headerlink" href="#xapian.PostingItem.wdf" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.PostingIter">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">PostingIter</code><span class="sig-paren">(</span><em>start</em>, <em>end</em>, <em>has_positions=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#PostingIter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.PostingIter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>An iterator over a posting list.</p>
<p>The iterator will return PostingItem objects, which will be evaluated
lazily where appropriate.</p>
<dl class="method">
<dt id="xapian.PostingIter.next">
<code class="descname">next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#PostingIter.next"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.PostingIter.next" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.PostingIter.skip_to">
<code class="descname">skip_to</code><span class="sig-paren">(</span><em>docid</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#PostingIter.skip_to"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.PostingIter.skip_to" title="Permalink to this definition"></a></dt>
<dd><p>Skip the iterator forward.</p>
<p>The iterator is advanced to the first document with a document ID
which is greater than or equal to the supplied document ID.</p>
<p>If there are no such items, this will raise StopIteration.</p>
<p>This returns the item which the iterator is moved to.  The subsequent
item will be returned the next time that next() is called (unless
skip_to() is called again first).</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.PostingSource">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">PostingSource</code><a class="reference internal" href="_modules/xapian.html#PostingSource"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.PostingSource" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Base class which provides an &#8220;external&#8221; source of postings.</p>
<dl class="method">
<dt id="xapian.PostingSource.at_end">
<code class="descname">at_end</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.PostingSource.at_end" title="Permalink to this definition"></a></dt>
<dd><p>Return true if the current position is past the last entry in this
list.</p>
<p>virtual bool Xapian::PostingSource::at_end() const =0</p>
<p>At least one of  next(),  skip_to() or  check() will be called before
this method is first called.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.PostingSource.check">
<code class="descname">check</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.PostingSource.check" title="Permalink to this definition"></a></dt>
<dd><p>Check if the specified docid occurs.</p>
<p>virtual bool Xapian::PostingSource::check(Xapian::docid did, double
min_wt)</p>
<p>The caller is required to ensure that the specified document id did
actually exists in the database. If it does, it must move to that
document id, and return true. If it does not, it may either:</p>
<p>return true, having moved to a definite position (including
&#8220;at_end&#8221;), which must be the same position as skip_to() would have
moved to.</p>
<p>or</p>
<p>return false, having moved to an &#8220;indeterminate&#8221; position, such that
a subsequent call to next() or skip_to() will move to the next
matching position after did.</p>
<p>Generally, this method should act like skip_to() and return true if
that can be done at little extra cost.</p>
<p>Otherwise it should simply check if a particular docid is present,
returning true if it is, and false if it isn&#8217;t.</p>
<p>The default implementation calls skip_to() and always returns true.</p>
<p>Xapian will always call init() on a PostingSource before calling this
for the first time.</p>
<p>Note: in the case of a multi-database search, the docid specified is
the docid in the single subdatabase relevant to this posting source.
See the  init() method for details.</p>
<p>did:  The document id to check.</p>
<p>min_wt:  The minimum weight contribution that is needed (this is just
a hint which subclasses may ignore).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.PostingSource.get_docid">
<code class="descname">get_docid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.PostingSource.get_docid" title="Permalink to this definition"></a></dt>
<dd><p>Return the current docid.</p>
<p>virtual Xapian::docid Xapian::PostingSource::get_docid() const =0</p>
<p>This method may assume that it will only be called when there is a
&#8220;current document&#8221;. See  get_weight() for details.</p>
<p>Note: in the case of a multi-database search, the returned docid
should be in the single subdatabase relevant to this posting source.
See the  init() method for details.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.PostingSource.get_maxweight">
<code class="descname">get_maxweight</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.PostingSource.get_maxweight" title="Permalink to this definition"></a></dt>
<dd><p>Return the currently set upper bound on what get_weight() can return.</p>
<p>double Xapian::PostingSource::get_maxweight() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.PostingSource.get_termfreq_est">
<code class="descname">get_termfreq_est</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.PostingSource.get_termfreq_est" title="Permalink to this definition"></a></dt>
<dd><p>An estimate of the number of documents this object can return.</p>
<p>virtual Xapian::doccount Xapian::PostingSource::get_termfreq_est()
const =0</p>
<p>It must always be true that:</p>
<p>get_termfreq_min() &lt;= get_termfreq_est() &lt;= get_termfreq_max()</p>
<p>Xapian will always call init() on a PostingSource before calling this
for the first time.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.PostingSource.get_termfreq_max">
<code class="descname">get_termfreq_max</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.PostingSource.get_termfreq_max" title="Permalink to this definition"></a></dt>
<dd><p>An upper bound on the number of documents this object can return.</p>
<p>virtual Xapian::doccount Xapian::PostingSource::get_termfreq_max()
const =0</p>
<p>Xapian will always call init() on a PostingSource before calling this
for the first time.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.PostingSource.get_termfreq_min">
<code class="descname">get_termfreq_min</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.PostingSource.get_termfreq_min" title="Permalink to this definition"></a></dt>
<dd><p>A lower bound on the number of documents this object can return.</p>
<p>virtual Xapian::doccount Xapian::PostingSource::get_termfreq_min()
const =0</p>
<p>Xapian will always call init() on a PostingSource before calling this
for the first time.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.PostingSource.get_weight">
<code class="descname">get_weight</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.PostingSource.get_weight" title="Permalink to this definition"></a></dt>
<dd><p>Return the weight contribution for the current document.</p>
<p>virtual double Xapian::PostingSource::get_weight() const</p>
<p>This default implementation always returns 0, for convenience when
implementing &#8220;weight-less&#8221; PostingSource subclasses.</p>
<p>This method may assume that it will only be called when there is a
&#8220;current document&#8221;. In detail: Xapian will always call init() on a
PostingSource before calling this for the first time. It will also
only call this if the PostingSource reports that it is pointing to a
valid document (ie, it will not call it before calling at least one of
next(), skip_to() or check(), and will ensure that the PostingSource
is not at the end by calling at_end()).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.PostingSource.init">
<code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.PostingSource.init" title="Permalink to this definition"></a></dt>
<dd><p>Set this PostingSource to the start of the list of postings.</p>
<p>virtual void Xapian::PostingSource::init(const Database &amp;db)=0</p>
<p>This is called automatically by the matcher prior to each query being
processed.</p>
<p>If a PostingSource is used for multiple searches,  init() will
therefore be called multiple times, and must handle this by using the
database passed in the most recent call.</p>
<p>db:  The database which the PostingSource should iterate through.</p>
<p>Note: in the case of a multi-database search, a separate PostingSource
will be used for each database (the separate PostingSources will be
obtained using  clone()), and each PostingSource will be passed one of
the sub-databases as the db parameter here. The db parameter will
therefore always refer to a single database. All docids passed to, or
returned from, the PostingSource refer to docids in that single
database, rather than in the multi- database.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.PostingSource.name">
<code class="descname">name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.PostingSource.name" title="Permalink to this definition"></a></dt>
<dd><p>Name of the posting source class.</p>
<p>virtual std::string Xapian::PostingSource::name() const</p>
<p>This is used when serialising and unserialising posting sources; for
example, for performing remote searches.</p>
<p>If the subclass is in a C++ namespace, the namespace should be
included in the name, using &#8221;::&#8221; as a separator. For example, for a
PostingSource subclass called &#8220;FooPostingSource&#8221; in the &#8220;Xapian&#8221;
namespace the result of this call should be
&#8220;Xapian::FooPostingSource&#8221;.</p>
<p>This should only be implemented if serialise() and unserialise() are
also implemented. The default implementation returns an empty string.</p>
<p>If this returns an empty string, Xapian will assume that serialise()
and unserialise() are not implemented.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.PostingSource.next">
<code class="descname">next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.PostingSource.next" title="Permalink to this definition"></a></dt>
<dd><p>Advance the current position to the next matching document.</p>
<p>virtual void Xapian::PostingSource::next(double min_wt)=0</p>
<p>The PostingSource starts before the first entry in the list, so next()
must be called before any methods which need the context of the
current position.</p>
<p>Xapian will always call init() on a PostingSource before calling this
for the first time.</p>
<p>min_wt:  The minimum weight contribution that is needed (this is just
a hint which subclasses may ignore).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.PostingSource.release">
<code class="descname">release</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.PostingSource.release" title="Permalink to this definition"></a></dt>
<dd><p>Start reference counting this object.</p>
<p>const PostingSource* Xapian::PostingSource::release() const</p>
<p>You can hand ownership of a dynamically allocated PostingSource object
to Xapian by calling release() and then passing the object to a Xapian
method. Xapian will arrange to delete the object once it is no longer
required.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.PostingSource.set_maxweight">
<code class="descname">set_maxweight</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.PostingSource.set_maxweight" title="Permalink to this definition"></a></dt>
<dd><p>Specify an upper bound on what get_weight() will return from now on.</p>
<p>void Xapian::PostingSource::set_maxweight(double max_weight)</p>
<p>This upper bound is used by the matcher to perform various
optimisations, so if you can return a good bound, then matches will
generally run faster.</p>
<p>This method should be called after calling init(), and may be called
during iteration if the upper bound drops. It is probably only useful
to call from subclasses (it was actually a &#8220;protected&#8221; method prior
to Xapian 1.3.4, but that makes it tricky to wrap for other
languages).</p>
<p>It is valid for the posting source to have returned a higher value
from get_weight() earlier in the iteration, but the posting source
must not return a higher value from get_weight() than the currently
set upper bound, and the upper bound must not be increased (until
init() has been called).</p>
<p>If you don&#8217;t call this method, the upper bound will default to 0, for
convenience when implementing &#8220;weight-less&#8221; PostingSource
subclasses.</p>
<p>max_weight:  The upper bound to set.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.PostingSource.skip_to">
<code class="descname">skip_to</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.PostingSource.skip_to" title="Permalink to this definition"></a></dt>
<dd><p>Advance to the specified docid.</p>
<p>virtual void Xapian::PostingSource::skip_to(Xapian::docid did, double
min_wt)</p>
<p>If the specified docid isn&#8217;t in the list, position ourselves on the
first document after it (or at_end() if no greater docids are
present).</p>
<p>If the current position is already the specified docid, this method
will leave the position unmodified.</p>
<p>If the specified docid is earlier than the current position, the
behaviour is unspecified. A sensible behaviour would be to leave the
current position unmodified, but it is also reasonable to move to the
specified docid.</p>
<p>The default implementation calls next() repeatedly, which works but
skip_to() can often be implemented much more efficiently.</p>
<p>Xapian will always call init() on a PostingSource before calling this
for the first time.</p>
<p>Note: in the case of a multi-database search, the docid specified is
the docid in the single subdatabase relevant to this posting source.
See the  init() method for details.</p>
<p>did:  The document id to advance to.</p>
<p>min_wt:  The minimum weight contribution that is needed (this is just
a hint which subclasses may ignore).</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.PostingSource.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.PostingSource.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.Query">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">Query</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#Query"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Query" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Class representing a query.</p>
<dl class="attribute">
<dt id="xapian.Query.MatchAll">
<code class="descname">MatchAll</code><em class="property"> = &lt;xapian.Query; proxy of &lt;Swig Object of type 'Xapian::Query *'&gt; &gt;</em><a class="headerlink" href="#xapian.Query.MatchAll" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.MatchNothing">
<code class="descname">MatchNothing</code><em class="property"> = &lt;xapian.Query; proxy of &lt;Swig Object of type 'Xapian::Query *'&gt; &gt;</em><a class="headerlink" href="#xapian.Query.MatchNothing" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_AND">
<code class="descname">OP_AND</code><em class="property"> = 0</em><a class="headerlink" href="#xapian.Query.OP_AND" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_AND_MAYBE">
<code class="descname">OP_AND_MAYBE</code><em class="property"> = 4</em><a class="headerlink" href="#xapian.Query.OP_AND_MAYBE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_AND_NOT">
<code class="descname">OP_AND_NOT</code><em class="property"> = 2</em><a class="headerlink" href="#xapian.Query.OP_AND_NOT" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_ELITE_SET">
<code class="descname">OP_ELITE_SET</code><em class="property"> = 10</em><a class="headerlink" href="#xapian.Query.OP_ELITE_SET" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_FILTER">
<code class="descname">OP_FILTER</code><em class="property"> = 5</em><a class="headerlink" href="#xapian.Query.OP_FILTER" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_INVALID">
<code class="descname">OP_INVALID</code><em class="property"> = 99</em><a class="headerlink" href="#xapian.Query.OP_INVALID" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_MAX">
<code class="descname">OP_MAX</code><em class="property"> = 14</em><a class="headerlink" href="#xapian.Query.OP_MAX" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_NEAR">
<code class="descname">OP_NEAR</code><em class="property"> = 6</em><a class="headerlink" href="#xapian.Query.OP_NEAR" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_OR">
<code class="descname">OP_OR</code><em class="property"> = 1</em><a class="headerlink" href="#xapian.Query.OP_OR" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_PHRASE">
<code class="descname">OP_PHRASE</code><em class="property"> = 7</em><a class="headerlink" href="#xapian.Query.OP_PHRASE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_SCALE_WEIGHT">
<code class="descname">OP_SCALE_WEIGHT</code><em class="property"> = 9</em><a class="headerlink" href="#xapian.Query.OP_SCALE_WEIGHT" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_SYNONYM">
<code class="descname">OP_SYNONYM</code><em class="property"> = 13</em><a class="headerlink" href="#xapian.Query.OP_SYNONYM" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_VALUE_GE">
<code class="descname">OP_VALUE_GE</code><em class="property"> = 11</em><a class="headerlink" href="#xapian.Query.OP_VALUE_GE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_VALUE_LE">
<code class="descname">OP_VALUE_LE</code><em class="property"> = 12</em><a class="headerlink" href="#xapian.Query.OP_VALUE_LE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_VALUE_RANGE">
<code class="descname">OP_VALUE_RANGE</code><em class="property"> = 8</em><a class="headerlink" href="#xapian.Query.OP_VALUE_RANGE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_WILDCARD">
<code class="descname">OP_WILDCARD</code><em class="property"> = 15</em><a class="headerlink" href="#xapian.Query.OP_WILDCARD" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.OP_XOR">
<code class="descname">OP_XOR</code><em class="property"> = 3</em><a class="headerlink" href="#xapian.Query.OP_XOR" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.WILDCARD_LIMIT_ERROR">
<code class="descname">WILDCARD_LIMIT_ERROR</code><em class="property"> = 0</em><a class="headerlink" href="#xapian.Query.WILDCARD_LIMIT_ERROR" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.WILDCARD_LIMIT_FIRST">
<code class="descname">WILDCARD_LIMIT_FIRST</code><em class="property"> = 1</em><a class="headerlink" href="#xapian.Query.WILDCARD_LIMIT_FIRST" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Query.WILDCARD_LIMIT_MOST_FREQUENT">
<code class="descname">WILDCARD_LIMIT_MOST_FREQUENT</code><em class="property"> = 2</em><a class="headerlink" href="#xapian.Query.WILDCARD_LIMIT_MOST_FREQUENT" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.Query.empty">
<code class="descname">empty</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Query.empty" title="Permalink to this definition"></a></dt>
<dd><p>Check if this query is Xapian::Query::MatchNothing.</p>
<p>bool Xapian::Query::empty() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Query.get_length">
<code class="descname">get_length</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Query.get_length" title="Permalink to this definition"></a></dt>
<dd><p>Return the length of this query object.</p>
<p>Xapian::termcount Xapian::Query::get_length() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Query.get_num_subqueries">
<code class="descname">get_num_subqueries</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Query.get_num_subqueries" title="Permalink to this definition"></a></dt>
<dd><p>Get the number of subqueries of the top level query.</p>
<p>size_t Xapian::Query::get_num_subqueries() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Query.get_subquery">
<code class="descname">get_subquery</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Query.get_subquery" title="Permalink to this definition"></a></dt>
<dd><p>Read a top level subquery.</p>
<p>const Query Xapian::Query::get_subquery(size_t n) const</p>
<p>n:  Return the n-th subquery (starting from 0) - only valid when 0 &lt;=
n &lt; get_num_subqueries().</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Query.get_type">
<code class="descname">get_type</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Query.get_type" title="Permalink to this definition"></a></dt>
<dd><p>Get the type of the top level of the query.</p>
<p>op Xapian::Query::get_type() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Query.get_unique_terms_begin">
<code class="descname">get_unique_terms_begin</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Query.get_unique_terms_begin" title="Permalink to this definition"></a></dt>
<dd><p>Begin iterator for unique terms in the query object.</p>
<p>const TermIterator Xapian::Query::get_unique_terms_begin() const</p>
<p>Terms are sorted and terms with the same name removed from the list.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Query.serialise">
<code class="descname">serialise</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Query.serialise" title="Permalink to this definition"></a></dt>
<dd><p>Serialise this object into a string.</p>
<p>std::string Xapian::Query::serialise() const</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.Query.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.Query.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

<dl class="staticmethod">
<dt id="xapian.Query.unserialise">
<em class="property">static </em><code class="descname">unserialise</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Query.unserialise" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.QueryParser">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">QueryParser</code><a class="reference internal" href="_modules/xapian.html#QueryParser"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.QueryParser" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Build a Xapian::Query object from a user query string.</p>
<dl class="attribute">
<dt id="xapian.QueryParser.FLAG_AUTO_MULTIWORD_SYNONYMS">
<code class="descname">FLAG_AUTO_MULTIWORD_SYNONYMS</code><em class="property"> = 1024</em><a class="headerlink" href="#xapian.QueryParser.FLAG_AUTO_MULTIWORD_SYNONYMS" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.FLAG_AUTO_SYNONYMS">
<code class="descname">FLAG_AUTO_SYNONYMS</code><em class="property"> = 512</em><a class="headerlink" href="#xapian.QueryParser.FLAG_AUTO_SYNONYMS" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.FLAG_BOOLEAN">
<code class="descname">FLAG_BOOLEAN</code><em class="property"> = 1</em><a class="headerlink" href="#xapian.QueryParser.FLAG_BOOLEAN" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.FLAG_BOOLEAN_ANY_CASE">
<code class="descname">FLAG_BOOLEAN_ANY_CASE</code><em class="property"> = 8</em><a class="headerlink" href="#xapian.QueryParser.FLAG_BOOLEAN_ANY_CASE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.FLAG_CJK_NGRAM">
<code class="descname">FLAG_CJK_NGRAM</code><em class="property"> = 2048</em><a class="headerlink" href="#xapian.QueryParser.FLAG_CJK_NGRAM" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.FLAG_DEFAULT">
<code class="descname">FLAG_DEFAULT</code><em class="property"> = 7</em><a class="headerlink" href="#xapian.QueryParser.FLAG_DEFAULT" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.FLAG_LOVEHATE">
<code class="descname">FLAG_LOVEHATE</code><em class="property"> = 4</em><a class="headerlink" href="#xapian.QueryParser.FLAG_LOVEHATE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.FLAG_PARTIAL">
<code class="descname">FLAG_PARTIAL</code><em class="property"> = 64</em><a class="headerlink" href="#xapian.QueryParser.FLAG_PARTIAL" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.FLAG_PHRASE">
<code class="descname">FLAG_PHRASE</code><em class="property"> = 2</em><a class="headerlink" href="#xapian.QueryParser.FLAG_PHRASE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.FLAG_PURE_NOT">
<code class="descname">FLAG_PURE_NOT</code><em class="property"> = 32</em><a class="headerlink" href="#xapian.QueryParser.FLAG_PURE_NOT" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.FLAG_SPELLING_CORRECTION">
<code class="descname">FLAG_SPELLING_CORRECTION</code><em class="property"> = 128</em><a class="headerlink" href="#xapian.QueryParser.FLAG_SPELLING_CORRECTION" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.FLAG_SYNONYM">
<code class="descname">FLAG_SYNONYM</code><em class="property"> = 256</em><a class="headerlink" href="#xapian.QueryParser.FLAG_SYNONYM" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.FLAG_WILDCARD">
<code class="descname">FLAG_WILDCARD</code><em class="property"> = 16</em><a class="headerlink" href="#xapian.QueryParser.FLAG_WILDCARD" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.STEM_ALL">
<code class="descname">STEM_ALL</code><em class="property"> = 2</em><a class="headerlink" href="#xapian.QueryParser.STEM_ALL" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.STEM_ALL_Z">
<code class="descname">STEM_ALL_Z</code><em class="property"> = 3</em><a class="headerlink" href="#xapian.QueryParser.STEM_ALL_Z" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.STEM_NONE">
<code class="descname">STEM_NONE</code><em class="property"> = 0</em><a class="headerlink" href="#xapian.QueryParser.STEM_NONE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.STEM_SOME">
<code class="descname">STEM_SOME</code><em class="property"> = 1</em><a class="headerlink" href="#xapian.QueryParser.STEM_SOME" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.add_boolean_prefix">
<code class="descname">add_boolean_prefix</code><span class="sig-paren">(</span><em>s</em>, <em>proc</em>, <em>exclusive=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#QueryParser.add_boolean_prefix"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.QueryParser.add_boolean_prefix" title="Permalink to this definition"></a></dt>
<dd><p>Register a FieldProcessor for a boolean prefix.</p>
<p>void Xapian::QueryParser::add_boolean_prefix(const std::string &amp;field,
Xapian::FieldProcessor <a href="#id22"><span class="problematic" id="id23">*</span></a>proc, bool exclusive)</p>
<p>This is an older version of this method - use the version with the
grouping parameter in preference to this one.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.add_prefix">
<code class="descname">add_prefix</code><span class="sig-paren">(</span><em>s</em>, <em>proc</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#QueryParser.add_prefix"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.QueryParser.add_prefix" title="Permalink to this definition"></a></dt>
<dd><p>Register a FieldProcessor.</p>
<p>void Xapian::QueryParser::add_prefix(const std::string &amp;field,
Xapian::FieldProcessor <a href="#id24"><span class="problematic" id="id25">*</span></a>proc)</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.add_rangeprocessor">
<code class="descname">add_rangeprocessor</code><span class="sig-paren">(</span><em>rproc</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#QueryParser.add_rangeprocessor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.QueryParser.add_rangeprocessor" title="Permalink to this definition"></a></dt>
<dd><p>Register a RangeProcessor.</p>
<p>void Xapian::QueryParser::add_rangeprocessor(Xapian::RangeProcessor
<a href="#id26"><span class="problematic" id="id27">*</span></a>range_proc, const std::string <a href="#id28"><span class="problematic" id="id29">*</span></a>grouping=NULL)</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.add_valuerangeprocessor">
<code class="descname">add_valuerangeprocessor</code><span class="sig-paren">(</span><em>vrproc</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#QueryParser.add_valuerangeprocessor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.QueryParser.add_valuerangeprocessor" title="Permalink to this definition"></a></dt>
<dd><p>Register a ValueRangeProcessor.</p>
<p>void
Xapian::QueryParser::add_valuerangeprocessor(Xapian::ValueRangeProcessor
<a href="#id30"><span class="problematic" id="id31">*</span></a>vrproc)</p>
<p>This method is provided for API compatibility with Xapian 1.2.x and is
deprecated - use  add_rangeprocessor() with a RangeProcessor instead.</p>
<p>Compatibility shim.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.get_corrected_query_string">
<code class="descname">get_corrected_query_string</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.QueryParser.get_corrected_query_string" title="Permalink to this definition"></a></dt>
<dd><p>Get the spelling-corrected query string.</p>
<p>std::string Xapian::QueryParser::get_corrected_query_string() const</p>
<p>This will only be set if FLAG_SPELLING_CORRECTION is specified when
QueryParser::parse_query() was last called.</p>
<p>If there were no corrections, an empty string is returned.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.get_default_op">
<code class="descname">get_default_op</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.QueryParser.get_default_op" title="Permalink to this definition"></a></dt>
<dd><p>Get the current default operator.</p>
<p>Query::op Xapian::QueryParser::get_default_op() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.parse_query">
<code class="descname">parse_query</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.QueryParser.parse_query" title="Permalink to this definition"></a></dt>
<dd><p>Parse a query.</p>
<p>Query Xapian::QueryParser::parse_query(const std::string
&amp;query_string, unsigned flags=FLAG_DEFAULT, const std::string
&amp;default_prefix=std::string())</p>
<p>query_string:  A free-text query as entered by a user</p>
<p>flags:  Zero or more Query::feature_flag specifying what features the
QueryParser should support. Combine multiple values with bitwise-or
(|) (default FLAG_DEFAULT).</p>
<p>default_prefix:  The default term prefix to use (default none). For
example, you can pass &#8220;A&#8221; when parsing an &#8220;Author&#8221; field.</p>
<p>If:  the query string can&#8217;t be parsed, then Xapian::QueryParserError
is thrown. You can get an English error message to report to the user
by catching it and calling get_msg() on the caught exception. The
current possible values (in case you want to translate them) are:</p>
<p>Unknown range operation</p>
<p>parse error</p>
<p>Syntax: &lt;expression&gt; AND &lt;expression&gt;</p>
<p>Syntax: &lt;expression&gt; AND NOT &lt;expression&gt;</p>
<p>Syntax: &lt;expression&gt; NOT &lt;expression&gt;</p>
<p>Syntax: &lt;expression&gt; OR &lt;expression&gt;</p>
<p>Syntax: &lt;expression&gt; XOR &lt;expression&gt;</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.set_database">
<code class="descname">set_database</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.QueryParser.set_database" title="Permalink to this definition"></a></dt>
<dd><p>Specify the database being searched.</p>
<p>void Xapian::QueryParser::set_database(const Database &amp;db)</p>
<p>db:  The database to use for spelling correction
(FLAG_SPELLING_CORRECTION), and synonyms (FLAG_SYNONYM,
FLAG_AUTO_SYNONYMS, and FLAG_AUTO_MULTIWORD_SYNONYMS).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.set_default_op">
<code class="descname">set_default_op</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.QueryParser.set_default_op" title="Permalink to this definition"></a></dt>
<dd><p>Set the default operator.</p>
<p>void Xapian::QueryParser::set_default_op(Query::op default_op)</p>
<p>default_op:  The operator to use to combine non-filter query items
when no explicit operator is used.</p>
<p>So for example, &#8216;weather forecast&#8217; is parsed as if it were &#8216;weather OR
forecast&#8217; by default.</p>
<p>The most useful values for this are OP_OR (the default) and OP_AND.
OP_NEAR, OP_PHRASE, OP_ELITE_SET and OP_SYNONYM are also permitted.
Passing other values will result in InvalidArgumentError being thrown.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.set_max_expansion">
<code class="descname">set_max_expansion</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.QueryParser.set_max_expansion" title="Permalink to this definition"></a></dt>
<dd><p>Specify the maximum expansion of a wildcard and/or partial term.</p>
<p>void Xapian::QueryParser::set_max_expansion(Xapian::termcount
max_expansion, int max_type=Xapian::Query::WILDCARD_LIMIT_ERROR,
unsigned flags=FLAG_WILDCARD|FLAG_PARTIAL)</p>
<p>Note: you must also set FLAG_WILDCARD and/or FLAG_PARTIAL in the flags
parameter to  parse_query() for this setting to have anything to
affect.</p>
<p>If you don&#8217;t call this method, the default settings are no limit on
wildcard expansion, and partial terms expanding to the most frequent
100 terms - i.e. as if you&#8217;d called:</p>
<p>set_max_expansion(0); set_max_expansion(100,
Xapian::Query::WILDCARD_LIMIT_MOST_FREQUENT,
Xapian::QueryParser::FLAG_PARTIAL);</p>
<p>max_expansion:  The maximum number of terms each wildcard in the query
can expand to, or 0 for no limit (which is the default).</p>
<p>max_type:    Xapian::Query::WILDCARD_LIMIT_ERROR,
Xapian::Query::WILDCARD_LIMIT_FIRST or
Xapian::Query::WILDCARD_LIMIT_MOST_FREQUENT (default:
Xapian::Query::WILDCARD_LIMIT_ERROR).</p>
<p>flags:  What to set the limit for (default:
FLAG_WILDCARD|FLAG_PARTIAL, setting the limit for both wildcards and
partial terms).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.set_max_wildcard_expansion">
<code class="descname">set_max_wildcard_expansion</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.QueryParser.set_max_wildcard_expansion" title="Permalink to this definition"></a></dt>
<dd><p>Specify the maximum expansion of a wildcard.</p>
<p>void
Xapian::QueryParser::set_max_wildcard_expansion(Xapian::termcount)</p>
<p>If any wildcard expands to more than max_expansion terms, an exception
will be thrown.</p>
<p>This method is provided for API compatibility with Xapian 1.2.x and is
deprecated - replace it with:</p>
<p>set_max_wildcard_expansion(max_expansion,
Xapian::Query::WILDCARD_LIMIT_ERROR,
Xapian::QueryParser::FLAG_WILDCARD);</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.set_stemmer">
<code class="descname">set_stemmer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.QueryParser.set_stemmer" title="Permalink to this definition"></a></dt>
<dd><p>Set the stemmer.</p>
<p>void Xapian::QueryParser::set_stemmer(const Xapian::Stem &amp;stemmer)</p>
<p>This sets the stemming algorithm which will be used by the query
parser. The stemming algorithm will be used according to the stemming
strategy set by set_stemming_strategy(). As of 1.3.1, this defaults to
STEM_SOME, but in earlier versions the default was STEM_NONE. If you
want to work with older versions, you should explicitly set a stemming
strategy as well as setting a stemmer, otherwise your stemmer won&#8217;t
actually be used.</p>
<p>stemmer:  The Xapian::Stem object to set.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.set_stemming_strategy">
<code class="descname">set_stemming_strategy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.QueryParser.set_stemming_strategy" title="Permalink to this definition"></a></dt>
<dd><p>Set the stemming strategy.</p>
<p>void Xapian::QueryParser::set_stemming_strategy(stem_strategy
strategy)</p>
<p>This controls how the query parser will apply the stemming algorithm.
Note that the stemming algorithm is only applied to words in
probabilistic fields - boolean filter terms are never stemmed.</p>
<p>strategy:  The strategy to use - possible values are: STEM_NONE: Don&#8217;t
perform any stemming. (default in Xapian &lt;= 1.3.0)</p>
<p>STEM_SOME: Stem all terms except for those which start with a capital
letter, or are followed by certain characters (currently: (/&#64;&lt;&gt;=*[{&#8221;
), or are used with operators which need positional information.
Stemmed terms are prefixed with &#8216;Z&#8217;. (default in Xapian &gt;= 1.3.1)</p>
<p>STEM_ALL: Stem all terms (note: no &#8216;Z&#8217; prefix is added).</p>
<p>STEM_ALL_Z: Stem all terms (note: &#8216;Z&#8217; prefix is added). (new in Xapian
1.2.11 and 1.3.1)</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.set_stopper">
<code class="descname">set_stopper</code><span class="sig-paren">(</span><em>stopper</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#QueryParser.set_stopper"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.QueryParser.set_stopper" title="Permalink to this definition"></a></dt>
<dd><p>Set the stopper.</p>
<p>void Xapian::QueryParser::set_stopper(const Stopper <a href="#id32"><span class="problematic" id="id33">*</span></a>stop=NULL)</p>
<p>stop:  The Stopper object to set (default NULL, which means no
stopwords).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.stoplist">
<code class="descname">stoplist</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.QueryParser.stoplist" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator over all the stopped terms from the previous query.</p>
<p>This returns an iterator over all the terms which were omitted from the
previously parsed query due to being considered to be stopwords.  Each
instance of a word omitted from the query is represented in the returned
list, in the order in which the</p>
<p>The iterator will return string objects.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.QueryParser.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.QueryParser.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

<dl class="method">
<dt id="xapian.QueryParser.unstemlist">
<code class="descname">unstemlist</code><span class="sig-paren">(</span><em>tname</em><span class="sig-paren">)</span><a class="headerlink" href="#xapian.QueryParser.unstemlist" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator over all the unstemmed forms of a stemmed term.</p>
<p>This returns an iterator which returns all the unstemmed words which were
stemmed to the stemmed form specified by <cite>tname</cite> when parsing the previous
query.  Each instance of a word which stems to <cite>tname</cite> is returned by the
iterator in the order in which the words appeared in the query - an
individual unstemmed word may thus occur multiple times.</p>
<p>The iterator will return string objects.</p>
</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="xapian.QueryParserError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">QueryParserError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#QueryParserError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.QueryParserError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.RuntimeError" title="xapian.RuntimeError"><code class="xref py py-class docutils literal"><span class="pre">xapian.RuntimeError</span></code></a></p>
<p>Indicates a query string can&#8217;t be parsed.</p>
</dd></dl>

<dl class="class">
<dt id="xapian.RSet">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">RSet</code><a class="reference internal" href="_modules/xapian.html#RSet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.RSet" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>A relevance set (R-Set).</p>
<p>This is the set of documents which are marked as relevant, for use in
modifying the term weights, and in performing query expansion.</p>
<dl class="method">
<dt id="xapian.RSet.add_document">
<code class="descname">add_document</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.RSet.add_document" title="Permalink to this definition"></a></dt>
<dd><p>Add a document to the relevance set.</p>
<p>void Xapian::RSet::add_document(const Xapian::MSetIterator &amp;i)</p>
</dd></dl>

<dl class="method">
<dt id="xapian.RSet.contains">
<code class="descname">contains</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.RSet.contains" title="Permalink to this definition"></a></dt>
<dd><p>Test if a given document in the relevance set.</p>
<p>bool Xapian::RSet::contains(const Xapian::MSetIterator &amp;i) const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.RSet.empty">
<code class="descname">empty</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.RSet.empty" title="Permalink to this definition"></a></dt>
<dd><p>Test if this R-Set is empty.</p>
<p>bool Xapian::RSet::empty() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.RSet.remove_document">
<code class="descname">remove_document</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.RSet.remove_document" title="Permalink to this definition"></a></dt>
<dd><p>Remove a document from the relevance set.</p>
<p>void Xapian::RSet::remove_document(const Xapian::MSetIterator &amp;i)</p>
</dd></dl>

<dl class="method">
<dt id="xapian.RSet.size">
<code class="descname">size</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.RSet.size" title="Permalink to this definition"></a></dt>
<dd><p>The number of documents in this R-Set.</p>
<p>Xapian::doccount Xapian::RSet::size() const</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.RSet.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.RSet.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="xapian.RangeError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">RangeError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#RangeError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.RangeError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.RuntimeError" title="xapian.RuntimeError"><code class="xref py py-class docutils literal"><span class="pre">xapian.RuntimeError</span></code></a></p>
<p>RangeError indicates an attempt to access outside the bounds of a
container.</p>
</dd></dl>

<dl class="class">
<dt id="xapian.RangeProcessor">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">RangeProcessor</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#RangeProcessor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.RangeProcessor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Base class for range processors.</p>
<dl class="method">
<dt id="xapian.RangeProcessor.check_range">
<code class="descname">check_range</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.RangeProcessor.check_range" title="Permalink to this definition"></a></dt>
<dd><p>Check prefix/suffix on range.</p>
<p>Xapian::Query Xapian::RangeProcessor::check_range(const std::string
&amp;b, const std::string &amp;e)</p>
<p>If they match, remove the prefix/suffix and then call operator()() to
try to handle the range.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.RangeProcessor.release">
<code class="descname">release</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.RangeProcessor.release" title="Permalink to this definition"></a></dt>
<dd><p>Start reference counting this object.</p>
<p>const RangeProcessor* Xapian::RangeProcessor::release() const</p>
<p>You can hand ownership of a dynamically allocated RangeProcessor
object to Xapian by calling release() and then passing the object to a
Xapian method. Xapian will arrange to delete the object once it is no
longer required.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.RangeProcessor.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.RangeProcessor.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.Registry">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">Registry</code><a class="reference internal" href="_modules/xapian.html#Registry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Registry" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Registry for user subclasses.</p>
<p>This class provides a way for the remote server to look up user
subclasses when unserialising.</p>
<dl class="method">
<dt id="xapian.Registry.get_lat_long_metric">
<code class="descname">get_lat_long_metric</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Registry.get_lat_long_metric" title="Permalink to this definition"></a></dt>
<dd><p>Get a lat-long metric given a name.</p>
<p>const Xapian::LatLongMetric*
Xapian::Registry::get_lat_long_metric(const std::string &amp;name) const</p>
<p>The returned metric is owned by the registry object.</p>
<p>Returns NULL if the metric could not be found.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Registry.get_match_spy">
<code class="descname">get_match_spy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Registry.get_match_spy" title="Permalink to this definition"></a></dt>
<dd><p>Get a match spy given a name.</p>
<p>const Xapian::MatchSpy* Xapian::Registry::get_match_spy(const
std::string &amp;name) const</p>
<p>name:  The name of the match spy to find.</p>
<p>An object with the requested name, or NULL if the match spy could not
be found. The returned object is owned by the registry and so must not
be deleted by the caller.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Registry.get_posting_source">
<code class="descname">get_posting_source</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Registry.get_posting_source" title="Permalink to this definition"></a></dt>
<dd><p>Get a posting source given a name.</p>
<p>const Xapian::PostingSource*
Xapian::Registry::get_posting_source(const std::string &amp;name) const</p>
<p>name:  The name of the posting source to find.</p>
<p>An object with the requested name, or NULL if the posting source could
not be found. The returned object is owned by the registry and so must
not be deleted by the caller.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Registry.get_weighting_scheme">
<code class="descname">get_weighting_scheme</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Registry.get_weighting_scheme" title="Permalink to this definition"></a></dt>
<dd><p>Get the weighting scheme given a name.</p>
<p>const Xapian::Weight* Xapian::Registry::get_weighting_scheme(const
std::string &amp;name) const</p>
<p>name:  The name of the weighting scheme to find.</p>
<p>An object with the requested name, or NULL if the weighting scheme
could not be found. The returned object is owned by the registry and
so must not be deleted by the caller.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Registry.register_lat_long_metric">
<code class="descname">register_lat_long_metric</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Registry.register_lat_long_metric" title="Permalink to this definition"></a></dt>
<dd><p>Register a user-defined lat-long metric class.</p>
<p>void Xapian::Registry::register_lat_long_metric(const
Xapian::LatLongMetric &amp;metric)</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Registry.register_match_spy">
<code class="descname">register_match_spy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Registry.register_match_spy" title="Permalink to this definition"></a></dt>
<dd><p>Register a user-defined match spy class.</p>
<p>void Xapian::Registry::register_match_spy(const Xapian::MatchSpy &amp;spy)</p>
<p>spy:  The match spy to register.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Registry.register_posting_source">
<code class="descname">register_posting_source</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Registry.register_posting_source" title="Permalink to this definition"></a></dt>
<dd><p>Register a user-defined posting source class.</p>
<p>void Xapian::Registry::register_posting_source(const
Xapian::PostingSource &amp;source)</p>
<p>source:  The posting source to register.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Registry.register_weighting_scheme">
<code class="descname">register_weighting_scheme</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Registry.register_weighting_scheme" title="Permalink to this definition"></a></dt>
<dd><p>Register a weighting scheme.</p>
<p>void Xapian::Registry::register_weighting_scheme(const Xapian::Weight
&amp;wt)</p>
<p>wt:  The weighting scheme to register.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.Registry.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.Registry.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="xapian.RuntimeError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">RuntimeError</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#RuntimeError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.RuntimeError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Error" title="xapian.Error"><code class="xref py py-class docutils literal"><span class="pre">xapian.Error</span></code></a></p>
<p>The base class for exceptions indicating errors only detectable at
runtime.</p>
<p>A subclass of RuntimeError will be thrown if Xapian detects an error
which is exception derived from RuntimeError is thrown when an error
is caused by problems with the data or environment rather than a
programming mistake.</p>
</dd></dl>

<dl class="exception">
<dt id="xapian.SerialisationError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">SerialisationError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#SerialisationError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.SerialisationError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.RuntimeError" title="xapian.RuntimeError"><code class="xref py py-class docutils literal"><span class="pre">xapian.RuntimeError</span></code></a></p>
<p>Indicates an error in the std::string serialisation of an object.</p>
</dd></dl>

<dl class="class">
<dt id="xapian.SimpleStopper">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">SimpleStopper</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#SimpleStopper"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.SimpleStopper" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Stopper" title="xapian.Stopper"><code class="xref py py-class docutils literal"><span class="pre">xapian.Stopper</span></code></a></p>
<p>Simple implementation of Stopper class - this will suit most users.</p>
<dl class="method">
<dt id="xapian.SimpleStopper.add">
<code class="descname">add</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.SimpleStopper.add" title="Permalink to this definition"></a></dt>
<dd><p>Add a single stop word.</p>
<p>void Xapian::SimpleStopper::add(const std::string &amp;word)</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.SimpleStopper.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.SimpleStopper.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.Stem">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">Stem</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#Stem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Stem" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Class representing a stemming algorithm.</p>
<dl class="staticmethod">
<dt id="xapian.Stem.get_available_languages">
<em class="property">static </em><code class="descname">get_available_languages</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Stem.get_available_languages" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Stem.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.Stem.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.StemImplementation">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">StemImplementation</code><a class="reference internal" href="_modules/xapian.html#StemImplementation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.StemImplementation" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Class representing a stemming algorithm implementation.</p>
<dl class="attribute">
<dt id="xapian.StemImplementation.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.StemImplementation.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.Stopper">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">Stopper</code><a class="reference internal" href="_modules/xapian.html#Stopper"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Stopper" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Base class for stop-word decision functor.</p>
<dl class="method">
<dt id="xapian.Stopper.release">
<code class="descname">release</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Stopper.release" title="Permalink to this definition"></a></dt>
<dd><p>Start reference counting this object.</p>
<p>const Stopper* Xapian::Stopper::release() const</p>
<p>You can hand ownership of a dynamically allocated Stopper object to
Xapian by calling release() and then passing the object to a Xapian
method. Xapian will arrange to delete the object once it is no longer
required.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.Stopper.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.Stopper.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.StringValueRangeProcessor">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">StringValueRangeProcessor</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#StringValueRangeProcessor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.StringValueRangeProcessor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.ValueRangeProcessor" title="xapian.ValueRangeProcessor"><code class="xref py py-class docutils literal"><span class="pre">xapian.ValueRangeProcessor</span></code></a></p>
<p>Handle a string range.</p>
<p>The end points can be any strings.</p>
<p>Deprecated Use Xapian::RangeProcessor instead (added in 1.3.6).</p>
<dl class="attribute">
<dt id="xapian.StringValueRangeProcessor.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.StringValueRangeProcessor.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.TermGenerator">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">TermGenerator</code><a class="reference internal" href="_modules/xapian.html#TermGenerator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.TermGenerator" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Parses a piece of text and generate terms.</p>
<p>This module takes a piece of text and parses it to produce words which
are then used to generate suitable terms for indexing. The terms
generated are suitable for use with Query objects produced by the
QueryParser class.</p>
<dl class="attribute">
<dt id="xapian.TermGenerator.FLAG_CJK_NGRAM">
<code class="descname">FLAG_CJK_NGRAM</code><em class="property"> = 2048</em><a class="headerlink" href="#xapian.TermGenerator.FLAG_CJK_NGRAM" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.TermGenerator.FLAG_SPELLING">
<code class="descname">FLAG_SPELLING</code><em class="property"> = 128</em><a class="headerlink" href="#xapian.TermGenerator.FLAG_SPELLING" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.TermGenerator.STEM_ALL">
<code class="descname">STEM_ALL</code><em class="property"> = 2</em><a class="headerlink" href="#xapian.TermGenerator.STEM_ALL" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.TermGenerator.STEM_ALL_Z">
<code class="descname">STEM_ALL_Z</code><em class="property"> = 3</em><a class="headerlink" href="#xapian.TermGenerator.STEM_ALL_Z" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.TermGenerator.STEM_NONE">
<code class="descname">STEM_NONE</code><em class="property"> = 0</em><a class="headerlink" href="#xapian.TermGenerator.STEM_NONE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.TermGenerator.STEM_SOME">
<code class="descname">STEM_SOME</code><em class="property"> = 1</em><a class="headerlink" href="#xapian.TermGenerator.STEM_SOME" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.TermGenerator.STOP_ALL">
<code class="descname">STOP_ALL</code><em class="property"> = 1</em><a class="headerlink" href="#xapian.TermGenerator.STOP_ALL" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.TermGenerator.STOP_NONE">
<code class="descname">STOP_NONE</code><em class="property"> = 0</em><a class="headerlink" href="#xapian.TermGenerator.STOP_NONE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.TermGenerator.STOP_STEMMED">
<code class="descname">STOP_STEMMED</code><em class="property"> = 2</em><a class="headerlink" href="#xapian.TermGenerator.STOP_STEMMED" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.TermGenerator.get_document">
<code class="descname">get_document</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.TermGenerator.get_document" title="Permalink to this definition"></a></dt>
<dd><p>Get the current document.</p>
<p>const Xapian::Document&amp; Xapian::TermGenerator::get_document() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.TermGenerator.get_termpos">
<code class="descname">get_termpos</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.TermGenerator.get_termpos" title="Permalink to this definition"></a></dt>
<dd><p>Get the current term position.</p>
<p>Xapian::termcount Xapian::TermGenerator::get_termpos() const</p>
</dd></dl>

<dl class="method">
<dt id="xapian.TermGenerator.increase_termpos">
<code class="descname">increase_termpos</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.TermGenerator.increase_termpos" title="Permalink to this definition"></a></dt>
<dd><p>Increase the term position used by index_text.</p>
<p>void Xapian::TermGenerator::increase_termpos(Xapian::termcount
delta=100)</p>
<p>This can be used between indexing text from different fields or other
places to prevent phrase searches from spanning between them (e.g.
between the title and body text, or between two chapters in a book).</p>
<p>delta:  Amount to increase the term position by (default: 100).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.TermGenerator.index_text">
<code class="descname">index_text</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.TermGenerator.index_text" title="Permalink to this definition"></a></dt>
<dd><p>Index some text in a std::string.</p>
<p>void Xapian::TermGenerator::index_text(const std::string &amp;text,
Xapian::termcount wdf_inc=1, const std::string &amp;prefix=std::string())</p>
<p>text:  The text to index.</p>
<p>wdf_inc:  The wdf increment (default 1).</p>
<p>prefix:  The term prefix to use (default is no prefix).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.TermGenerator.index_text_without_positions">
<code class="descname">index_text_without_positions</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.TermGenerator.index_text_without_positions" title="Permalink to this definition"></a></dt>
<dd><p>Index some text in a std::string without positional information.</p>
<p>void Xapian::TermGenerator::index_text_without_positions(const
std::string &amp;text, Xapian::termcount wdf_inc=1, const std::string
&amp;prefix=std::string())</p>
<p>Just like index_text, but no positional information is generated. This
means that the database will be significantly smaller, but that phrase
searching and NEAR won&#8217;t be supported.</p>
<p>text:  The text to index.</p>
<p>wdf_inc:  The wdf increment (default 1).</p>
<p>prefix:  The term prefix to use (default is no prefix).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.TermGenerator.set_database">
<code class="descname">set_database</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.TermGenerator.set_database" title="Permalink to this definition"></a></dt>
<dd><p>Set the database to index spelling data to.</p>
<p>void Xapian::TermGenerator::set_database(const
Xapian::WritableDatabase &amp;db)</p>
</dd></dl>

<dl class="method">
<dt id="xapian.TermGenerator.set_document">
<code class="descname">set_document</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.TermGenerator.set_document" title="Permalink to this definition"></a></dt>
<dd><p>Set the current document.</p>
<p>void Xapian::TermGenerator::set_document(const Xapian::Document &amp;doc)</p>
</dd></dl>

<dl class="method">
<dt id="xapian.TermGenerator.set_flags">
<code class="descname">set_flags</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.TermGenerator.set_flags" title="Permalink to this definition"></a></dt>
<dd><p>Set flags.</p>
<p>flags Xapian::TermGenerator::set_flags(flags toggle, flags
mask=flags(0))</p>
<p>The new value of flags is: (flags &amp; mask) ^ toggle</p>
<p>To just set the flags, pass the new flags in toggle and the default
value for mask.</p>
<p>toggle:  Flags to XOR.</p>
<p>mask:  Flags to AND with first.</p>
<p>The old flags setting.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.TermGenerator.set_max_word_length">
<code class="descname">set_max_word_length</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.TermGenerator.set_max_word_length" title="Permalink to this definition"></a></dt>
<dd><p>Set the maximum length word to index.</p>
<p>void Xapian::TermGenerator::set_max_word_length(unsigned
max_word_length)</p>
<p>The limit is on the length of a word prior to stemming and prior to
adding any term prefix.</p>
<p>The backends mostly impose a limit on the length of terms (often of
about 240 bytes), but it&#8217;s generally useful to have a lower limit to
help prevent the index being bloated by useless junk terms from trying
to indexing things like binary data, uuencoded data, ASCII art, etc.</p>
<p>This method was new in Xapian 1.3.1.</p>
<p>max_word_length:  The maximum length word to index, in bytes in UTF-8
representation. Default is 64.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.TermGenerator.set_stemmer">
<code class="descname">set_stemmer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.TermGenerator.set_stemmer" title="Permalink to this definition"></a></dt>
<dd><p>Set the Xapian::Stem object to be used for generating stemmed terms.</p>
<p>void Xapian::TermGenerator::set_stemmer(const Xapian::Stem &amp;stemmer)</p>
</dd></dl>

<dl class="method">
<dt id="xapian.TermGenerator.set_stemming_strategy">
<code class="descname">set_stemming_strategy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.TermGenerator.set_stemming_strategy" title="Permalink to this definition"></a></dt>
<dd><p>Set the stemming strategy.</p>
<p>void Xapian::TermGenerator::set_stemming_strategy(stem_strategy
strategy)</p>
<p>This method controls how the stemming algorithm is applied. It was new
in Xapian 1.3.1.</p>
<p>strategy:  The strategy to use - possible values are: STEM_NONE: Don&#8217;t
perform any stemming - only unstemmed terms are generated.</p>
<p>STEM_SOME: Generate both stemmed (with a &#8220;Z&#8221; prefix) and unstemmed
terms. This is the default strategy.</p>
<p>STEM_ALL: Generate only stemmed terms (but without a &#8220;Z&#8221; prefix).</p>
<p>STEM_ALL_Z: Generate only stemmed terms (with a &#8220;Z&#8221; prefix).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.TermGenerator.set_stopper">
<code class="descname">set_stopper</code><span class="sig-paren">(</span><em>stopper</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#TermGenerator.set_stopper"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.TermGenerator.set_stopper" title="Permalink to this definition"></a></dt>
<dd><p>Set the Xapian::Stopper object to be used for identifying stopwords.</p>
<p>void Xapian::TermGenerator::set_stopper(const Xapian::Stopper
<a href="#id34"><span class="problematic" id="id35">*</span></a>stop=NULL)</p>
<p>Stemmed forms of stopwords aren&#8217;t indexed, but unstemmed forms still
are so that searches for phrases including stop words still work.</p>
<p>stop:  The Stopper object to set (default NULL, which means no
stopwords).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.TermGenerator.set_stopper_strategy">
<code class="descname">set_stopper_strategy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.TermGenerator.set_stopper_strategy" title="Permalink to this definition"></a></dt>
<dd><p>Set the stopper strategy.</p>
<p>void Xapian::TermGenerator::set_stopper_strategy(stop_strategy
strategy)</p>
<p>strategy:  The strategy to use - possible values are: STOP_NONE:
Disable stopper for both the stemmed and unstemmed form of the word
(Don&#8217;t use the stopper).</p>
<p>STOP_ALL: Enable stopper for both forms of the word.</p>
<p>STOP_STEMMED: Enable stopper for the stemmed form of the word.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.TermGenerator.set_termpos">
<code class="descname">set_termpos</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.TermGenerator.set_termpos" title="Permalink to this definition"></a></dt>
<dd><p>Set the current term position.</p>
<p>void Xapian::TermGenerator::set_termpos(Xapian::termcount termpos)</p>
<p>termpos:  The new term position to set.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.TermGenerator.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.TermGenerator.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.TermIter">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">TermIter</code><span class="sig-paren">(</span><em>start</em>, <em>end</em>, <em>has_termfreq=0</em>, <em>has_wdf=0</em>, <em>has_positions=0</em>, <em>return_strings=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#TermIter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.TermIter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>An iterator over a term list.</p>
<p>The iterator will return TermListItem objects, which will be evaluated
lazily where appropriate.</p>
<dl class="attribute">
<dt id="xapian.TermIter.EAGER">
<code class="descname">EAGER</code><em class="property"> = 2</em><a class="headerlink" href="#xapian.TermIter.EAGER" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.TermIter.INVALID">
<code class="descname">INVALID</code><em class="property"> = 0</em><a class="headerlink" href="#xapian.TermIter.INVALID" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.TermIter.LAZY">
<code class="descname">LAZY</code><em class="property"> = 1</em><a class="headerlink" href="#xapian.TermIter.LAZY" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.TermIter.next">
<code class="descname">next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#TermIter.next"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.TermIter.next" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.TermIter.skip_to">
<code class="descname">skip_to</code><span class="sig-paren">(</span><em>term</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#TermIter.skip_to"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.TermIter.skip_to" title="Permalink to this definition"></a></dt>
<dd><p>Skip the iterator forward.</p>
<p>The iterator is advanced to the first term at or after the current
position which is greater than or equal to the supplied term.</p>
<p>If there are no such items, this will raise StopIteration.</p>
<p>This returns the item which the iterator is moved to.  The subsequent
item will be returned the next time that next() is called (unless
skip_to() is called again first).</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.TermListItem">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">TermListItem</code><span class="sig-paren">(</span><em>iter</em>, <em>term</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#TermListItem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.TermListItem" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>An item returned from iteration of a term list.</p>
<p>The item supports access to the following attributes and properties:</p>
<blockquote>
<div><ul class="simple">
<li><cite>term</cite>: The term corresponding to this TermListItem.</li>
<li><cite>wdf</cite>: The within document frequency of this term.</li>
<li><cite>termfreq</cite>: The number of documents in the collection which are indexed
by the term</li>
<li><cite>positer</cite>: An iterator over the positions which the term appears at in
the document.  This is only available until the iterator which returned
this item next moves.</li>
</ul>
</div></blockquote>
<dl class="attribute">
<dt id="xapian.TermListItem.positer">
<code class="descname">positer</code><a class="headerlink" href="#xapian.TermListItem.positer" title="Permalink to this definition"></a></dt>
<dd><p>A position iterator for the current term (if meaningful).</p>
<p>The iterator will return integers representing the positions that the term
occurs at.</p>
<p>This will raise a InvalidOperationError exception if the iterator this item
came from doesn&#8217;t support position lists, or if the iterator has moved on
since the item was returned from it.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.TermListItem.term">
<code class="descname">term</code><a class="headerlink" href="#xapian.TermListItem.term" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.TermListItem.termfreq">
<code class="descname">termfreq</code><a class="headerlink" href="#xapian.TermListItem.termfreq" title="Permalink to this definition"></a></dt>
<dd><p>The term frequency of the current term (if meaningful).</p>
<p>This is the number of documents in the collection which are indexed by the
term.</p>
<p>This will raise a InvalidOperationError exception if the iterator
this item came from doesn&#8217;t support term frequencies.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.TermListItem.wdf">
<code class="descname">wdf</code><a class="headerlink" href="#xapian.TermListItem.wdf" title="Permalink to this definition"></a></dt>
<dd><p>The within-document-frequency of the current term (if meaningful).</p>
<p>This will raise a InvalidOperationError exception if the iterator
this item came from doesn&#8217;t support within-document-frequencies.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.TfIdfWeight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">TfIdfWeight</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#TfIdfWeight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.TfIdfWeight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>Xapian::Weight subclass implementing the tf-idf weighting scheme.</p>
<dl class="attribute">
<dt id="xapian.TfIdfWeight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.TfIdfWeight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.TradWeight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">TradWeight</code><span class="sig-paren">(</span><em>k=1.0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#TradWeight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.TradWeight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Weight" title="xapian.Weight"><code class="xref py py-class docutils literal"><span class="pre">xapian.Weight</span></code></a></p>
<p>Xapian::Weight subclass implementing the traditional probabilistic
formula.</p>
<p>This class implements the &#8220;traditional&#8221; Probabilistic Weighting
scheme, as described by the early papers on Probabilistic Retrieval.
BM25 generally gives better results.</p>
<p>TradWeight(k) is equivalent to BM25Weight(k, 0, 0, 1, 0), except that
the latter returns weights (k+1) times larger.</p>
<dl class="attribute">
<dt id="xapian.TradWeight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.TradWeight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="xapian.UnimplementedError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">UnimplementedError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#UnimplementedError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.UnimplementedError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.LogicError" title="xapian.LogicError"><code class="xref py py-class docutils literal"><span class="pre">xapian.LogicError</span></code></a></p>
<p>UnimplementedError indicates an attempt to use an unimplemented
feature.</p>
</dd></dl>

<dl class="class">
<dt id="xapian.ValueCountMatchSpy">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ValueCountMatchSpy</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ValueCountMatchSpy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ValueCountMatchSpy" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.MatchSpy" title="xapian.MatchSpy"><code class="xref py py-class docutils literal"><span class="pre">xapian.MatchSpy</span></code></a></p>
<p>Class for counting the frequencies of values in the matching
documents.</p>
<dl class="method">
<dt id="xapian.ValueCountMatchSpy.get_total">
<code class="descname">get_total</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValueCountMatchSpy.get_total" title="Permalink to this definition"></a></dt>
<dd><p>Return the total number of documents tallied.</p>
<p>size_t Xapian::ValueCountMatchSpy::get_total() const</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.ValueCountMatchSpy.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.ValueCountMatchSpy.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValueCountMatchSpy.top_values">
<code class="descname">top_values</code><span class="sig-paren">(</span><em>maxvalues</em><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValueCountMatchSpy.top_values" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator over the most frequent values for the slot.</p>
<p>Values will be returned in descending order of frequency.  Values with
the same frequency will be returned in ascending alphabetical order.</p>
<p>The iterator will return TermListItem objects: the value can be
accessed as the <cite>term</cite> property, and the frequency can be accessed as
the <cite>termfreq</cite> property.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValueCountMatchSpy.values">
<code class="descname">values</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValueCountMatchSpy.values" title="Permalink to this definition"></a></dt>
<dd><p>Get an iterator over all the values in the slot.</p>
<p>Values will be returned in ascending alphabetical order.</p>
<p>The iterator will return TermListItem objects: the value can be
accessed as the <cite>term</cite> property, and the frequency can be accessed as
the <cite>termfreq</cite> property.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ValueItem">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ValueItem</code><span class="sig-paren">(</span><em>num</em>, <em>value</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ValueItem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ValueItem" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>An item returned from iteration of the values in a document.</p>
<p>The item supports access to the following attributes:</p>
<blockquote>
<div><ul class="simple">
<li><cite>num</cite>: The number of the value.</li>
<li><cite>value</cite>: The contents of the value.</li>
</ul>
</div></blockquote>
<dl class="attribute">
<dt id="xapian.ValueItem.num">
<code class="descname">num</code><a class="headerlink" href="#xapian.ValueItem.num" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.ValueItem.value">
<code class="descname">value</code><a class="headerlink" href="#xapian.ValueItem.value" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ValueIter">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ValueIter</code><span class="sig-paren">(</span><em>start</em>, <em>end</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ValueIter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ValueIter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>An iterator over all the values stored in a document.</p>
<p>The iterator will return ValueItem objects, in ascending order of value number.</p>
<dl class="method">
<dt id="xapian.ValueIter.next">
<code class="descname">next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ValueIter.next"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ValueIter.next" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ValueMapPostingSource">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ValueMapPostingSource</code><span class="sig-paren">(</span><em>slot_</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ValueMapPostingSource"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ValueMapPostingSource" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.ValuePostingSource" title="xapian.ValuePostingSource"><code class="xref py py-class docutils literal"><span class="pre">xapian.ValuePostingSource</span></code></a></p>
<p>A posting source which looks up weights in a map using values as the
key.</p>
<p>This allows will return entries for all documents in the given
database which have a value in the slot specified. The values will be
mapped to the corresponding weight in the weight map. If there is no
mapping for a particular value, the default weight will be returned
(which itself defaults to 0.0).</p>
<dl class="method">
<dt id="xapian.ValueMapPostingSource.add_mapping">
<code class="descname">add_mapping</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValueMapPostingSource.add_mapping" title="Permalink to this definition"></a></dt>
<dd><p>Add a mapping.</p>
<p>void Xapian::ValueMapPostingSource::add_mapping(const std::string
&amp;key, double wt)</p>
<p>key:  The key looked up from the value slot.</p>
<p>wt:  The weight to give this key.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValueMapPostingSource.clear_mappings">
<code class="descname">clear_mappings</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValueMapPostingSource.clear_mappings" title="Permalink to this definition"></a></dt>
<dd><p>Clear all mappings.</p>
<p>void Xapian::ValueMapPostingSource::clear_mappings()</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValueMapPostingSource.set_default_weight">
<code class="descname">set_default_weight</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValueMapPostingSource.set_default_weight" title="Permalink to this definition"></a></dt>
<dd><p>Set a default weight for document values not in the map.</p>
<p>void Xapian::ValueMapPostingSource::set_default_weight(double wt)</p>
<p>wt:  The weight to set as the default.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.ValueMapPostingSource.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.ValueMapPostingSource.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ValuePostingSource">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ValuePostingSource</code><span class="sig-paren">(</span><em>slot_</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ValuePostingSource"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ValuePostingSource" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.PostingSource" title="xapian.PostingSource"><code class="xref py py-class docutils literal"><span class="pre">xapian.PostingSource</span></code></a></p>
<p>A posting source which generates weights from a value slot.</p>
<p>This is a base class for classes which generate weights using values
stored in the specified slot. For example, ValueWeightPostingSource
uses sortable_unserialise to convert values directly to weights.</p>
<p>The upper bound on the weight returned is set to DBL_MAX. Subclasses
should call set_maxweight() in their init() methods after calling
ValuePostingSource::init() if they know a tighter bound on the weight.</p>
<dl class="method">
<dt id="xapian.ValuePostingSource.at_end">
<code class="descname">at_end</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.at_end" title="Permalink to this definition"></a></dt>
<dd><p>Return true if the current position is past the last entry in this
list.</p>
<p>bool Xapian::ValuePostingSource::at_end() const</p>
<p>At least one of  next(),  skip_to() or  check() will be called before
this method is first called.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.check">
<code class="descname">check</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.check" title="Permalink to this definition"></a></dt>
<dd><p>Check if the specified docid occurs.</p>
<p>bool Xapian::ValuePostingSource::check(Xapian::docid min_docid, double
min_wt)</p>
<p>The caller is required to ensure that the specified document id did
actually exists in the database. If it does, it must move to that
document id, and return true. If it does not, it may either:</p>
<p>return true, having moved to a definite position (including
&#8220;at_end&#8221;), which must be the same position as skip_to() would have
moved to.</p>
<p>or</p>
<p>return false, having moved to an &#8220;indeterminate&#8221; position, such that
a subsequent call to next() or skip_to() will move to the next
matching position after did.</p>
<p>Generally, this method should act like skip_to() and return true if
that can be done at little extra cost.</p>
<p>Otherwise it should simply check if a particular docid is present,
returning true if it is, and false if it isn&#8217;t.</p>
<p>The default implementation calls skip_to() and always returns true.</p>
<p>Xapian will always call init() on a PostingSource before calling this
for the first time.</p>
<p>Note: in the case of a multi-database search, the docid specified is
the docid in the single subdatabase relevant to this posting source.
See the  init() method for details.</p>
<p>did:  The document id to check.</p>
<p>min_wt:  The minimum weight contribution that is needed (this is just
a hint which subclasses may ignore).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.done">
<code class="descname">done</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.done" title="Permalink to this definition"></a></dt>
<dd><p>End the iteration.</p>
<p>void Xapian::ValuePostingSource::done()</p>
<p>Calls to at_end() will return true after calling this method.</p>
<p>Added in 1.2.23 and 1.3.5.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.get_database">
<code class="descname">get_database</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.get_database" title="Permalink to this definition"></a></dt>
<dd><p>The database we&#8217;re reading values from.</p>
<p>Xapian::Database Xapian::ValuePostingSource::get_database() const</p>
<p>Added in 1.2.23 and 1.3.5.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.get_docid">
<code class="descname">get_docid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.get_docid" title="Permalink to this definition"></a></dt>
<dd><p>Return the current docid.</p>
<p>Xapian::docid Xapian::ValuePostingSource::get_docid() const</p>
<p>This method may assume that it will only be called when there is a
&#8220;current document&#8221;. See  get_weight() for details.</p>
<p>Note: in the case of a multi-database search, the returned docid
should be in the single subdatabase relevant to this posting source.
See the  init() method for details.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.get_slot">
<code class="descname">get_slot</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.get_slot" title="Permalink to this definition"></a></dt>
<dd><p>The slot we&#8217;re reading values from.</p>
<p>Xapian::valueno Xapian::ValuePostingSource::get_slot() const</p>
<p>Added in 1.2.23 and 1.3.5.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.get_started">
<code class="descname">get_started</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.get_started" title="Permalink to this definition"></a></dt>
<dd><p>Flag indicating if we&#8217;ve started (true if we have).</p>
<p>bool Xapian::ValuePostingSource::get_started() const</p>
<p>Added in 1.2.23 and 1.3.5.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.get_termfreq_est">
<code class="descname">get_termfreq_est</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.get_termfreq_est" title="Permalink to this definition"></a></dt>
<dd><p>An estimate of the number of documents this object can return.</p>
<p>Xapian::doccount Xapian::ValuePostingSource::get_termfreq_est() const</p>
<p>It must always be true that:</p>
<p>get_termfreq_min() &lt;= get_termfreq_est() &lt;= get_termfreq_max()</p>
<p>Xapian will always call init() on a PostingSource before calling this
for the first time.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.get_termfreq_max">
<code class="descname">get_termfreq_max</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.get_termfreq_max" title="Permalink to this definition"></a></dt>
<dd><p>An upper bound on the number of documents this object can return.</p>
<p>Xapian::doccount Xapian::ValuePostingSource::get_termfreq_max() const</p>
<p>Xapian will always call init() on a PostingSource before calling this
for the first time.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.get_termfreq_min">
<code class="descname">get_termfreq_min</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.get_termfreq_min" title="Permalink to this definition"></a></dt>
<dd><p>A lower bound on the number of documents this object can return.</p>
<p>Xapian::doccount Xapian::ValuePostingSource::get_termfreq_min() const</p>
<p>Xapian will always call init() on a PostingSource before calling this
for the first time.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.get_value">
<code class="descname">get_value</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.get_value" title="Permalink to this definition"></a></dt>
<dd><p>Read current value.</p>
<p>std::string Xapian::ValuePostingSource::get_value() const</p>
<p>Added in 1.2.23 and 1.3.5.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.init">
<code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.init" title="Permalink to this definition"></a></dt>
<dd><p>Set this PostingSource to the start of the list of postings.</p>
<p>void Xapian::ValuePostingSource::init(const Database &amp;db_)</p>
<p>This is called automatically by the matcher prior to each query being
processed.</p>
<p>If a PostingSource is used for multiple searches,  init() will
therefore be called multiple times, and must handle this by using the
database passed in the most recent call.</p>
<p>db:  The database which the PostingSource should iterate through.</p>
<p>Note: in the case of a multi-database search, a separate PostingSource
will be used for each database (the separate PostingSources will be
obtained using  clone()), and each PostingSource will be passed one of
the sub-databases as the db parameter here. The db parameter will
therefore always refer to a single database. All docids passed to, or
returned from, the PostingSource refer to docids in that single
database, rather than in the multi- database.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.next">
<code class="descname">next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.next" title="Permalink to this definition"></a></dt>
<dd><p>Advance the current position to the next matching document.</p>
<p>void Xapian::ValuePostingSource::next(double min_wt)</p>
<p>The PostingSource starts before the first entry in the list, so next()
must be called before any methods which need the context of the
current position.</p>
<p>Xapian will always call init() on a PostingSource before calling this
for the first time.</p>
<p>min_wt:  The minimum weight contribution that is needed (this is just
a hint which subclasses may ignore).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.set_termfreq_est">
<code class="descname">set_termfreq_est</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.set_termfreq_est" title="Permalink to this definition"></a></dt>
<dd><p>An estimate of the term frequency.</p>
<p>void Xapian::ValuePostingSource::set_termfreq_est(Xapian::doccount
<a href="#id48"><span class="problematic" id="id49">termfreq_est_</span></a>)</p>
<p>Subclasses should set this if they are overriding the next(),
skip_to() or check() methods.</p>
<p>Added in 1.2.23 and 1.3.5.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.set_termfreq_max">
<code class="descname">set_termfreq_max</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.set_termfreq_max" title="Permalink to this definition"></a></dt>
<dd><p>An upper bound on the term frequency.</p>
<p>void Xapian::ValuePostingSource::set_termfreq_max(Xapian::doccount
<a href="#id50"><span class="problematic" id="id51">termfreq_max_</span></a>)</p>
<p>Subclasses should set this if they are overriding the next(),
skip_to() or check() methods.</p>
<p>Added in 1.2.23 and 1.3.5.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.set_termfreq_min">
<code class="descname">set_termfreq_min</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.set_termfreq_min" title="Permalink to this definition"></a></dt>
<dd><p>Set a lower bound on the term frequency.</p>
<p>void Xapian::ValuePostingSource::set_termfreq_min(Xapian::doccount
<a href="#id52"><span class="problematic" id="id53">termfreq_min_</span></a>)</p>
<p>Subclasses should set this if they are overriding the next(),
skip_to() or check() methods to return fewer documents.</p>
<p>Added in 1.2.23 and 1.3.5.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValuePostingSource.skip_to">
<code class="descname">skip_to</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValuePostingSource.skip_to" title="Permalink to this definition"></a></dt>
<dd><p>Advance to the specified docid.</p>
<p>void Xapian::ValuePostingSource::skip_to(Xapian::docid min_docid,
double min_wt)</p>
<p>If the specified docid isn&#8217;t in the list, position ourselves on the
first document after it (or at_end() if no greater docids are
present).</p>
<p>If the current position is already the specified docid, this method
will leave the position unmodified.</p>
<p>If the specified docid is earlier than the current position, the
behaviour is unspecified. A sensible behaviour would be to leave the
current position unmodified, but it is also reasonable to move to the
specified docid.</p>
<p>The default implementation calls next() repeatedly, which works but
skip_to() can often be implemented much more efficiently.</p>
<p>Xapian will always call init() on a PostingSource before calling this
for the first time.</p>
<p>Note: in the case of a multi-database search, the docid specified is
the docid in the single subdatabase relevant to this posting source.
See the  init() method for details.</p>
<p>did:  The document id to advance to.</p>
<p>min_wt:  The minimum weight contribution that is needed (this is just
a hint which subclasses may ignore).</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.ValuePostingSource.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.ValuePostingSource.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ValueRangeProcessor">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ValueRangeProcessor</code><a class="reference internal" href="_modules/xapian.html#ValueRangeProcessor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ValueRangeProcessor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Base class for value range processors.</p>
<dl class="method">
<dt id="xapian.ValueRangeProcessor.release">
<code class="descname">release</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValueRangeProcessor.release" title="Permalink to this definition"></a></dt>
<dd><p>Start reference counting this object.</p>
<p>const ValueRangeProcessor* Xapian::ValueRangeProcessor::release()
const</p>
<p>You can hand ownership of a dynamically allocated ValueRangeProcessor
object to Xapian by calling release() and then passing the object to a
Xapian method. Xapian will arrange to delete the object once it is no
longer required.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.ValueRangeProcessor.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.ValueRangeProcessor.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ValueSetMatchDecider">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ValueSetMatchDecider</code><span class="sig-paren">(</span><em>slot</em>, <em>inclusive_</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ValueSetMatchDecider"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ValueSetMatchDecider" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.MatchDecider" title="xapian.MatchDecider"><code class="xref py py-class docutils literal"><span class="pre">xapian.MatchDecider</span></code></a></p>
<p>MatchDecider filtering results based on whether document values are in
a user- defined set.</p>
<dl class="method">
<dt id="xapian.ValueSetMatchDecider.add_value">
<code class="descname">add_value</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValueSetMatchDecider.add_value" title="Permalink to this definition"></a></dt>
<dd><p>Add a value to the test set.</p>
<p>void Xapian::ValueSetMatchDecider::add_value(const std::string &amp;value)</p>
<p>value:  The value to add to the test set.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValueSetMatchDecider.remove_value">
<code class="descname">remove_value</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValueSetMatchDecider.remove_value" title="Permalink to this definition"></a></dt>
<dd><p>Remove a value from the test set.</p>
<p>void Xapian::ValueSetMatchDecider::remove_value(const std::string
&amp;value)</p>
<p>value:  The value to remove from the test set.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.ValueSetMatchDecider.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.ValueSetMatchDecider.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ValueStreamItem">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ValueStreamItem</code><span class="sig-paren">(</span><em>docid</em>, <em>value</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ValueStreamItem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ValueStreamItem" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>An item returned from iteration of the values in a document.</p>
<p>The item supports access to the following attributes:</p>
<blockquote>
<div><ul class="simple">
<li><cite>docid</cite>: The docid for the item.</li>
<li><cite>value</cite>: The contents of the value.</li>
</ul>
</div></blockquote>
<dl class="attribute">
<dt id="xapian.ValueStreamItem.docid">
<code class="descname">docid</code><a class="headerlink" href="#xapian.ValueStreamItem.docid" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.ValueStreamItem.value">
<code class="descname">value</code><a class="headerlink" href="#xapian.ValueStreamItem.value" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ValueStreamIter">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ValueStreamIter</code><span class="sig-paren">(</span><em>start</em>, <em>end</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ValueStreamIter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ValueStreamIter" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>An iterator over all the values stored in a document.</p>
<p>The iterator will return ValueStreamItem objects, in ascending order of value number.</p>
<dl class="method">
<dt id="xapian.ValueStreamIter.next">
<code class="descname">next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ValueStreamIter.next"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ValueStreamIter.next" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.ValueStreamIter.skip_to">
<code class="descname">skip_to</code><span class="sig-paren">(</span><em>docid</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ValueStreamIter.skip_to"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ValueStreamIter.skip_to" title="Permalink to this definition"></a></dt>
<dd><p>Skip the iterator forward.</p>
<p>The iterator is advanced to the first document with a document ID
which is greater than or equal to the supplied document ID.</p>
<p>If there are no such items, this will raise StopIteration.</p>
<p>This returns the item which the iterator is moved to.  The subsequent
item will be returned the next time that next() is called (unless
skip_to() is called again first).</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.ValueWeightPostingSource">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">ValueWeightPostingSource</code><span class="sig-paren">(</span><em>slot_</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#ValueWeightPostingSource"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.ValueWeightPostingSource" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.ValuePostingSource" title="xapian.ValuePostingSource"><code class="xref py py-class docutils literal"><span class="pre">xapian.ValuePostingSource</span></code></a></p>
<p>A posting source which reads weights from a value slot.</p>
<p>This returns entries for all documents in the given database which
have a non empty values in the specified slot. It returns a weight
calculated by applying sortable_unserialise to the value stored in the
slot (so the values stored should probably have been calculated by
applying sortable_serialise to a floating point number at index time).</p>
<p>The upper bound on the weight returned is set using the upper bound on
the values in the specified slot, or DBL_MAX if value bounds aren&#8217;t
supported by the current backend.</p>
<p>For efficiency, this posting source doesn&#8217;t check that the stored
values are valid in any way, so it will never raise an exception due
to invalid stored values. In particular, it doesn&#8217;t ensure that the
unserialised values are positive, which is a requirement for weights.
The behaviour if the slot contains values which unserialise to
negative values is undefined.</p>
<dl class="method">
<dt id="xapian.ValueWeightPostingSource.get_weight">
<code class="descname">get_weight</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValueWeightPostingSource.get_weight" title="Permalink to this definition"></a></dt>
<dd><p>Return the weight contribution for the current document.</p>
<p>double Xapian::ValueWeightPostingSource::get_weight() const</p>
<p>This default implementation always returns 0, for convenience when
implementing &#8220;weight-less&#8221; PostingSource subclasses.</p>
<p>This method may assume that it will only be called when there is a
&#8220;current document&#8221;. In detail: Xapian will always call init() on a
PostingSource before calling this for the first time. It will also
only call this if the PostingSource reports that it is pointing to a
valid document (ie, it will not call it before calling at least one of
next(), skip_to() or check(), and will ensure that the PostingSource
is not at the end by calling at_end()).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValueWeightPostingSource.init">
<code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValueWeightPostingSource.init" title="Permalink to this definition"></a></dt>
<dd><p>Set this PostingSource to the start of the list of postings.</p>
<p>void Xapian::ValueWeightPostingSource::init(const Database &amp;db_)</p>
<p>This is called automatically by the matcher prior to each query being
processed.</p>
<p>If a PostingSource is used for multiple searches,  init() will
therefore be called multiple times, and must handle this by using the
database passed in the most recent call.</p>
<p>db:  The database which the PostingSource should iterate through.</p>
<p>Note: in the case of a multi-database search, a separate PostingSource
will be used for each database (the separate PostingSources will be
obtained using  clone()), and each PostingSource will be passed one of
the sub-databases as the db parameter here. The db parameter will
therefore always refer to a single database. All docids passed to, or
returned from, the PostingSource refer to docids in that single
database, rather than in the multi- database.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.ValueWeightPostingSource.name">
<code class="descname">name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.ValueWeightPostingSource.name" title="Permalink to this definition"></a></dt>
<dd><p>Name of the posting source class.</p>
<p>std::string Xapian::ValueWeightPostingSource::name() const</p>
<p>This is used when serialising and unserialising posting sources; for
example, for performing remote searches.</p>
<p>If the subclass is in a C++ namespace, the namespace should be
included in the name, using &#8221;::&#8221; as a separator. For example, for a
PostingSource subclass called &#8220;FooPostingSource&#8221; in the &#8220;Xapian&#8221;
namespace the result of this call should be
&#8220;Xapian::FooPostingSource&#8221;.</p>
<p>This should only be implemented if serialise() and unserialise() are
also implemented. The default implementation returns an empty string.</p>
<p>If this returns an empty string, Xapian will assume that serialise()
and unserialise() are not implemented.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.ValueWeightPostingSource.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.ValueWeightPostingSource.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="xapian.Weight">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">Weight</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#Weight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.Weight" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Abstract base class for weighting schemes.</p>
<dl class="attribute">
<dt id="xapian.Weight.ABSOLUTE_DISCOUNT_SMOOTHING">
<code class="descname">ABSOLUTE_DISCOUNT_SMOOTHING</code><em class="property"> = 3</em><a class="headerlink" href="#xapian.Weight.ABSOLUTE_DISCOUNT_SMOOTHING" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Weight.DIRICHLET_PLUS_SMOOTHING">
<code class="descname">DIRICHLET_PLUS_SMOOTHING</code><em class="property"> = 5</em><a class="headerlink" href="#xapian.Weight.DIRICHLET_PLUS_SMOOTHING" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Weight.DIRICHLET_SMOOTHING">
<code class="descname">DIRICHLET_SMOOTHING</code><em class="property"> = 2</em><a class="headerlink" href="#xapian.Weight.DIRICHLET_SMOOTHING" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Weight.JELINEK_MERCER_SMOOTHING">
<code class="descname">JELINEK_MERCER_SMOOTHING</code><em class="property"> = 4</em><a class="headerlink" href="#xapian.Weight.JELINEK_MERCER_SMOOTHING" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.Weight.TWO_STAGE_SMOOTHING">
<code class="descname">TWO_STAGE_SMOOTHING</code><em class="property"> = 1</em><a class="headerlink" href="#xapian.Weight.TWO_STAGE_SMOOTHING" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="xapian.Weight.get_maxextra">
<code class="descname">get_maxextra</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Weight.get_maxextra" title="Permalink to this definition"></a></dt>
<dd><p>Return an upper bound on what get_sumextra() can return for any
document.</p>
<p>virtual double Xapian::Weight::get_maxextra() const =0</p>
<p>This information is used by the matcher to perform various
optimisations, so strive to make the bound as tight as possible.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Weight.get_maxpart">
<code class="descname">get_maxpart</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Weight.get_maxpart" title="Permalink to this definition"></a></dt>
<dd><p>Return an upper bound on what get_sumpart() can return for any
document.</p>
<p>virtual double Xapian::Weight::get_maxpart() const =0</p>
<p>This information is used by the matcher to perform various
optimisations, so strive to make the bound as tight as possible.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Weight.get_sumextra">
<code class="descname">get_sumextra</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Weight.get_sumextra" title="Permalink to this definition"></a></dt>
<dd><p>Calculate the term-independent weight component for a document.</p>
<p>virtual double Xapian::Weight::get_sumextra(Xapian::termcount doclen,
Xapian::termcount uniqterms) const =0</p>
<p>The parameter gives information about the document which may be used
in the calculations:</p>
<p>doclen:  The document&#8217;s length (unnormalised).</p>
<p>uniqterms:  The number of unique terms in the document.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Weight.get_sumpart">
<code class="descname">get_sumpart</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Weight.get_sumpart" title="Permalink to this definition"></a></dt>
<dd><p>Calculate the weight contribution for this object&#8217;s term to a
document.</p>
<p>virtual double Xapian::Weight::get_sumpart(Xapian::termcount wdf,
Xapian::termcount doclen, Xapian::termcount uniqterms) const =0</p>
<p>The parameters give information about the document which may be used
in the calculations:</p>
<p>wdf:  The within document frequency of the term in the document.</p>
<p>doclen:  The document&#8217;s length (unnormalised).</p>
<p>uniqterms:  Number of unique terms in the document (used for absolute
smoothing).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.Weight.name">
<code class="descname">name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.Weight.name" title="Permalink to this definition"></a></dt>
<dd><p>Return the name of this weighting scheme.</p>
<p>virtual std::string Xapian::Weight::name() const</p>
<p>This name is used by the remote backend. It is passed along with the
serialised parameters to the remote server so that it knows which
class to create.</p>
<p>Return the full namespace-qualified name of your class here - if your
class is called FooWeight, return &#8220;FooWeight&#8221; from this method (
Xapian::BM25Weight returns &#8220;Xapian::BM25Weight&#8221; here).</p>
<p>If you don&#8217;t want to support the remote backend, you can use the
default implementation which simply returns an empty string.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.Weight.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.Weight.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="xapian.WildcardError">
<em class="property">exception </em><code class="descclassname">xapian.</code><code class="descname">WildcardError</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#WildcardError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.WildcardError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.RuntimeError" title="xapian.RuntimeError"><code class="xref py py-class docutils literal"><span class="pre">xapian.RuntimeError</span></code></a></p>
<p>WildcardError indicates an error expanding a wildcarded query.</p>
</dd></dl>

<dl class="class">
<dt id="xapian.WritableDatabase">
<em class="property">class </em><code class="descclassname">xapian.</code><code class="descname">WritableDatabase</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#WritableDatabase"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.WritableDatabase" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#xapian.Database" title="xapian.Database"><code class="xref py py-class docutils literal"><span class="pre">xapian.Database</span></code></a></p>
<p>This class provides read/write access to a database.</p>
<dl class="method">
<dt id="xapian.WritableDatabase.add_document">
<code class="descname">add_document</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.WritableDatabase.add_document" title="Permalink to this definition"></a></dt>
<dd><p>Add a new document to the database.</p>
<p>Xapian::docid Xapian::WritableDatabase::add_document(const
Xapian::Document &amp;document)</p>
<p>This method adds the specified document to the database, returning a
newly allocated document ID. Automatically allocated document IDs come
from a per-database monotonically increasing counter, so IDs from
deleted documents won&#8217;t be reused.</p>
<p>If you want to specify the document ID to be used, you should call
replace_document() instead.</p>
<p>Note that changes to the database won&#8217;t be immediately committed to
disk; see commit() for more details.</p>
<p>As with all database modification operations, the effect is atomic:
the document will either be fully added, or the document fails to be
added and an exception is thrown (possibly at a later time when
commit() is called or the database is closed).</p>
<p>document:  The new document to be added.</p>
<p>The document ID of the newly added document.</p>
<p>Xapian::DatabaseError:  will be thrown if a problem occurs while
writing to the database.</p>
<p>Xapian::DatabaseCorruptError:  will be thrown if the database is in a
corrupt state.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.WritableDatabase.add_spelling">
<code class="descname">add_spelling</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.WritableDatabase.add_spelling" title="Permalink to this definition"></a></dt>
<dd><p>Add a word to the spelling dictionary.</p>
<p>void Xapian::WritableDatabase::add_spelling(const std::string &amp;word,
Xapian::termcount freqinc=1) const</p>
<p>If the word is already present, its frequency is increased.</p>
<p>word:  The word to add.</p>
<p>freqinc:  How much to increase its frequency by (default 1).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.WritableDatabase.add_synonym">
<code class="descname">add_synonym</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.WritableDatabase.add_synonym" title="Permalink to this definition"></a></dt>
<dd><p>Add a synonym for a term.</p>
<p>void Xapian::WritableDatabase::add_synonym(const std::string &amp;term,
const std::string &amp;synonym) const</p>
<p>term:  The term to add a synonym for.</p>
<p>synonym:  The synonym to add. If this is already a synonym for term,
then no action is taken.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.WritableDatabase.begin_transaction">
<code class="descname">begin_transaction</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.WritableDatabase.begin_transaction" title="Permalink to this definition"></a></dt>
<dd><p>Begin a transaction.</p>
<p>void Xapian::WritableDatabase::begin_transaction(bool flushed=true)</p>
<p>In Xapian a transaction is a group of modifications to the database
which are linked such that either all will be applied simultaneously
or none will be applied at all. Even in the case of a power failure,
this characteristic should be preserved (as long as the filesystem
isn&#8217;t corrupted, etc).</p>
<p>A transaction is started with begin_transaction() and can either be
committed by calling commit_transaction() or aborted by calling
cancel_transaction().</p>
<p>By default, a transaction implicitly calls commit() before and after
so that the modifications stand and fall without affecting
modifications before or after.</p>
<p>The downside of these implicit calls to commit() is that small
transactions can harm indexing performance in the same way that
explicitly calling commit() frequently can.</p>
<p>If you&#8217;re applying atomic groups of changes and only wish to ensure
that each group is either applied or not applied, then you can prevent
the automatic commit() before and after the transaction by starting
the transaction with begin_transaction(false). However, if
cancel_transaction is called (or if commit_transaction isn&#8217;t called
before the WritableDatabase object is destroyed) then any changes
which were pending before the transaction began will also be
discarded.</p>
<p>Transactions aren&#8217;t currently supported by the InMemory backend.</p>
<p>flushed:  Is this a flushed transaction? By default transactions are
&#8220;flushed&#8221;, which means that committing a transaction will ensure
those changes are permanently written to the database. By contrast,
unflushed transactions only ensure that changes within the transaction
are either all applied or all aren&#8217;t.</p>
<p>Xapian::UnimplementedError:  will be thrown if transactions are not
available for this database type.</p>
<p>Xapian::InvalidOperationError:  will be thrown if this is called at an
invalid time, such as when a transaction is already in progress.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.WritableDatabase.cancel_transaction">
<code class="descname">cancel_transaction</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.WritableDatabase.cancel_transaction" title="Permalink to this definition"></a></dt>
<dd><p>Abort the transaction currently in progress, discarding the pending
modifications made to the database.</p>
<p>void Xapian::WritableDatabase::cancel_transaction()</p>
<p>If an error occurs in this method, an exception will be thrown, but
the transaction will be cancelled anyway.</p>
<p>Xapian::DatabaseError:  will be thrown if a problem occurs while
modifying the database.</p>
<p>Xapian::DatabaseCorruptError:  will be thrown if the database is in a
corrupt state.</p>
<p>Xapian::InvalidOperationError:  will be thrown if a transaction is not
currently in progress.</p>
<p>Xapian::UnimplementedError:  will be thrown if transactions are not
available for this database type.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.WritableDatabase.clear_synonyms">
<code class="descname">clear_synonyms</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.WritableDatabase.clear_synonyms" title="Permalink to this definition"></a></dt>
<dd><p>Remove all synonyms for a term.</p>
<p>void Xapian::WritableDatabase::clear_synonyms(const std::string &amp;term)
const</p>
<p>term:  The term to remove all synonyms for. If the term has no
synonyms, no action is taken.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.WritableDatabase.commit">
<code class="descname">commit</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.WritableDatabase.commit" title="Permalink to this definition"></a></dt>
<dd><p>Commit any pending modifications made to the database.</p>
<p>void Xapian::WritableDatabase::commit()</p>
<p>For efficiency reasons, when performing multiple updates to a database
it is best (indeed, almost essential) to make as many modifications as
memory will permit in a single pass through the database. To ensure
this, Xapian batches up modifications.</p>
<p>This method may be called at any time to commit any pending
modifications to the database.</p>
<p>If any of the modifications fail, an exception will be thrown and the
database will be left in a state in which each separate addition,
replacement or deletion operation has either been fully performed or
not performed at all: it is then up to the application to work out
which operations need to be repeated.</p>
<p>It&#8217;s not valid to call commit() within a transaction.</p>
<p>Beware of calling commit() too frequently: this will make indexing
take much longer.</p>
<p>Note that commit() need not be called explicitly: it will be called
automatically when the database is closed, or when a sufficient number
of modifications have been made. By default, this is every 10000
documents added, deleted, or modified. This value is rather
conservative, and if you have a machine with plenty of memory, you can
improve indexing throughput dramatically by setting
XAPIAN_FLUSH_THRESHOLD in the environment to a larger value.</p>
<p>This method was new in Xapian 1.1.0 - in earlier versions it was
called flush().</p>
<p>Xapian::DatabaseError:  will be thrown if a problem occurs while
modifying the database.</p>
<p>Xapian::DatabaseCorruptError:  will be thrown if the database is in a
corrupt state.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.WritableDatabase.commit_transaction">
<code class="descname">commit_transaction</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.WritableDatabase.commit_transaction" title="Permalink to this definition"></a></dt>
<dd><p>Complete the transaction currently in progress.</p>
<p>void Xapian::WritableDatabase::commit_transaction()</p>
<p>If this method completes successfully and this is a flushed
transaction, all the database modifications made during the
transaction will have been committed to the database.</p>
<p>If an error occurs, an exception will be thrown, and none of the
modifications made to the database during the transaction will have
been applied to the database.</p>
<p>In all cases the transaction will no longer be in progress.</p>
<p>Xapian::DatabaseError:  will be thrown if a problem occurs while
modifying the database.</p>
<p>Xapian::DatabaseCorruptError:  will be thrown if the database is in a
corrupt state.</p>
<p>Xapian::InvalidOperationError:  will be thrown if a transaction is not
currently in progress.</p>
<p>Xapian::UnimplementedError:  will be thrown if transactions are not
available for this database type.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.WritableDatabase.delete_document">
<code class="descname">delete_document</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.WritableDatabase.delete_document" title="Permalink to this definition"></a></dt>
<dd><p>Delete any documents indexed by a term from the database.</p>
<p>void Xapian::WritableDatabase::delete_document(const std::string
&amp;unique_term)</p>
<p>This method removes any documents indexed by the specified term from
the database.</p>
<p>A major use is for convenience when UIDs from another system are
mapped to terms in Xapian, although this method has other uses (for
example, you could add a &#8220;deletion date&#8221; term to documents at index
time and use this method to delete all documents due for deletion on a
particular date).</p>
<p>unique_term:  The term to remove references to.</p>
<p>Xapian::DatabaseError:  will be thrown if a problem occurs while
writing to the database.</p>
<p>Xapian::DatabaseCorruptError:  will be thrown if the database is in a
corrupt state.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.WritableDatabase.flush">
<code class="descname">flush</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.WritableDatabase.flush" title="Permalink to this definition"></a></dt>
<dd><p>Pre-1.1.0 name for commit().</p>
<p>void Xapian::WritableDatabase::flush()</p>
<p>Use commit() instead.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.WritableDatabase.remove_spelling">
<code class="descname">remove_spelling</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.WritableDatabase.remove_spelling" title="Permalink to this definition"></a></dt>
<dd><p>Remove a word from the spelling dictionary.</p>
<p>void Xapian::WritableDatabase::remove_spelling(const std::string
&amp;word, Xapian::termcount freqdec=1) const</p>
<p>The word&#8217;s frequency is decreased, and if would become zero or less
then the word is removed completely.</p>
<p>word:  The word to remove.</p>
<p>freqdec:  How much to decrease its frequency by (default 1).</p>
</dd></dl>

<dl class="method">
<dt id="xapian.WritableDatabase.remove_synonym">
<code class="descname">remove_synonym</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.WritableDatabase.remove_synonym" title="Permalink to this definition"></a></dt>
<dd><p>Remove a synonym for a term.</p>
<p>void Xapian::WritableDatabase::remove_synonym(const std::string &amp;term,
const std::string &amp;synonym) const</p>
<p>term:  The term to remove a synonym for.</p>
<p>synonym:  The synonym to remove. If this isn&#8217;t currently a synonym for
term, then no action is taken.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.WritableDatabase.replace_document">
<code class="descname">replace_document</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.WritableDatabase.replace_document" title="Permalink to this definition"></a></dt>
<dd><p>Replace any documents matching a term.</p>
<p>Xapian::docid Xapian::WritableDatabase::replace_document(const
std::string &amp;unique_term, const Xapian::Document &amp;document)</p>
<p>This method replaces any documents indexed by the specified term with
the specified document. If any documents are indexed by the term, the
lowest document ID will be used for the document, otherwise a new
document ID will be generated as for add_document.</p>
<p>One common use is to allow UIDs from another system to easily be
mapped to terms in Xapian. Note that this method doesn&#8217;t automatically
add unique_term as a term, so you&#8217;ll need to call
document.add_term(unique_term) first when using replace_document() in
this way.</p>
<p>Note that changes to the database won&#8217;t be immediately committed to
disk; see commit() for more details.</p>
<p>As with all database modification operations, the effect is atomic:
the document(s) will either be fully replaced, or the document(s) fail
to be replaced and an exception is thrown (possibly at a later time
when commit() is called or the database is closed).</p>
<p>unique_term:  The &#8220;unique&#8221; term.</p>
<p>document:  The new document.</p>
<p>The document ID that document was given.</p>
<p>Xapian::DatabaseError:  will be thrown if a problem occurs while
writing to the database.</p>
<p>Xapian::DatabaseCorruptError:  will be thrown if the database is in a
corrupt state.</p>
</dd></dl>

<dl class="method">
<dt id="xapian.WritableDatabase.set_metadata">
<code class="descname">set_metadata</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.WritableDatabase.set_metadata" title="Permalink to this definition"></a></dt>
<dd><p>Set the user-specified metadata associated with a given key.</p>
<p>void Xapian::WritableDatabase::set_metadata(const std::string &amp;key,
const std::string &amp;value)</p>
<p>This method sets the metadata value associated with a given key. If
there is already a metadata value stored in the database with the same
key, the old value is replaced. If you want to delete an existing item
of metadata, just set its value to the empty string.</p>
<p>User-specified metadata allows you to store arbitrary information in
the form of (key,tag) pairs.</p>
<p>There&#8217;s no hard limit on the number of metadata items, or the size of
the metadata values. Metadata keys have a limited length, which
depends on the backend. We recommend limiting them to 200 bytes. Empty
keys are not valid, and specifying one will cause an exception.</p>
<p>Metadata modifications are committed to disk in the same way as
modifications to the documents in the database are: i.e.,
modifications are atomic, and won&#8217;t be committed to disk immediately
(see commit() for more details). This allows metadata to be used to
link databases with versioned external resources by storing the
appropriate version number in a metadata item.</p>
<p>You can also use the metadata to store arbitrary extra information
associated with terms, documents, or postings by encoding the termname
and/or document id into the metadata key.</p>
<p>key:  The key of the metadata item to set.</p>
<p>value:  The value of the metadata item to set.</p>
<p>Xapian::DatabaseError:  will be thrown if a problem occurs while
writing to the database.</p>
<p>Xapian::DatabaseCorruptError:  will be thrown if the database is in a
corrupt state.</p>
<p>Xapian::InvalidArgumentError:  will be thrown if the key supplied is
empty.</p>
<p>Xapian::UnimplementedError:  will be thrown if the database backend in
use doesn&#8217;t support user- specified metadata.</p>
</dd></dl>

<dl class="attribute">
<dt id="xapian.WritableDatabase.thisown">
<code class="descname">thisown</code><a class="headerlink" href="#xapian.WritableDatabase.thisown" title="Permalink to this definition"></a></dt>
<dd><p>The membership flag</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="xapian.chert_open">
<code class="descclassname">xapian.</code><code class="descname">chert_open</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#chert_open"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.chert_open" title="Permalink to this definition"></a></dt>
<dd><p>Construct a Database object for update access to a Chert database.</p>
<p>WritableDatabase Xapian::Chert::open(const std::string &amp;dir, int
action, int block_size=0)</p>
<p>dir:  pathname of the directory containing the database.</p>
<p>action:  determines handling of existing/non-existing database:
Xapian::DB_CREATE fail if database already exist, otherwise create new
database.</p>
<p>Xapian::DB_CREATE_OR_OPEN open existing database, or create new
database if none exists.</p>
<p>Xapian::DB_CREATE_OR_OVERWRITE overwrite existing database, or create
new database if none exists.</p>
<p>Xapian::DB_OPEN open existing database, failing if none exists.</p>
<p>block_size:  the Btree blocksize to use (in bytes), which must be a
power of two between 2048 and 65536 (inclusive). The default (also
used if an invalid value if passed) is 8192 bytes. This parameter is
ignored when opening an existing database.</p>
</dd></dl>

<dl class="function">
<dt id="xapian.inmemory_open">
<code class="descclassname">xapian.</code><code class="descname">inmemory_open</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#inmemory_open"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.inmemory_open" title="Permalink to this definition"></a></dt>
<dd><p>Construct a WritableDatabase object for a new, empty InMemory
database.</p>
<p>WritableDatabase Xapian::InMemory::open()</p>
<p>Only a writable InMemory database can be created, since a read-only
one would always remain empty.</p>
</dd></dl>

<dl class="function">
<dt id="xapian.major_version">
<code class="descclassname">xapian.</code><code class="descname">major_version</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.major_version" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="xapian.metres_to_miles">
<code class="descclassname">xapian.</code><code class="descname">metres_to_miles</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.metres_to_miles" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="xapian.miles_to_metres">
<code class="descclassname">xapian.</code><code class="descname">miles_to_metres</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.miles_to_metres" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="xapian.minor_version">
<code class="descclassname">xapian.</code><code class="descname">minor_version</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.minor_version" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="xapian.new_instancemethod">
<code class="descclassname">xapian.</code><code class="descname">new_instancemethod</code><a class="headerlink" href="#xapian.new_instancemethod" title="Permalink to this definition"></a></dt>
<dd><p>alias of <code class="xref py py-class docutils literal"><span class="pre">instancemethod</span></code></p>
</dd></dl>

<dl class="function">
<dt id="xapian.open_stub">
<code class="descclassname">xapian.</code><code class="descname">open_stub</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#open_stub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.open_stub" title="Permalink to this definition"></a></dt>
<dd><p>Construct a WritableDatabase object for a stub database file.</p>
<p>WritableDatabase Xapian::Auto::open_stub(const std::string &amp;file, int
action)</p>
<p>The stub database file must contain serialised parameters for exactly
one database.</p>
<p>file:  pathname of the stub database file.</p>
<p>action:  determines handling of existing/non-existing database:
Xapian::DB_CREATE fail if database already exist, otherwise create new
database.</p>
<p>Xapian::DB_CREATE_OR_OPEN open existing database, or create new
database if none exists.</p>
<p>Xapian::DB_CREATE_OR_OVERWRITE overwrite existing database, or create
new database if none exists.</p>
<p>Xapian::DB_OPEN open existing database, failing if none exists.</p>
</dd></dl>

<dl class="function">
<dt id="xapian.remote_open">
<code class="descclassname">xapian.</code><code class="descname">remote_open</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#remote_open"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.remote_open" title="Permalink to this definition"></a></dt>
<dd><p>Construct a Database object for read-only access to a remote database
accessed via a program.</p>
<p>Database Xapian::Remote::open(const std::string &amp;program, const
std::string &amp;args, useconds_t timeout=10000)</p>
<p>Access to the remote database is done by running an external program
and communicating with it on stdin/stdout.</p>
<p>program:  the external program to run.</p>
<p>args:  space-separated list of arguments to pass to program.</p>
<p>timeout:  timeout in milliseconds. If this timeout is exceeded for any
individual operation on the remote database then
Xapian::NetworkTimeoutError is thrown. A timeout of 0 means don&#8217;t
timeout. (Default is 10000ms, which is 10 seconds).</p>
</dd></dl>

<dl class="function">
<dt id="xapian.remote_open_writable">
<code class="descclassname">xapian.</code><code class="descname">remote_open_writable</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/xapian.html#remote_open_writable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xapian.remote_open_writable" title="Permalink to this definition"></a></dt>
<dd><p>Construct a WritableDatabase object for update access to a remote
database accessed via a program.</p>
<p>WritableDatabase Xapian::Remote::open_writable(const std::string
&amp;program, const std::string &amp;args, useconds_t timeout=0, int flags=0)</p>
<p>Access to the remote database is done by running an external program
and communicating with it on stdin/stdout.</p>
<p>program:  the external program to run.</p>
<p>args:  space-separated list of arguments to pass to program.</p>
<p>timeout:  timeout in milliseconds. If this timeout is exceeded for any
individual operation on the remote database then
Xapian::NetworkTimeoutError is thrown. (Default is 0, which means
don&#8217;t timeout).</p>
<p>flags:   Xapian::DB_RETRY_LOCK or 0.</p>
</dd></dl>

<dl class="function">
<dt id="xapian.revision">
<code class="descclassname">xapian.</code><code class="descname">revision</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.revision" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="xapian.sortable_serialise">
<code class="descclassname">xapian.</code><code class="descname">sortable_serialise</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.sortable_serialise" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="xapian.sortable_unserialise">
<code class="descclassname">xapian.</code><code class="descname">sortable_unserialise</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.sortable_unserialise" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="xapian.version_string">
<code class="descclassname">xapian.</code><code class="descname">version_string</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.version_string" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="xapian.weakref_proxy">
<code class="descclassname">xapian.</code><code class="descname">weakref_proxy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xapian.weakref_proxy" title="Permalink to this definition"></a></dt>
<dd><p>proxy(object[, callback]) &#8211; create a proxy object that weakly
references &#8216;object&#8217;.  &#8216;callback&#8217;, if given, is called with a
reference to the proxy when &#8216;object&#8217; is about to be finalized.</p>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">xapian Package</a><ul>
<li><a class="reference internal" href="#id1"><code class="docutils literal"><span class="pre">xapian</span></code> Package</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="examples.html"
                        title="previous chapter">Examples</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/xapian.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="examples.html" title="Examples"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Xapian Python Bindings 1.4.3 documentation</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright .
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
    </div>
  </body>
</html>