isomorfeus-ferret 0.17.2 → 0.17.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/ext/isomorfeus_ferret_ext/benchmark.c +9 -20
  3. data/ext/isomorfeus_ferret_ext/benchmarks_all.h +1 -2
  4. data/ext/isomorfeus_ferret_ext/bm_hash.c +1 -2
  5. data/ext/isomorfeus_ferret_ext/brotli_dec_decode.c +4 -2
  6. data/ext/isomorfeus_ferret_ext/brotli_enc_encode.c +3 -2
  7. data/ext/isomorfeus_ferret_ext/frb_analysis.c +4 -5
  8. data/ext/isomorfeus_ferret_ext/frb_field_info.c +3 -4
  9. data/ext/isomorfeus_ferret_ext/frb_index.c +118 -125
  10. data/ext/isomorfeus_ferret_ext/frb_lazy_doc.c +14 -16
  11. data/ext/isomorfeus_ferret_ext/frb_search.c +31 -23
  12. data/ext/isomorfeus_ferret_ext/frb_store.c +27 -13
  13. data/ext/isomorfeus_ferret_ext/frb_utils.c +3 -6
  14. data/ext/isomorfeus_ferret_ext/frt_analysis.c +39 -46
  15. data/ext/isomorfeus_ferret_ext/frt_analysis.h +9 -9
  16. data/ext/isomorfeus_ferret_ext/frt_array.c +11 -22
  17. data/ext/isomorfeus_ferret_ext/frt_bitvector.h +3 -6
  18. data/ext/isomorfeus_ferret_ext/frt_doc_field.c +87 -0
  19. data/ext/isomorfeus_ferret_ext/frt_doc_field.h +26 -0
  20. data/ext/isomorfeus_ferret_ext/frt_document.c +4 -97
  21. data/ext/isomorfeus_ferret_ext/frt_document.h +2 -27
  22. data/ext/isomorfeus_ferret_ext/frt_except.c +8 -6
  23. data/ext/isomorfeus_ferret_ext/frt_except.h +1 -2
  24. data/ext/isomorfeus_ferret_ext/frt_field_index.c +13 -32
  25. data/ext/isomorfeus_ferret_ext/frt_field_index.h +0 -6
  26. data/ext/isomorfeus_ferret_ext/frt_field_info.c +69 -0
  27. data/ext/isomorfeus_ferret_ext/frt_field_info.h +49 -0
  28. data/ext/isomorfeus_ferret_ext/frt_field_infos.c +196 -0
  29. data/ext/isomorfeus_ferret_ext/frt_field_infos.h +35 -0
  30. data/ext/isomorfeus_ferret_ext/frt_global.c +10 -4
  31. data/ext/isomorfeus_ferret_ext/frt_global.h +11 -15
  32. data/ext/isomorfeus_ferret_ext/frt_hash.c +8 -8
  33. data/ext/isomorfeus_ferret_ext/frt_hash.h +1 -2
  34. data/ext/isomorfeus_ferret_ext/frt_hashset.c +20 -40
  35. data/ext/isomorfeus_ferret_ext/frt_hashset.h +1 -2
  36. data/ext/isomorfeus_ferret_ext/frt_helper.c +7 -15
  37. data/ext/isomorfeus_ferret_ext/frt_in_stream.c +35 -45
  38. data/ext/isomorfeus_ferret_ext/frt_in_stream.h +3 -2
  39. data/ext/isomorfeus_ferret_ext/frt_ind.c +20 -38
  40. data/ext/isomorfeus_ferret_ext/frt_index.c +292 -790
  41. data/ext/isomorfeus_ferret_ext/frt_index.h +1 -102
  42. data/ext/isomorfeus_ferret_ext/frt_lang.c +5 -10
  43. data/ext/isomorfeus_ferret_ext/frt_lazy_doc.c +3 -3
  44. data/ext/isomorfeus_ferret_ext/frt_lazy_doc.h +1 -1
  45. data/ext/isomorfeus_ferret_ext/frt_lazy_doc_field.c +18 -25
  46. data/ext/isomorfeus_ferret_ext/frt_lazy_doc_field.h +5 -5
  47. data/ext/isomorfeus_ferret_ext/frt_mdbx_store.c +102 -70
  48. data/ext/isomorfeus_ferret_ext/frt_mempool.c +8 -16
  49. data/ext/isomorfeus_ferret_ext/frt_multimapper.c +23 -46
  50. data/ext/isomorfeus_ferret_ext/frt_multimapper.h +4 -8
  51. data/ext/isomorfeus_ferret_ext/frt_out_stream.c +31 -43
  52. data/ext/isomorfeus_ferret_ext/frt_out_stream.h +2 -2
  53. data/ext/isomorfeus_ferret_ext/frt_posh.c +6 -819
  54. data/ext/isomorfeus_ferret_ext/frt_posh.h +0 -57
  55. data/ext/isomorfeus_ferret_ext/frt_priorityqueue.c +11 -22
  56. data/ext/isomorfeus_ferret_ext/frt_priorityqueue.h +1 -2
  57. data/ext/isomorfeus_ferret_ext/frt_q_boolean.c +85 -171
  58. data/ext/isomorfeus_ferret_ext/frt_q_match_all.c +8 -16
  59. data/ext/isomorfeus_ferret_ext/frt_q_multi_term.c +1 -2
  60. data/ext/isomorfeus_ferret_ext/frt_q_parser.c +49 -98
  61. data/ext/isomorfeus_ferret_ext/frt_q_phrase.c +52 -104
  62. data/ext/isomorfeus_ferret_ext/frt_q_range.c +6 -12
  63. data/ext/isomorfeus_ferret_ext/frt_q_span.c +113 -226
  64. data/ext/isomorfeus_ferret_ext/frt_q_wildcard.c +1 -2
  65. data/ext/isomorfeus_ferret_ext/frt_ram_store.c +134 -85
  66. data/ext/isomorfeus_ferret_ext/frt_search.c +82 -164
  67. data/ext/isomorfeus_ferret_ext/frt_similarity.c +11 -22
  68. data/ext/isomorfeus_ferret_ext/frt_similarity.h +1 -2
  69. data/ext/isomorfeus_ferret_ext/frt_store.c +13 -25
  70. data/ext/isomorfeus_ferret_ext/frt_store.h +86 -52
  71. data/ext/isomorfeus_ferret_ext/frt_term_vectors.c +8 -16
  72. data/ext/isomorfeus_ferret_ext/frt_win32.h +5 -10
  73. data/ext/isomorfeus_ferret_ext/isomorfeus_ferret.c +12 -11
  74. data/ext/isomorfeus_ferret_ext/isomorfeus_ferret.h +11 -13
  75. data/ext/isomorfeus_ferret_ext/lz4.c +422 -195
  76. data/ext/isomorfeus_ferret_ext/lz4.h +114 -46
  77. data/ext/isomorfeus_ferret_ext/lz4frame.c +421 -242
  78. data/ext/isomorfeus_ferret_ext/lz4frame.h +122 -53
  79. data/ext/isomorfeus_ferret_ext/lz4hc.c +127 -111
  80. data/ext/isomorfeus_ferret_ext/lz4hc.h +14 -14
  81. data/ext/isomorfeus_ferret_ext/lz4xxhash.h +1 -1
  82. data/ext/isomorfeus_ferret_ext/mdbx.c +3762 -2526
  83. data/ext/isomorfeus_ferret_ext/mdbx.h +115 -70
  84. data/ext/isomorfeus_ferret_ext/test.c +40 -87
  85. data/ext/isomorfeus_ferret_ext/test.h +3 -6
  86. data/ext/isomorfeus_ferret_ext/test_1710.c +11 -13
  87. data/ext/isomorfeus_ferret_ext/test_analysis.c +32 -64
  88. data/ext/isomorfeus_ferret_ext/test_array.c +6 -12
  89. data/ext/isomorfeus_ferret_ext/test_bitvector.c +12 -24
  90. data/ext/isomorfeus_ferret_ext/test_document.c +23 -33
  91. data/ext/isomorfeus_ferret_ext/test_except.c +10 -21
  92. data/ext/isomorfeus_ferret_ext/test_fields.c +62 -68
  93. data/ext/isomorfeus_ferret_ext/test_file_deleter.c +15 -23
  94. data/ext/isomorfeus_ferret_ext/test_filter.c +17 -27
  95. data/ext/isomorfeus_ferret_ext/test_global.c +14 -29
  96. data/ext/isomorfeus_ferret_ext/test_hash.c +19 -38
  97. data/ext/isomorfeus_ferret_ext/test_hashset.c +8 -16
  98. data/ext/isomorfeus_ferret_ext/test_helper.c +4 -8
  99. data/ext/isomorfeus_ferret_ext/test_highlighter.c +16 -28
  100. data/ext/isomorfeus_ferret_ext/test_index.c +277 -487
  101. data/ext/isomorfeus_ferret_ext/test_lang.c +7 -14
  102. data/ext/isomorfeus_ferret_ext/test_mdbx_store.c +2 -5
  103. data/ext/isomorfeus_ferret_ext/test_mempool.c +5 -10
  104. data/ext/isomorfeus_ferret_ext/test_multimapper.c +3 -6
  105. data/ext/isomorfeus_ferret_ext/test_priorityqueue.c +9 -18
  106. data/ext/isomorfeus_ferret_ext/test_q_const_score.c +4 -6
  107. data/ext/isomorfeus_ferret_ext/test_q_filtered.c +3 -4
  108. data/ext/isomorfeus_ferret_ext/test_q_fuzzy.c +9 -15
  109. data/ext/isomorfeus_ferret_ext/test_q_parser.c +8 -16
  110. data/ext/isomorfeus_ferret_ext/test_q_span.c +19 -35
  111. data/ext/isomorfeus_ferret_ext/test_ram_store.c +14 -13
  112. data/ext/isomorfeus_ferret_ext/test_search.c +60 -109
  113. data/ext/isomorfeus_ferret_ext/test_segments.c +8 -13
  114. data/ext/isomorfeus_ferret_ext/test_similarity.c +2 -4
  115. data/ext/isomorfeus_ferret_ext/test_sort.c +14 -24
  116. data/ext/isomorfeus_ferret_ext/test_store.c +96 -115
  117. data/ext/isomorfeus_ferret_ext/test_term.c +9 -15
  118. data/ext/isomorfeus_ferret_ext/test_term_vectors.c +9 -14
  119. data/ext/isomorfeus_ferret_ext/test_test.c +4 -8
  120. data/ext/isomorfeus_ferret_ext/test_threading.c +14 -20
  121. data/ext/isomorfeus_ferret_ext/testhelper.c +11 -21
  122. data/ext/isomorfeus_ferret_ext/testhelper.h +1 -1
  123. data/ext/isomorfeus_ferret_ext/tests_all.h +1 -2
  124. data/lib/isomorfeus/ferret/index/index.rb +1 -1
  125. data/lib/isomorfeus/ferret/version.rb +1 -1
  126. metadata +24 -4
