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
@@ -851,31 +851,6 @@ POSH_COMPILE_TIME_ASSERT(posh_i32_t, sizeof(posh_i32_t) == 4);
851
851
  ** ----------------------------------------------------------------------------
852
852
  */
853
853
 
854
- const char *POSH_GetArchString( void );
855
-
856
- #if !defined POSH_NO_FLOAT
857
-
858
- posh_u32_t POSH_LittleFloatBits( float f );
859
- posh_u32_t POSH_BigFloatBits( float f );
860
- float POSH_FloatFromLittleBits( posh_u32_t bits );
861
- float POSH_FloatFromBigBits( posh_u32_t bits );
862
-
863
- void POSH_DoubleBits( double d, posh_byte_t dst[ 8 ] );
864
- double POSH_DoubleFromBits( const posh_byte_t src[ 8 ] );
865
-
866
- /* unimplemented
867
- float *POSH_WriteFloatToLittle( void *dst, float f );
868
- float *POSH_WriteFloatToBig( void *dst, float f );
869
- float POSH_ReadFloatFromLittle( const void *src );
870
- float POSH_ReadFloatFromBig( const void *src );
871
-
872
- double *POSH_WriteDoubleToLittle( void *dst, double d );
873
- double *POSH_WriteDoubleToBig( void *dst, double d );
874
- double POSH_ReadDoubleFromLittle( const void *src );
875
- double POSH_ReadDoubleFromBig( const void *src );
876
- */
877
- #endif /* !defined POSH_NO_FLOAT */
878
-
879
854
  extern posh_u16_t POSH_SwapU16( posh_u16_t u );
880
855
  extern posh_i16_t POSH_SwapI16( posh_i16_t u );
881
856
  extern posh_u32_t POSH_SwapU32( posh_u32_t u );
@@ -888,38 +863,6 @@ extern posh_i64_t POSH_SwapI64( posh_i64_t u );
888
863
 
889
864
  #endif /*POSH_64BIT_INTEGER */
890
865
 
891
- extern posh_u16_t *POSH_WriteU16ToLittle( void *dst, posh_u16_t value );
892
- extern posh_i16_t *POSH_WriteI16ToLittle( void *dst, posh_i16_t value );
893
- extern posh_u32_t *POSH_WriteU32ToLittle( void *dst, posh_u32_t value );
894
- extern posh_i32_t *POSH_WriteI32ToLittle( void *dst, posh_i32_t value );
895
-
896
- extern posh_u16_t *POSH_WriteU16ToBig( void *dst, posh_u16_t value );
897
- extern posh_i16_t *POSH_WriteI16ToBig( void *dst, posh_i16_t value );
898
- extern posh_u32_t *POSH_WriteU32ToBig( void *dst, posh_u32_t value );
899
- extern posh_i32_t *POSH_WriteI32ToBig( void *dst, posh_i32_t value );
900
-
901
- extern posh_u16_t POSH_ReadU16FromLittle( const void *src );
902
- extern posh_i16_t POSH_ReadI16FromLittle( const void *src );
903
- extern posh_u32_t POSH_ReadU32FromLittle( const void *src );
904
- extern posh_i32_t POSH_ReadI32FromLittle( const void *src );
905
-
906
- extern posh_u16_t POSH_ReadU16FromBig( const void *src );
907
- extern posh_i16_t POSH_ReadI16FromBig( const void *src );
908
- extern posh_u32_t POSH_ReadU32FromBig( const void *src );
909
- extern posh_i32_t POSH_ReadI32FromBig( const void *src );
910
-
911
- #if defined POSH_64BIT_INTEGER
912
- extern posh_u64_t *POSH_WriteU64ToLittle( void *dst, posh_u64_t value );
913
- extern posh_i64_t *POSH_WriteI64ToLittle( void *dst, posh_i64_t value );
914
- extern posh_u64_t *POSH_WriteU64ToBig( void *dst, posh_u64_t value );
915
- extern posh_i64_t *POSH_WriteI64ToBig( void *dst, posh_i64_t value );
916
-
917
- extern posh_u64_t POSH_ReadU64FromLittle( const void *src );
918
- extern posh_i64_t POSH_ReadI64FromLittle( const void *src );
919
- extern posh_u64_t POSH_ReadU64FromBig( const void *src );
920
- extern posh_i64_t POSH_ReadI64FromBig( const void *src );
921
- #endif /* POSH_64BIT_INTEGER */
922
-
923
866
  #if defined POSH_LITTLE_ENDIAN
924
867
 
925
868
  # define POSH_LittleU16(x) (x)
@@ -3,8 +3,7 @@
3
3
 
4
4
  #define START_CAPA 127
5
5
 
