isomorfeus-ferret 0.13.8 → 0.13.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/isomorfeus_ferret_ext/frb_index.c +15 -21
- data/ext/isomorfeus_ferret_ext/frb_search.c +1 -4
- data/ext/isomorfeus_ferret_ext/frb_store.c +32 -34
- data/ext/isomorfeus_ferret_ext/frt_analysis.c +2 -2
- data/ext/isomorfeus_ferret_ext/frt_analysis.h +5 -5
- data/ext/isomorfeus_ferret_ext/frt_bitvector.c +1 -1
- data/ext/isomorfeus_ferret_ext/frt_bitvector.h +1 -1
- data/ext/isomorfeus_ferret_ext/frt_compound_io.c +34 -59
- data/ext/isomorfeus_ferret_ext/frt_except.c +1 -0
- data/ext/isomorfeus_ferret_ext/frt_filter.c +2 -4
- data/ext/isomorfeus_ferret_ext/frt_fs_store.c +11 -12
- data/ext/isomorfeus_ferret_ext/frt_global.c +6 -4
- data/ext/isomorfeus_ferret_ext/frt_global.h +1 -1
- data/ext/isomorfeus_ferret_ext/frt_hash.c +40 -48
- data/ext/isomorfeus_ferret_ext/frt_hash.h +14 -16
- data/ext/isomorfeus_ferret_ext/frt_ind.c +2 -3
- data/ext/isomorfeus_ferret_ext/frt_index.c +120 -193
- data/ext/isomorfeus_ferret_ext/frt_index.h +13 -13
- data/ext/isomorfeus_ferret_ext/frt_lang.c +1 -4
- data/ext/isomorfeus_ferret_ext/frt_multimapper.c +8 -9
- data/ext/isomorfeus_ferret_ext/frt_multimapper.h +1 -1
- data/ext/isomorfeus_ferret_ext/frt_q_boolean.c +6 -6
- data/ext/isomorfeus_ferret_ext/frt_q_match_all.c +8 -3
- data/ext/isomorfeus_ferret_ext/frt_q_parser.c +1742 -1742
- data/ext/isomorfeus_ferret_ext/frt_q_phrase.c +1 -2
- data/ext/isomorfeus_ferret_ext/frt_q_span.c +11 -10
- data/ext/isomorfeus_ferret_ext/frt_ram_store.c +18 -34
- data/ext/isomorfeus_ferret_ext/frt_search.c +29 -28
- data/ext/isomorfeus_ferret_ext/frt_search.h +18 -19
- data/ext/isomorfeus_ferret_ext/frt_store.c +40 -33
- data/ext/isomorfeus_ferret_ext/frt_store.h +24 -26
- data/ext/isomorfeus_ferret_ext/frt_threading.h +12 -5
- data/ext/isomorfeus_ferret_ext/isomorfeus_ferret.c +4 -3
- data/ext/isomorfeus_ferret_ext/test_1710.c +1 -2
- data/ext/isomorfeus_ferret_ext/test_compound_io.c +8 -8
- data/ext/isomorfeus_ferret_ext/test_fields.c +7 -7
- data/ext/isomorfeus_ferret_ext/test_file_deleter.c +1 -1
- data/ext/isomorfeus_ferret_ext/test_filter.c +4 -3
- data/ext/isomorfeus_ferret_ext/test_fs_store.c +1 -1
- data/ext/isomorfeus_ferret_ext/test_highlighter.c +3 -1
- data/ext/isomorfeus_ferret_ext/test_index.c +59 -59
- data/ext/isomorfeus_ferret_ext/test_q_const_score.c +2 -1
- data/ext/isomorfeus_ferret_ext/test_q_filtered.c +3 -2
- data/ext/isomorfeus_ferret_ext/test_q_fuzzy.c +3 -1
- data/ext/isomorfeus_ferret_ext/test_q_span.c +8 -1
- data/ext/isomorfeus_ferret_ext/test_ram_store.c +4 -4
- data/ext/isomorfeus_ferret_ext/test_search.c +9 -4
- data/ext/isomorfeus_ferret_ext/test_segments.c +4 -3
- data/ext/isomorfeus_ferret_ext/test_sort.c +17 -9
- data/ext/isomorfeus_ferret_ext/test_term.c +4 -2
- data/ext/isomorfeus_ferret_ext/test_term_vectors.c +2 -2
- data/ext/isomorfeus_ferret_ext/test_threading.c +5 -4
- data/lib/isomorfeus/ferret/index/index.rb +8 -3
- data/lib/isomorfeus/ferret/version.rb +1 -1
- metadata +2 -2
@@ -1688,8 +1688,9 @@ TestSuite *ts_search(TestSuite *suite)
|
|
1688
1688
|
|
1689
1689
|
tst_run_test(suite, test_search_unscored, (void *)searcher);
|
1690
1690
|
|
1691
|
-
frt_store_deref(store);
|
1692
1691
|
frt_searcher_close(searcher);
|
1692
|
+
frt_ir_close(ir);
|
1693
|
+
frt_store_close(store);
|
1693
1694
|
return suite;
|
1694
1695
|
}
|
1695
1696
|
|
@@ -1845,7 +1846,9 @@ TestSuite *ts_multi_search(TestSuite *suite)
|
|
1845
1846
|
searchers = FRT_ALLOC_N(FrtSearcher *, 2);
|
1846
1847
|
searchers[0] = frt_isea_new(ir0);
|
1847
1848
|
searchers[1] = frt_isea_new(ir1);
|
1848
|
-
|
1849
|
+
FRT_DEREF(searchers[0]);
|
1850
|
+
FRT_DEREF(searchers[1]);
|
1851
|
+
searcher = frt_msea_new(searchers, 2);
|
1849
1852
|
|
1850
1853
|
tst_run_test(suite, test_get_doc, (void *)searcher);
|
1851
1854
|
|
@@ -1862,8 +1865,10 @@ TestSuite *ts_multi_search(TestSuite *suite)
|
|
1862
1865
|
|
1863
1866
|
tst_run_test(suite, test_query_combine, NULL);
|
1864
1867
|
|
1865
|
-
frt_store_deref(store0);
|
1866
|
-
frt_store_deref(store1);
|
1867
1868
|
frt_searcher_close(searcher);
|
1869
|
+
frt_ir_close(ir0);
|
1870
|
+
frt_ir_close(ir1);
|
1871
|
+
frt_store_close(store0);
|
1872
|
+
frt_store_close(store1);
|
1868
1873
|
return suite;
|
1869
1874
|
}
|
@@ -54,6 +54,7 @@ static void test_si(TestCase *tc, void *data)
|
|
54
54
|
si->name[1] = '2';
|
55
55
|
si->doc_cnt += 2;
|
56
56
|
si->store = store;
|
57
|
+
FRT_REF(store);
|
57
58
|
Asi_has_vals(si, "_2", 12, store);
|
58
59
|
Assert(!frt_si_has_separate_norms(si), "doesn't use compound file/have norms");
|
59
60
|
si->use_compound_file = true;
|
@@ -65,8 +66,8 @@ static void test_si(TestCase *tc, void *data)
|
|
65
66
|
Assert(!frt_si_has_separate_norms(si), "has norms in compound file");
|
66
67
|
frt_si_advance_norm_gen(si, 3);
|
67
68
|
Assert(frt_si_has_separate_norms(si), "has seperate norms");
|
68
|
-
|
69
|
-
|
69
|
+
frt_si_close(si);
|
70
|
+
frt_store_close(store);
|
70
71
|
}
|
71
72
|
|
72
73
|
/***************************************************************************
|
@@ -163,6 +164,6 @@ TestSuite *ts_segments(TestSuite *suite)
|
|
163
164
|
tst_run_test(suite, test_sis_add_del, store);
|
164
165
|
tst_run_test(suite, test_sis_rw, store);
|
165
166
|
|
166
|
-
|
167
|
+
frt_store_close(store);
|
167
168
|
return suite;
|
168
169
|
}
|
@@ -292,6 +292,8 @@ TestSuite *ts_sort(TestSuite *suite)
|
|
292
292
|
{
|
293
293
|
FrtSearcher *sea, **searchers;
|
294
294
|
FrtStore *store = frt_open_ram_store(NULL), *fs_store;
|
295
|
+
FrtIndexReader *ir0;
|
296
|
+
FrtIndexReader *ir1;
|
295
297
|
|
296
298
|
search = rb_intern("search");
|
297
299
|
string = rb_intern("string");
|
@@ -305,11 +307,13 @@ TestSuite *ts_sort(TestSuite *suite)
|
|
305
307
|
tst_run_test(suite, test_sort_field_to_s, NULL);
|
306
308
|
tst_run_test(suite, test_sort_to_s, NULL);
|
307
309
|
|
308
|
-
|
310
|
+
ir0 = frt_ir_open(NULL, store);
|
311
|
+
sea = frt_isea_new(ir0);
|
309
312
|
|
310
313
|
tst_run_test(suite, test_sorts, (void *)sea);
|
311
314
|
|
312
315
|
frt_searcher_close(sea);
|
316
|
+
frt_ir_close(ir0);
|
313
317
|
|
314
318
|
do_byte_test = false;
|
315
319
|
|
@@ -321,16 +325,20 @@ TestSuite *ts_sort(TestSuite *suite)
|
|
321
325
|
sort_multi_test_setup(store, fs_store);
|
322
326
|
|
323
327
|
searchers = FRT_ALLOC_N(FrtSearcher *, 2);
|
324
|
-
|
325
|
-
|
326
|
-
searchers[
|
327
|
-
|
328
|
-
|
328
|
+
ir0 = frt_ir_open(NULL, store);
|
329
|
+
ir1 = frt_ir_open(NULL, fs_store);
|
330
|
+
searchers[0] = frt_isea_new(ir0);
|
331
|
+
searchers[1] = frt_isea_new(ir1);
|
332
|
+
FRT_DEREF(searchers[0]);
|
333
|
+
FRT_DEREF(searchers[1]);
|
334
|
+
sea = frt_msea_new(searchers, 2);
|
329
335
|
tst_run_test(suite, test_sorts, (void *)sea);
|
330
|
-
frt_searcher_close(sea);
|
331
336
|
|
332
|
-
|
333
|
-
|
337
|
+
frt_searcher_close(sea);
|
338
|
+
frt_ir_close(ir0);
|
339
|
+
frt_ir_close(ir1);
|
340
|
+
frt_store_close(store);
|
341
|
+
frt_store_close(fs_store);
|
334
342
|
|
335
343
|
return suite;
|
336
344
|
}
|
@@ -163,7 +163,9 @@ void test_segment_term_enum(TestCase *tc, void *data)
|
|
163
163
|
add_multi_field_terms(store);
|
164
164
|
|
165
165
|
sfi = frt_sfi_open(store, "_0");
|
166
|
-
|
166
|
+
FrtInStream *is = store->open_input(store, "_0.tis");
|
167
|
+
FRT_DEREF(is);
|
168
|
+
te = frt_ste_new(is, sfi);
|
167
169
|
te->set_field(te, 0);
|
168
170
|
for (i = 0; i < 40; i++) {
|
169
171
|
int doc_count = i % 20 + 1;
|
@@ -347,7 +349,7 @@ TestSuite *ts_term(TestSuite *suite)
|
|
347
349
|
tst_run_test(suite, test_segment_term_enum, store);
|
348
350
|
tst_run_test(suite, test_term_infos_reader, store);
|
349
351
|
|
350
|
-
|
352
|
+
frt_store_close(store);
|
351
353
|
|
352
354
|
return suite;
|
353
355
|
}
|
@@ -220,7 +220,7 @@ static void test_tv_single_doc(TestCase *tc, void *data)
|
|
220
220
|
|
221
221
|
frt_fr_close(fr);
|
222
222
|
frt_fis_deref(fis);
|
223
|
-
|
223
|
+
frt_store_close(store);
|
224
224
|
}
|
225
225
|
|
226
226
|
static void test_tv_multi_doc(TestCase *tc, void *data)
|
@@ -352,7 +352,7 @@ static void test_tv_multi_doc(TestCase *tc, void *data)
|
|
352
352
|
frt_h_destroy(tvs);
|
353
353
|
frt_fr_close(fr);
|
354
354
|
frt_fis_deref(fis);
|
355
|
-
|
355
|
+
frt_store_close(store);
|
356
356
|
}
|
357
357
|
|
358
358
|
|
@@ -170,18 +170,19 @@ TestSuite *ts_threading(TestSuite *suite)
|
|
170
170
|
|
171
171
|
suite = ADD_SUITE(suite);
|
172
172
|
|
173
|
-
|
173
|
+
frt_store_close(store);
|
174
174
|
frt_a_deref(a);
|
175
175
|
|
176
176
|
tst_run_test(suite, test_number_to_str, NULL);
|
177
|
-
|
178
|
-
tst_run_test(suite,
|
177
|
+
// with pthreads these won't work if frt_micro_sleep depends on ruby threads
|
178
|
+
//tst_run_test(suite, test_threading_test, index);
|
179
|
+
//tst_run_test(suite, test_threading, index);
|
179
180
|
|
180
181
|
frt_index_destroy(index);
|
181
182
|
|
182
183
|
store = frt_open_fs_store("./test/testdir/store");
|
183
184
|
store->clear_all(store);
|
184
|
-
|
185
|
+
frt_store_close(store);
|
185
186
|
|
186
187
|
return suite;
|
187
188
|
}
|
@@ -123,7 +123,10 @@ module Isomorfeus
|
|
123
123
|
@dir = RAMDirectory.new
|
124
124
|
end
|
125
125
|
|
126
|
-
|
126
|
+
unless @dir.kind_of? MonitorMixin
|
127
|
+
@dir.extend(MonitorMixin)
|
128
|
+
@dir.new_cond
|
129
|
+
end
|
127
130
|
options[:dir] = @dir
|
128
131
|
options[:lock_retry_time]||= 2
|
129
132
|
@options = options
|
@@ -796,7 +799,10 @@ module Isomorfeus
|
|
796
799
|
elsif directory.is_a?(Ferret::Store::Directory)
|
797
800
|
@dir = directory
|
798
801
|
end
|
799
|
-
|
802
|
+
unless @dir.kind_of? MonitorMixin
|
803
|
+
@dir.extend(MonitorMixin)
|
804
|
+
@dir.new_cond
|
805
|
+
end
|
800
806
|
@options[:dir] = @dir
|
801
807
|
@options[:create_if_missing] = true
|
802
808
|
add_indexes([old_dir])
|
@@ -967,4 +973,3 @@ module Isomorfeus
|
|
967
973
|
I = Index::Index
|
968
974
|
end
|
969
975
|
end
|
970
|
-
|
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.13.
|
4
|
+
version: 0.13.9
|
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-04
|
11
|
+
date: 2022-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|