xapian-core  2.0.0
honey_defs.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2010,2014,2015,2017,2018 Olly Betts
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see
18  * <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef XAPIAN_INCLUDED_HONEY_DEFS_H
22 #define XAPIAN_INCLUDED_HONEY_DEFS_H
23 
24 #include "internaltypes.h"
25 
26 #define SST_SEARCH
27 
29 #define HONEY_TABLE_EXTENSION "honey"
30 
36 #define HONEY_MIN_DB_SIZE 2048
37 
39 #define HONEY_MAX_KEY_LENGTH 255
40 
47 #define HONEY_POSTLIST_CHUNK_MAX 2000
48 
49 // Maximum size of a document length chunk in bytes.
50 #define HONEY_DOCLEN_CHUNK_MAX 2017
51 
52 // HONEY_DOCLEN_CHUNK_MAX should be one more than a
53 // multiple of 12 so for widths 1,2,3,4 we can fix the
54 // initial byte which indicates the width for the chunk
55 // plus an exact number of entries.
56 static_assert((HONEY_DOCLEN_CHUNK_MAX - 1) % 12 == 0,
57  "HONEY_DOCLEN_CHUNK_MAX should be (12 * x + 1)");
58 
64 #define HONEY_MAX_DOCID Xapian::docid(0xffffffffffffffff)
65 
66 namespace Honey {
67 
68 enum table_type {
75  MAX_
76 };
77 
79 enum {
84  KEY_VALUE_CHUNK_HI = 0xe1, // (0xe1 for slots > 26)
85  /* 0xe2-0xe6 inclusive unused currently. */
86  /* 0xe7-0xee inclusive reserved for doc max wdf chunks. */
87  /* 0xef-0xf6 inclusive reserved for unique terms chunks. */
90  KEY_POSTING_CHUNK = 0xff
91 };
92 
93 #define KEY_DOCLEN_PREFIX "\0\xf7"
94 
95 static_assert(((KEY_VALUE_CHUNK_HI - KEY_VALUE_CHUNK) & 0x07) == 0,
96  "No wasted values");
97 
98 }
99 
102 
105 
107 typedef unsigned long long honey_tablesize_t;
108 
109 #endif // XAPIAN_INCLUDED_HONEY_DEFS_H
uint4 honey_block_t
A block number in a honey Btree file.
Definition: honey_defs.h:101
#define HONEY_DOCLEN_CHUNK_MAX
Definition: honey_defs.h:50
unsigned long long honey_tablesize_t
How many entries there are in a table.
Definition: honey_defs.h:107
uint4 honey_revision_number_t
The revision number of a honey database.
Definition: honey_defs.h:104
Types used internally.
uint32_t uint4
Definition: internaltypes.h:31
table_type
Definition: honey_defs.h:68
@ TERMLIST
Definition: honey_defs.h:71
@ DOCDATA
Definition: honey_defs.h:70
@ MAX_
Definition: honey_defs.h:75
@ SYNONYM
Definition: honey_defs.h:74
@ POSITION
Definition: honey_defs.h:72
@ SPELLING
Definition: honey_defs.h:73
@ POSTLIST
Definition: honey_defs.h:69
@ KEY_VALUE_CHUNK_HI
Definition: honey_defs.h:84
@ KEY_VALUE_CHUNK
Definition: honey_defs.h:83
@ KEY_DOCLEN_CHUNK
Definition: honey_defs.h:88
@ KEY_USER_METADATA
Definition: honey_defs.h:80
@ KEY_DOCLEN_CHUNK_HI
Definition: honey_defs.h:89
@ KEY_POSTING_CHUNK
Definition: honey_defs.h:90
@ KEY_VALUE_STATS_HI
Definition: honey_defs.h:82
@ KEY_VALUE_STATS
Definition: honey_defs.h:81