6
- FrtPriorityQueue *frt_pq_new(int capa, frt_lt_ft less_than, frt_free_ft free_elem)
7
- {
6
+ FrtPriorityQueue *frt_pq_new(int capa, frt_lt_ft less_than, frt_free_ft free_elem) {
8
7
  FrtPriorityQueue *pq = FRT_ALLOC(FrtPriorityQueue);
9
8
  pq->size = 0;
10
9
  pq->capa = capa;
@@ -18,8 +17,7 @@ FrtPriorityQueue *frt_pq_new(int capa, frt_lt_ft less_than, frt_free_ft free_ele
18
17
  return pq;
19
18
  }
20
19
 
21
- FrtPriorityQueue *frt_pq_clone(FrtPriorityQueue *pq)
22
- {
20
+ FrtPriorityQueue *frt_pq_clone(FrtPriorityQueue *pq) {
23
21
  FrtPriorityQueue *new_pq = FRT_ALLOC(FrtPriorityQueue);
24
22
  memcpy(new_pq, pq, sizeof(FrtPriorityQueue));
25
23
  new_pq->heap = FRT_ALLOC_N(void *, new_pq->mem_capa);
@@ -28,8 +26,7 @@ FrtPriorityQueue *frt_pq_clone(FrtPriorityQueue *pq)
28
26
  return new_pq;
29
27
  }
30
28
 
31
- void frt_pq_clear(FrtPriorityQueue *pq)
32
- {
29
+ void frt_pq_clear(FrtPriorityQueue *pq) {
33
30
  int i;
34
31
  for (i = 1; i <= pq->size; i++) {
35
32
  pq->free_elem_i(pq->heap[i]);
@@ -38,14 +35,12 @@ void frt_pq_clear(FrtPriorityQueue *pq)
38
35
  pq->size = 0;
39
36
  }
40
37
 
41
- void frt_pq_free(FrtPriorityQueue *pq)
42
- {
38
+ void frt_pq_free(FrtPriorityQueue *pq) {
43
39
  free(pq->heap);
44
40
  free(pq);
45
41
  }
46
42
 
47
- void frt_pq_destroy(FrtPriorityQueue *pq)
48
- {
43
+ void frt_pq_destroy(FrtPriorityQueue *pq) {
49
44
  frt_pq_clear(pq);
50
45
  frt_pq_free(pq);
51
46
  }
@@ -57,8 +52,7 @@ void frt_pq_destroy(FrtPriorityQueue *pq)
57
52
  *
58
53
  * @param pq the PriorityQueue to reorder
59
54
  */
60
- static void frt_pq_up(FrtPriorityQueue *pq)
61
- {
55
+ static void frt_pq_up(FrtPriorityQueue *pq) {
62
56
  void **heap = pq->heap;
63
57
  void *node;
64
58
  int i = pq->size;
@@ -74,8 +68,7 @@ static void frt_pq_up(FrtPriorityQueue *pq)
74
68
  heap[i] = node;
75
69
  }
76
70
 
77
- void frt_pq_down(FrtPriorityQueue *pq)
78
- {
71
+ void frt_pq_down(FrtPriorityQueue *pq) {
79
72
  register int i = 1;
80
73
  register int j = 2; /* i << 1; */
81
74
  register int k = 3; /* j + 1; */
@@ -99,8 +92,7 @@ void frt_pq_down(FrtPriorityQueue *pq)
99
92
  heap[i] = node;
100
93
  }
101
94
 
102
- void frt_pq_push(FrtPriorityQueue *pq, void *elem)
103
- {
95
+ void frt_pq_push(FrtPriorityQueue *pq, void *elem) {
104
96
  pq->size++;
105
97
  if (pq->size >= pq->mem_capa) {
106
98
  pq->mem_capa <<= 1;
@@ -110,8 +102,7 @@ void frt_pq_push(FrtPriorityQueue *pq, void *elem)
110
102
  frt_pq_up(pq);
111
103
  }
112
104
 
113
- FrtPriorityQueueInsertEnum frt_pq_insert(FrtPriorityQueue *pq, void *elem)
114
- {
105
+ FrtPriorityQueueInsertEnum frt_pq_insert(FrtPriorityQueue *pq, void *elem) {
115
106
  if (pq->size < pq->capa) {
116
107
  frt_pq_push(pq, elem);
117
108
  return FRT_PQ_ADDED;
@@ -128,13 +119,11 @@ FrtPriorityQueueInsertEnum frt_pq_insert(FrtPriorityQueue *pq, void *elem)
128
119
  return FRT_PQ_DROPPED;
129
120
  }
130
121
 
131
- void *frt_pq_top(FrtPriorityQueue *pq)
132
- {
122
+ void *frt_pq_top(FrtPriorityQueue *pq) {
133
123
  return pq->size ? pq->heap[1] : NULL;
134
124
  }
135
125
 
136
- void *frt_pq_pop(FrtPriorityQueue *pq)
137
- {
126
+ void *frt_pq_pop(FrtPriorityQueue *pq) {
138
127
  if (pq->size > 0) {
139
128
  void *result = pq->heap[1]; /* save first value */
140
129
  pq->heap[1] = pq->heap[pq->size]; /* move last to first */
@@ -9,8 +9,7 @@ typedef bool (*frt_lt_ft)(const void *p1, const void *p2);
9
9
  * A PriorityQueue has a fixed size and contains a less_than function and a
10
10
  * free_elem function specific to the data type to be stored in the queue.
11
11
  */
12
- typedef struct FrtPriorityQueue
13
- {
12
+ typedef struct FrtPriorityQueue {
14
13
  int size;
15
14
  int capa;
16
15
  int mem_capa;