Skip to content

Commit 388010e

Browse files
authored
Merge pull request #1034 from openzim/larger_MAX_INDEXABLE_TITLE_WORD_SIZE
Changed xapian index compaction to safer FULL mode and increased MAX_INDEXABLE_TITLE_WORD_SIZE
2 parents df48c9f + b4b9ed4 commit 388010e

File tree

6 files changed

+4
-16
lines changed

6 files changed

+4
-16
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
run: |
129129
set PKG_CONFIG_PATH=%cd%\BUILD_win-amd64\INSTALL\lib\pkgconfig
130130
dir %PKG_CONFIG_PATH%
131-
meson.exe setup . build -Dwith_xapian_fuller=false -Dwerror=false --buildtype=release
131+
meson.exe setup . build -Dwerror=false --buildtype=release
132132
cd build
133133
ninja.exe
134134

meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ else
3030
private_conf.set('ENABLE_USE_MMAP', get_option('USE_MMAP'))
3131
endif
3232
private_conf.set('ENABLE_USE_BUFFER_HEADER', get_option('USE_BUFFER_HEADER'))
33-
private_conf.set('ENABLE_XAPIAN_FULLER', get_option('with_xapian_fuller'))
3433

3534
static_linkage = get_option('static-linkage')
3635
static_linkage = static_linkage or get_option('default_library')=='static'

meson_options.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,5 @@ option('tests', type : 'boolean', value : true,
2222
description : 'Build the tests.')
2323
option('with_xapian', type : 'boolean', value: true,
2424
description: 'Build libzim with xapian support')
25-
option('with_xapian_fuller', type: 'boolean', value: true,
26-
description: 'Create xapian archive using "FULLER" compaction.\nThis is a workaround for a compilation issue on Windows. This will be removed soon')
2725
option('test_data_dir', type : 'string', value: '',
2826
description: 'Where the test data are. If not set, meson will use a internal directory in the build dir. If you want to download the data in the specified directory you can use `meson download_test_data`. As a special value, you can pass `none` to deactivate test using external test data.')

src/config.h.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
#mesondefine ENABLE_XAPIAN
2121

22-
#mesondefine ENABLE_XAPIAN_FULLER
23-
2422
#mesondefine ENABLE_USE_MMAP
2523

2624
#mesondefine ENABLE_USE_BUFFER_HEADER

src/constants.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
#define DEFAULT_CLUSTER_SIZE 2*1024*1024
2323

2424
// The size in bytes of the longest word that is indexable in a title.
25-
// Xapian's default value is 64 while the hard limit is 245, however crashes
26-
// have been observed with values as low as 150 (demonstrated by the unit test
27-
// Suggestion.handlingOfTooLongWords in test/suggestion.cpp).
25+
// Xapian's default value is 64 while the hard limit is 245.
2826
// Note that a similar limit applies to full-text indexing but we don't
2927
// provide a way to control it (so it is at Xapian's default value of 64)
30-
#define MAX_INDEXABLE_TITLE_WORD_SIZE 64
28+
#define MAX_INDEXABLE_TITLE_WORD_SIZE 240

src/writer/xapianIndexer.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,7 @@ void XapianIndexer::indexTitle(const std::string& path, const std::string& title
202202
void XapianIndexer::indexingPostlude()
203203
{
204204
this->writableDatabase.commit();
205-
#if defined ENABLE_XAPIAN_FULLER
206-
auto flags = Xapian::DBCOMPACT_SINGLE_FILE|Xapian::Compactor::FULLER;
207-
#else
208-
auto flags = Xapian::DBCOMPACT_SINGLE_FILE;
209-
#endif
210-
this->writableDatabase.compact(indexPath, flags);
205+
this->writableDatabase.compact(indexPath, Xapian::DBCOMPACT_SINGLE_FILE|Xapian::Compactor::FULL);
211206
this->writableDatabase.close();
212207
}
213208

0 commit comments

Comments
 (0)