@@ -5,8 +5,7 @@
5
5
  #define TERM_LEN 10
6
6
 
7
7
 
8
- static void test_posting(TestCase *tc, void *data)
9
- {
8
+ static void test_posting(TestCase *tc, void *data) {
10
9
  FrtMemoryPool *mp = (FrtMemoryPool *)data;
11
10
  FrtPostingList *pl;
12
11
  FrtPosting *p = frt_p_new(mp, 0, 10);
@@ -43,8 +42,7 @@ static FrtFieldInfos *create_tv_fis(void) {
43
42
  return fis;
44
43
  }
45
44
 
46
- static char **create_tv_terms(FrtMemoryPool *mp)
47
- {
45
+ static char **create_tv_terms(FrtMemoryPool *mp) {
48
46
  int i;
49
47
  char term_buf[10];
50
48
  char **terms = FRT_MP_ALLOC_N(mp, char *, NUM_TERMS);
@@ -55,8 +53,7 @@ static char **create_tv_terms(FrtMemoryPool *mp)
55
53
  return terms;
56
54
  }
57
55
 
58
- static FrtPostingList **create_tv_plists(FrtMemoryPool *mp, char **terms)
59
- {
56
+ static FrtPostingList **create_tv_plists(FrtMemoryPool *mp, char **terms) {
60
57
  int i, j;
61
58
  FrtPostingList **plists, *pl;
62
59
  plists = FRT_MP_ALLOC_N(mp, FrtPostingList *, NUM_TERMS);
@@ -70,8 +67,7 @@ static FrtPostingList **create_tv_plists(FrtMemoryPool *mp, char **terms)
70
67
  return plists;
71
68
  }
72
69
 
73
- static FrtOffset *create_tv_offsets(FrtMemoryPool *mp)
74
- {
70
+ static FrtOffset *create_tv_offsets(FrtMemoryPool *mp) {
75
71
  int i;
76
72
  FrtOffset *offsets = FRT_MP_ALLOC_N(mp, FrtOffset, NUM_TERMS);
77
73
  for (i = 0; i < NUM_TERMS; i++) {
@@ -81,10 +77,10 @@ static FrtOffset *create_tv_offsets(FrtMemoryPool *mp)
81
77
  return offsets;
82
78
  }
83
79
 
84
- static void test_tv_single_doc(TestCase *tc, void *data)
85
- {
80
+ static void test_tv_single_doc(TestCase *tc, void *data) {
86
81
  int i, j;
87
82
  FrtStore *store = frt_open_ram_store(NULL);
83
+ store->create_folder(store, segm_idx_name);
88
84
  FrtMemoryPool *mp = (FrtMemoryPool *)data;
89
85
  FrtFieldsReader *fr;
90
86
  FrtFieldsWriter *fw;
@@ -223,10 +219,10 @@ static void test_tv_single_doc(TestCase *tc, void *data)
223
219
  frt_store_close(store);
224
220
  }
225
221
 
226
- static void test_tv_multi_doc(TestCase *tc, void *data)
227
- {
222
+ static void test_tv_multi_doc(TestCase *tc, void *data) {
228
223
  int i, j;
229
224
  FrtStore *store = frt_open_ram_store(NULL);
225
+ store->create_folder(store, segm_idx_name);
230
226
  FrtMemoryPool *mp = (FrtMemoryPool *)data;
231
227
  FrtFieldsReader *fr;
232
228
  FrtFieldsWriter *fw;
@@ -356,8 +352,7 @@ static void test_tv_multi_doc(TestCase *tc, void *data)
356
352
  }
357
353
 
358
354
 
359
- TestSuite *ts_term_vectors(TestSuite *suite)
360
- {
355
+ TestSuite *ts_term_vectors(TestSuite *suite) {
361
356
  FrtMemoryPool *mp = frt_mp_new();
362
357
 
363
358
  suite = ADD_SUITE(suite);
@@ -8,8 +8,7 @@ static void raise_eof(void) {
8
8
  /**
9
9
  * Test the basic test functions
10
10
  */
11
- static void test_asserts(TestCase *tc, void *data)
12
- {
11
+ static void test_asserts(TestCase *tc, void *data) {
13
12
  char *p[10];
14
13
 
15
14
  int ia1[3] = { 1, 2, 3 };
@@ -33,8 +32,7 @@ static void test_asserts(TestCase *tc, void *data)
33
32
  Araise(FRT_EOF_ERROR, &raise_eof, NULL);
34
33
  }
35
34
 
36
- static void raise_nothing(void *nothing)
37
- {
35
+ static void raise_nothing(void *nothing) {
38
36
  (void)nothing;
39
37
  }
40
38
  /**
@@ -42,8 +40,7 @@ static void raise_nothing(void *nothing)
42
40
  * passing but if you want to check the tests work in case of failure, run
43
41
  * this test.
44
42
  */
45
- static void test_failures(TestCase *tc, void *data)
46
- {
43
+ static void test_failures(TestCase *tc, void *data) {
47
44
  void *q = NULL;
48
45
  void *p = frt_emalloc(10);
49
46
 
@@ -69,8 +66,7 @@ static void test_failures(TestCase *tc, void *data)
69
66
  Araise(EXCEPTION, &raise_nothing, NULL);
70
67
  }
71
68
 
72
- TestSuite *ts_test(TestSuite *suite)
73
- {
69
+ TestSuite *ts_test(TestSuite *suite) {
74
70
  suite = ADD_SUITE(suite);
75
71
 
76
72
  tst_run_test(suite, test_asserts, NULL);
@@ -9,8 +9,7 @@ extern char *num_to_str(int num);
9
9
 
10
10
  #define test_num(n, expected) num = num_to_str(n); Asequal(expected, num); free(num)
11
11
 
12
- static void test_number_to_str(TestCase *tc, void *data)
13
- {
12
+ static void test_number_to_str(TestCase *tc, void *data) {
14
13
  char *num;
15
14
  (void)data;
16
15
  test_num(0, "zero");
@@ -42,8 +41,7 @@ void dummy_log(const void *fmt, ...) {(void)fmt;}
42
41
  #define tlog dummy_log
43
42
  #endif
44
43
 
45
- static void do_delete_doc(FrtIndex *index)
46
- {
44
+ static void do_delete_doc(FrtIndex *index) {
47
45
  int size;
48
46
  if ((size = frt_index_size(index)) > 0) {
49
47
  int doc_num = rand() % size;
@@ -60,20 +58,18 @@ static void do_delete_doc(FrtIndex *index)
60
58
  ID id;
61
59
  ID contents;
62
60
 
63
- static void do_add_doc(FrtIndex *index)
64
- {
61
+ static void do_add_doc(FrtIndex *index) {
65
62
  FrtDocument *doc = frt_doc_new();
66
63
  int n = rand();
67
64
  rb_encoding *enc = rb_enc_find("ASCII-8BIT");
68
- frt_doc_add_field(doc, frt_df_add_data(frt_df_new(id), frt_strfmt("%d", n), enc))->destroy_data = true;
69
- frt_doc_add_field(doc, frt_df_add_data(frt_df_new(contents), num_to_str(n), enc))->destroy_data = true;
65
+ frt_doc_add_field(doc, frt_df_add_data(frt_df_new(id), frt_strfmt("%d", n), enc));
66
+ frt_doc_add_field(doc, frt_df_add_data(frt_df_new(contents), num_to_str(n), enc));
70
67
  tlog("Adding %d\n", n);
71
68
  frt_index_add_doc(index, doc);
72
69
  frt_doc_destroy(doc);
73
70
  }
74
71
 
75
- static void do_search(FrtIndex *index)
76
- {
72
+ static void do_search(FrtIndex *index) {
77
73
  int n = rand(), i;
78
74
  char *query = num_to_str(n);
79
75
  FrtTopDocs *td;
@@ -96,8 +92,7 @@ static void do_search(FrtIndex *index)
96
92
  frt_td_destroy(td);
97
93
  }
98
94
 
99
- static void *indexing_thread(void *p)
100
- {
95
+ static void *indexing_thread(void *p) {
101
96
  int i, choice;
102
97
  FrtIndex *index = (FrtIndex *)p;
103
98
 
@@ -115,16 +110,14 @@ static void *indexing_thread(void *p)
115
110
  return NULL;
116
111
  }
117
112
 
118
- static void test_threading_test(TestCase *tc, void *data)
119
- {
113
+ static void test_threading_test(TestCase *tc, void *data) {
120
114
  FrtIndex *index = (FrtIndex *)data;
121
115
  (void)data;
122
116
  (void)tc;
123
117
  indexing_thread(index);
124
118
  }
125
119
 
126
- static void test_threading(TestCase *tc, void *data)
127
- {
120
+ static void test_threading(TestCase *tc, void *data) {
128
121
  int i;
129
122
  pthread_t thread_id[NTHREADS];
130
123
  FrtIndex *index = (FrtIndex *)data;
@@ -140,13 +133,13 @@ static void test_threading(TestCase *tc, void *data)
140
133
  }
141
134
  }
142
135
 
143
- TestSuite *ts_threading(TestSuite *suite)
144
- {
136
+ TestSuite *ts_threading(TestSuite *suite) {
145
137
  id = rb_intern("id");
146
138
  contents = rb_intern("contents");
147
139
 
148
140
  FrtAnalyzer *a = frt_letter_analyzer_new(true);
149
141
  FrtStore *store = frt_open_mdbx_store("./test/testdir/store");
142
+ store->create_folder(store, segm_idx_name);
150
143
  FrtIndex *index;
151
144
  FrtHashSet *def_fields = frt_hs_new_ptr(NULL);
152
145
  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);
@@ -155,7 +148,7 @@ TestSuite *ts_threading(TestSuite *suite)
155
148
  frt_fis_deref(fis);
156
149
 
157
150
  frt_hs_add(def_fields, (void *)contents);
158
- store->clear_all(store);
151
+ store->clear_all(store, segm_idx_name);
159
152
  index = frt_index_new(store, a, def_fields, true);
160
153
  frt_hs_destroy(def_fields);
161
154
 
@@ -172,7 +165,8 @@ TestSuite *ts_threading(TestSuite *suite)
172
165
  frt_index_destroy(index);
173
166
 
174
167
  store = frt_open_mdbx_store("./test/testdir/store");
175
- store->clear_all(store);
168
+ store->create_folder(store, segm_idx_name);
169
+ store->clear_all(store, segm_idx_name);
176
170
  frt_store_close(store);
177
171
 
178
172
  return suite;
@@ -354,8 +354,7 @@ const char *test_word_list[] = {
354
354
  "hippos", "dam's", "expressionists", "peewee", "troop's", NULL
355
355
  };
356
356
 
357
- char *make_random_string(char *buf, int max_words)
358
- {
357
+ char *make_random_string(char *buf, int max_words) {
359
358
  char *s = buf;
360
359
  int num_words = 5 + rand() % (max_words - 5);
361
360
 
@@ -366,9 +365,8 @@ char *make_random_string(char *buf, int max_words)
366
365
  return buf;
367
366
  }
368
367
 
369
- char *get_nth_word(char *words, char *buf, int n, int *start, int *end)
370
- {
371
- char *s = words, *e;
368
+ char *get_nth_word(const char *words, char *buf, int n, int *start, int *end) {
369
+ const char *s = words, *e;
372
370
  int len;
373
371
  while (n > 0) {
374
372
  while (*s && *s != ' ') {
@@ -395,8 +393,7 @@ char *get_nth_word(char *words, char *buf, int n, int *start, int *end)
395
393
  return buf;
396
394
  }
397
395
 
398
- int nth_word_eql(char *words, char *word, int n)
399
- {
396
+ int nth_word_eql(char *words, char *word, int n) {
400
397
  char *s = words;
401
398
  while (n > 0) {
402
399
  while (*s && *s != ' ') {
@@ -407,18 +404,15 @@ int nth_word_eql(char *words, char *word, int n)
407
404
  if (*s) {
408
405
  if (strncmp(s, word, strlen(word)) == 0) {
409
406
  return 1;
410
- }
411
- else {
407
+ } else {
412
408
  return 0;
413
409
  }
414
- }
415
- else {
410
+ } else {
416
411
  return 0;
417
412
  }
418
413
  }
419
414
 
420
- int s2l(const char *str, int *arr)
421
- {
415
+ int s2l(const char *str, int *arr) {
422
416
  int i = 0;
423
417
  int num = 0;
424
418
  const char *p = str;
@@ -438,8 +432,7 @@ int s2l(const char *str, int *arr)
438
432
  return i;
439
433
  }
440
434
 
441
- bool frt_ary_includes(int *array, int size, int val)
442
- {
435
+ bool frt_ary_includes(int *array, int size, int val) {
443
436
  bool found = false;
444
437
  int i;
445
438
  for (i = 0; i < size; i++) {
@@ -503,8 +496,7 @@ static const char *GROUPS[] = {
503
496
 
504
497
  static const int K = 1000;
505
498
 
506
- static char *under_1000(int val)
507
- {
499
+ static char *under_1000(int val) {
508
500
  const char *hundreds = (val >= 100) ? DIGITS[val/100] : "";
509
501
  const char *_and = "";
510
502
  const char *tens = "";
@@ -522,8 +514,7 @@ static char *under_1000(int val)
522
514
  return frt_strfmt("%s%s%s%s", hundreds, _and, tens, digits);
523
515
  }
524
516
 
525
- static char *group(int val, int level)
526
- {
517
+ static char *group(int val, int level) {
527
518
  char *res;
528
519
  if (val >= K) {
529
520
  char *above = group(val/K, level+1);
@@ -538,8 +529,7 @@ static char *group(int val, int level)
538
529
  return res;
539
530
  }
540
531
 
541
- char *num_to_str(int num)
542
- {
532
+ char *num_to_str(int num) {
543
533
  char *res;
544
534
  if (num < 0) {
545
535
  char *neg;
@@ -15,7 +15,7 @@
15
15
  extern const char *test_word_list[];
16
16
 
17
17
  extern char *make_random_string(char *buf, int num_words);
18
- extern char *get_nth_word(char *words, char *buf, int n, int *s, int *e);
18
+ extern char *get_nth_word(const char *words, char *buf, int n, int *s, int *e);
19
19
  extern int nth_word_eql(char *words, char *word, int n);
20
20
  extern int s2l(const char *str, int *arr);
21
21
  extern bool frt_ary_includes(int *array, int size, int val);
@@ -40,8 +40,7 @@ TestSuite *ts_term_vectors(TestSuite *suite);
40
40
  TestSuite *ts_test(TestSuite *suite);
41
41
  TestSuite *ts_threading(TestSuite *suite);
42
42
 
43
- const struct test_list
44
- {
43
+ const struct test_list {
45
44
  TestSuite *(*func)(TestSuite *suite);
46
45
  } all_tests[] = {
47
46
  {ts_1710},
@@ -130,7 +130,7 @@ module Isomorfeus
130
130
  options[:dir] = @dir
131
131
  options[:lock_retry_time]||= 2
132
132
  @options = options
133
- if (!@dir.exists?("segments")) || options[:create]
133
+ if (!@dir.exist?("segments")) || options[:create]
134
134
  IndexWriter.new(options).close
135
135
  end
136
136
  options[:analyzer]||= Ferret::Analysis::StandardAnalyzer.new
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  module Ferret
3
- VERSION = '0.17.2'
3
+ VERSION = '0.17.3'
4
4
  end
5
5
  end
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.17.2
4
+ version: 0.17.3
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-12-06 00:00:00.000000000 Z
11
+ date: 2023-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.13.23
27
+ - !ruby/object:Gem::Dependency
28
+ name: msgpack
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.6.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.6.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -194,12 +208,18 @@ files:
194
208
  - ext/isomorfeus_ferret_ext/frt_bitvector.c
195
209
  - ext/isomorfeus_ferret_ext/frt_bitvector.h
196
210
  - ext/isomorfeus_ferret_ext/frt_config.h
211
+ - ext/isomorfeus_ferret_ext/frt_doc_field.c
212
+ - ext/isomorfeus_ferret_ext/frt_doc_field.h
197
213
  - ext/isomorfeus_ferret_ext/frt_document.c
198
214
  - ext/isomorfeus_ferret_ext/frt_document.h
199
215
  - ext/isomorfeus_ferret_ext/frt_except.c
200
216
  - ext/isomorfeus_ferret_ext/frt_except.h
201
217
  - ext/isomorfeus_ferret_ext/frt_field_index.c
202
218
  - ext/isomorfeus_ferret_ext/frt_field_index.h
219
+ - ext/isomorfeus_ferret_ext/frt_field_info.c
220
+ - ext/isomorfeus_ferret_ext/frt_field_info.h
221
+ - ext/isomorfeus_ferret_ext/frt_field_infos.c
222
+ - ext/isomorfeus_ferret_ext/frt_field_infos.h
203
223
  - ext/isomorfeus_ferret_ext/frt_filter.c
204
224
  - ext/isomorfeus_ferret_ext/frt_global.c
205
225
  - ext/isomorfeus_ferret_ext/frt_global.h
@@ -393,7 +413,7 @@ metadata:
393
413
  source_code_uri: https://github.com/isomorfeus/isomorfeus-ferret
394
414
  post_install_message: |2+
395
415
 
396
- isomorfeus-ferret 0.17.2:
416
+ isomorfeus-ferret 0.17.3:
397
417
 
398
418
  Development in progress:
399
419
  - It may eat all your files, when hungry!
@@ -414,7 +434,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
414
434
  - !ruby/object:Gem::Version
415
435
  version: '0'
416
436
  requirements: []
417
- rubygems_version: 3.4.0.dev
437
+ rubygems_version: 3.4.1
418
438
  signing_key:
419
439
  specification_version: 4
420
440
  summary: Indexed document store for Isomorfeus.