isomorfeus-ferret 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/isomorfeus_ferret_ext/frb_index.c +170 -48
- data/ext/isomorfeus_ferret_ext/frb_search.c +1 -1
- data/ext/isomorfeus_ferret_ext/frb_store.c +231 -108
- data/ext/isomorfeus_ferret_ext/frt_compound_io.c +1 -1
- data/ext/isomorfeus_ferret_ext/frt_index.c +6 -12
- data/ext/isomorfeus_ferret_ext/frt_mdbx_store.c +114 -56
- data/ext/isomorfeus_ferret_ext/frt_store.h +0 -9
- data/ext/isomorfeus_ferret_ext/isomorfeus_ferret.c +2 -2
- data/ext/isomorfeus_ferret_ext/isomorfeus_ferret.h +1 -1
- data/ext/isomorfeus_ferret_ext/mdbx.c +656 -613
- data/ext/isomorfeus_ferret_ext/test.c +26 -28
- data/ext/isomorfeus_ferret_ext/test_index.c +3 -3
- data/ext/isomorfeus_ferret_ext/test_ram_store.c +1 -1
- data/ext/isomorfeus_ferret_ext/test_segments.c +1 -1
- data/ext/isomorfeus_ferret_ext/test_sort.c +2 -2
- data/ext/isomorfeus_ferret_ext/test_threading.c +2 -2
- data/ext/isomorfeus_ferret_ext/tests_all.h +0 -3
- data/lib/isomorfeus/ferret/index/index.rb +8 -9
- data/lib/isomorfeus/ferret/version.rb +1 -1
- metadata +4 -6
- data/ext/isomorfeus_ferret_ext/frt_fs_store.c +0 -479
- data/ext/isomorfeus_ferret_ext/test_fs_store.c +0 -25
@@ -730,33 +730,32 @@ static VALUE frb_ts_except(VALUE v) { return INT2FIX(execute_test(6)); }
|
|
730
730
|
static VALUE frb_ts_fields(VALUE v) { return INT2FIX(execute_test(7)); }
|
731
731
|
static VALUE frb_ts_file_deleter(VALUE v) { return INT2FIX(execute_test(8)); }
|
732
732
|
static VALUE frb_ts_filter(VALUE v) { return INT2FIX(execute_test(9)); }
|
733
|
-
static VALUE
|
734
|
-
static VALUE
|
735
|
-
static VALUE
|
736
|
-
static VALUE
|
737
|
-
static VALUE
|
738
|
-
static VALUE
|
739
|
-
static VALUE
|
740
|
-
static VALUE
|
741
|
-
static VALUE
|
742
|
-
static VALUE
|
743
|
-
static VALUE
|
744
|
-
static VALUE
|
745
|
-
static VALUE
|
746
|
-
static VALUE
|
747
|
-
static VALUE
|
748
|
-
static VALUE
|
749
|
-
static VALUE
|
750
|
-
static VALUE
|
751
|
-
static VALUE
|
752
|
-
static VALUE
|
753
|
-
static VALUE
|
754
|
-
static VALUE
|
755
|
-
static VALUE
|
756
|
-
static VALUE
|
757
|
-
static VALUE
|
758
|
-
static VALUE
|
759
|
-
static VALUE frb_ts_threading(VALUE v) { return INT2FIX(execute_test(36)); }
|
733
|
+
static VALUE frb_ts_global(VALUE v) { return INT2FIX(execute_test(10)); }
|
734
|
+
static VALUE frb_ts_hash(VALUE v) { return INT2FIX(execute_test(11)); }
|
735
|
+
static VALUE frb_ts_hashset(VALUE v) { return INT2FIX(execute_test(12)); }
|
736
|
+
static VALUE frb_ts_helper(VALUE v) { return INT2FIX(execute_test(13)); }
|
737
|
+
static VALUE frb_ts_highlighter(VALUE v) { return INT2FIX(execute_test(14)); }
|
738
|
+
static VALUE frb_ts_index(VALUE v) { return INT2FIX(execute_test(15)); }
|
739
|
+
static VALUE frb_ts_lang(VALUE v) { return INT2FIX(execute_test(16)); }
|
740
|
+
static VALUE frb_ts_mdbx_store(VALUE v) { return INT2FIX(execute_test(17)); }
|
741
|
+
static VALUE frb_ts_mem_pool(VALUE v) { return INT2FIX(execute_test(18)); }
|
742
|
+
static VALUE frb_ts_multimapper(VALUE v) { return INT2FIX(execute_test(19)); }
|
743
|
+
static VALUE frb_ts_priorityqueue(VALUE v){ return INT2FIX(execute_test(20)); }
|
744
|
+
static VALUE frb_ts_q_const_score(VALUE v){ return INT2FIX(execute_test(21)); }
|
745
|
+
static VALUE frb_ts_q_filtered(VALUE v) { return INT2FIX(execute_test(22)); }
|
746
|
+
static VALUE frb_ts_q_fuzzy(VALUE v) { return INT2FIX(execute_test(23)); }
|
747
|
+
static VALUE frb_ts_q_parser(VALUE v) { return INT2FIX(execute_test(24)); }
|
748
|
+
static VALUE frb_ts_q_span(VALUE v) { return INT2FIX(execute_test(25)); }
|
749
|
+
static VALUE frb_ts_ram_store(VALUE v) { return INT2FIX(execute_test(26)); }
|
750
|
+
static VALUE frb_ts_search(VALUE v) { return INT2FIX(execute_test(27)); }
|
751
|
+
static VALUE frb_ts_multi_search(VALUE v) { return INT2FIX(execute_test(28)); }
|
752
|
+
static VALUE frb_ts_segments(VALUE v) { return INT2FIX(execute_test(29)); }
|
753
|
+
static VALUE frb_ts_similarity(VALUE v) { return INT2FIX(execute_test(30)); }
|
754
|
+
static VALUE frb_ts_sort(VALUE v) { return INT2FIX(execute_test(31)); }
|
755
|
+
static VALUE frb_ts_term(VALUE v) { return INT2FIX(execute_test(32)); }
|
756
|
+
static VALUE frb_ts_term_vectors(VALUE v) { return INT2FIX(execute_test(33)); }
|
757
|
+
static VALUE frb_ts_test(VALUE v) { return INT2FIX(execute_test(34)); }
|
758
|
+
static VALUE frb_ts_threading(VALUE v) { return INT2FIX(execute_test(35)); }
|
760
759
|
|
761
760
|
static VALUE frb_ts_posh(VALUE v) {
|
762
761
|
const char *posh = POSH_GetArchString();
|
@@ -809,7 +808,6 @@ void Init_Test(void) {
|
|
809
808
|
rb_define_singleton_method(mTest, "fields", frb_ts_fields, 0);
|
810
809
|
rb_define_singleton_method(mTest, "file_deleter", frb_ts_file_deleter, 0);
|
811
810
|
rb_define_singleton_method(mTest, "filter", frb_ts_filter, 0);
|
812
|
-
rb_define_singleton_method(mTest, "fs_store", frb_ts_fs_store, 0);
|
813
811
|
rb_define_singleton_method(mTest, "global", frb_ts_global, 0);
|
814
812
|
rb_define_singleton_method(mTest, "test_hash", frb_ts_hash, 0);
|
815
813
|
rb_define_singleton_method(mTest, "hashset", frb_ts_hashset, 0);
|
@@ -956,7 +956,7 @@ static void test_iw_add_doc(TestCase *tc, void *data)
|
|
956
956
|
*/
|
957
957
|
static void test_create_with_reader(TestCase *tc, void *data)
|
958
958
|
{
|
959
|
-
FrtStore *store =
|
959
|
+
FrtStore *store = frt_open_mdbx_store(TEST_DIR);
|
960
960
|
(void)data;
|
961
961
|
FrtIndexWriter *iw;
|
962
962
|
FrtIndexReader *ir, *ir2;
|
@@ -2208,7 +2208,7 @@ TestSuite *ts_index(TestSuite *suite)
|
|
2208
2208
|
FrtIndexReader *ir;
|
2209
2209
|
FrtStore *fs_store, *store = frt_open_ram_store(NULL);
|
2210
2210
|
ReaderTestEnvironment *rte = NULL;
|
2211
|
-
/* FrtStore *store =
|
2211
|
+
/* FrtStore *store = frt_open_mdbx_store(TEST_DIR); */
|
2212
2212
|
|
2213
2213
|
/* initialize IDs */
|
2214
2214
|
body = rb_intern("body");
|
@@ -2321,7 +2321,7 @@ TestSuite *ts_index(TestSuite *suite)
|
|
2321
2321
|
/* Other FrtIndexReader Tests */
|
2322
2322
|
tst_run_test_with_name(suite, test_ir_read_while_optimizing, store, "test_ir_read_while_optimizing_in_ram");
|
2323
2323
|
|
2324
|
-
fs_store =
|
2324
|
+
fs_store = frt_open_mdbx_store(TEST_DIR);
|
2325
2325
|
tst_run_test_with_name(suite, test_ir_read_while_optimizing, fs_store, "test_ir_read_while_optimizing_on_disk");
|
2326
2326
|
fs_store->clear_all(fs_store);
|
2327
2327
|
frt_store_close(fs_store);
|
@@ -11,7 +11,7 @@ void test_write_to(TestCase *tc, void *data)
|
|
11
11
|
int i;
|
12
12
|
char *tmp;
|
13
13
|
FrtStore *ram_store = frt_open_ram_store(NULL);
|
14
|
-
FrtStore *fs_store =
|
14
|
+
FrtStore *fs_store = frt_open_mdbx_store("./test/testdir/store");
|
15
15
|
char str[18] = "³³ øãíøäÄ";
|
16
16
|
char buf[18000] = "";
|
17
17
|
FrtOutStream *ostream, *fs_ostream;
|
@@ -47,7 +47,7 @@ static void test_si(TestCase *tc, void *data)
|
|
47
47
|
FrtStore *store = (FrtStore *)data;
|
48
48
|
FrtSegmentInfo *si = frt_si_new(frt_estrdup("_1"), 10, store);
|
49
49
|
Asi_has_vals(si, "_1", 10, store);
|
50
|
-
store =
|
50
|
+
store = frt_open_mdbx_store("./test/testdir/store");
|
51
51
|
si->name[1] = '2';
|
52
52
|
si->doc_cnt += 2;
|
53
53
|
si->store = store;
|
@@ -318,9 +318,9 @@ TestSuite *ts_sort(TestSuite *suite)
|
|
318
318
|
do_byte_test = false;
|
319
319
|
|
320
320
|
#if defined POSH_OS_WIN32 || defined POSH_OS_WIN64
|
321
|
-
fs_store =
|
321
|
+
fs_store = frt_open_mdbx_store(".\\test\\testdir\\store");
|
322
322
|
#else
|
323
|
-
fs_store =
|
323
|
+
fs_store = frt_open_mdbx_store("./test/testdir/store");
|
324
324
|
#endif
|
325
325
|
sort_multi_test_setup(store, fs_store);
|
326
326
|
|
@@ -155,7 +155,7 @@ TestSuite *ts_threading(TestSuite *suite)
|
|
155
155
|
contents = rb_intern("contents");
|
156
156
|
|
157
157
|
FrtAnalyzer *a = frt_letter_analyzer_new(true);
|
158
|
-
FrtStore *store =
|
158
|
+
FrtStore *store = frt_open_mdbx_store("./test/testdir/store");
|
159
159
|
FrtIndex *index;
|
160
160
|
FrtHashSet *def_fields = frt_hs_new_ptr(NULL);
|
161
161
|
FrtFieldInfos *fis = frt_fis_new(0 | FRT_FI_IS_STORED_BM | FRT_FI_IS_INDEXED_BM | FRT_FI_IS_TOKENIZED_BM | FRT_FI_STORE_TERM_VECTOR_BM | FRT_FI_STORE_POSITIONS_BM | FRT_FI_STORE_OFFSETS_BM);
|
@@ -180,7 +180,7 @@ TestSuite *ts_threading(TestSuite *suite)
|
|
180
180
|
|
181
181
|
frt_index_destroy(index);
|
182
182
|
|
183
|
-
store =
|
183
|
+
store = frt_open_mdbx_store("./test/testdir/store");
|
184
184
|
store->clear_all(store);
|
185
185
|
frt_store_close(store);
|
186
186
|
|
@@ -3,7 +3,6 @@
|
|
3
3
|
|
4
4
|
#include "test.h"
|
5
5
|
|
6
|
-
|
7
6
|
TestSuite *ts_1710(TestSuite *suite);
|
8
7
|
TestSuite *ts_analysis(TestSuite *suite);
|
9
8
|
TestSuite *ts_array(TestSuite *suite);
|
@@ -14,7 +13,6 @@ TestSuite *ts_except(TestSuite *suite);
|
|
14
13
|
TestSuite *ts_fields(TestSuite *suite);
|
15
14
|
TestSuite *ts_file_deleter(TestSuite *suite);
|
16
15
|
TestSuite *ts_filter(TestSuite *suite);
|
17
|
-
TestSuite *ts_fs_store(TestSuite *suite);
|
18
16
|
TestSuite *ts_global(TestSuite *suite);
|
19
17
|
TestSuite *ts_hash(TestSuite *suite);
|
20
18
|
TestSuite *ts_hashset(TestSuite *suite);
|
@@ -57,7 +55,6 @@ const struct test_list
|
|
57
55
|
{ts_fields},
|
58
56
|
{ts_file_deleter},
|
59
57
|
{ts_filter},
|
60
|
-
{ts_fs_store},
|
61
58
|
{ts_global},
|
62
59
|
{ts_hash},
|
63
60
|
{ts_hashset},
|
@@ -111,10 +111,9 @@ module Isomorfeus
|
|
111
111
|
if options[:path]
|
112
112
|
@close_dir = true
|
113
113
|
begin
|
114
|
-
@dir =
|
114
|
+
@dir = MDBXDirectory.new(options[:path], options[:create])
|
115
115
|
rescue IOError
|
116
|
-
@dir =
|
117
|
-
options[:create_if_missing] != false)
|
116
|
+
@dir = MDBXDirectory.new(options[:path], options[:create_if_missing] != false)
|
118
117
|
end
|
119
118
|
elsif options[:dir]
|
120
119
|
@dir = options[:dir]
|
@@ -690,9 +689,9 @@ module Isomorfeus
|
|
690
689
|
|
691
690
|
# Returns true if any documents have been deleted since the index was last
|
692
691
|
# flushed.
|
693
|
-
def has_deletions?
|
692
|
+
def has_deletions?
|
694
693
|
@dir.synchronize do
|
695
|
-
ensure_reader_open
|
694
|
+
ensure_reader_open
|
696
695
|
return @reader.has_deletions?
|
697
696
|
end
|
698
697
|
end
|
@@ -703,7 +702,7 @@ module Isomorfeus
|
|
703
702
|
# NOTE: this is not necessary if you are only using this class. All writes
|
704
703
|
# will automatically flush when you perform an operation that reads the
|
705
704
|
# index.
|
706
|
-
def flush
|
705
|
+
def flush
|
707
706
|
@dir.synchronize do
|
708
707
|
if @reader
|
709
708
|
if @searcher
|
@@ -786,10 +785,10 @@ module Isomorfeus
|
|
786
785
|
# false.
|
787
786
|
def persist(directory, create = true)
|
788
787
|
synchronize do
|
789
|
-
close_all
|
788
|
+
close_all
|
790
789
|
old_dir = @dir
|
791
790
|
if directory.is_a?(String)
|
792
|
-
@dir =
|
791
|
+
@dir = MDBXDirectory.new(directory, create)
|
793
792
|
elsif directory.is_a?(Ferret::Store::Directory)
|
794
793
|
@dir = directory
|
795
794
|
end
|
@@ -948,7 +947,7 @@ module Isomorfeus
|
|
948
947
|
return @searcher.search(query, options)
|
949
948
|
end
|
950
949
|
|
951
|
-
def close_all
|
950
|
+
def close_all
|
952
951
|
@dir.synchronize do
|
953
952
|
@searcher.close if @searcher
|
954
953
|
@reader.close if @reader
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-ferret
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.13.
|
19
|
+
version: 3.13.23
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.13.
|
26
|
+
version: 3.13.23
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -202,7 +202,6 @@ files:
|
|
202
202
|
- ext/isomorfeus_ferret_ext/frt_field_index.c
|
203
203
|
- ext/isomorfeus_ferret_ext/frt_field_index.h
|
204
204
|
- ext/isomorfeus_ferret_ext/frt_filter.c
|
205
|
-
- ext/isomorfeus_ferret_ext/frt_fs_store.c
|
206
205
|
- ext/isomorfeus_ferret_ext/frt_global.c
|
207
206
|
- ext/isomorfeus_ferret_ext/frt_global.h
|
208
207
|
- ext/isomorfeus_ferret_ext/frt_hash.c
|
@@ -340,7 +339,6 @@ files:
|
|
340
339
|
- ext/isomorfeus_ferret_ext/test_fields.c
|
341
340
|
- ext/isomorfeus_ferret_ext/test_file_deleter.c
|
342
341
|
- ext/isomorfeus_ferret_ext/test_filter.c
|
343
|
-
- ext/isomorfeus_ferret_ext/test_fs_store.c
|
344
342
|
- ext/isomorfeus_ferret_ext/test_global.c
|
345
343
|
- ext/isomorfeus_ferret_ext/test_hash.c
|
346
344
|
- ext/isomorfeus_ferret_ext/test_hashset.c
|