isomorfeus-ferret 0.17.2 → 0.17.3
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/benchmark.c +9 -20
- data/ext/isomorfeus_ferret_ext/benchmarks_all.h +1 -2
- data/ext/isomorfeus_ferret_ext/bm_hash.c +1 -2
- data/ext/isomorfeus_ferret_ext/brotli_dec_decode.c +4 -2
- data/ext/isomorfeus_ferret_ext/brotli_enc_encode.c +3 -2
- data/ext/isomorfeus_ferret_ext/frb_analysis.c +4 -5
- data/ext/isomorfeus_ferret_ext/frb_field_info.c +3 -4
- data/ext/isomorfeus_ferret_ext/frb_index.c +118 -125
- data/ext/isomorfeus_ferret_ext/frb_lazy_doc.c +14 -16
- data/ext/isomorfeus_ferret_ext/frb_search.c +31 -23
- data/ext/isomorfeus_ferret_ext/frb_store.c +27 -13
- data/ext/isomorfeus_ferret_ext/frb_utils.c +3 -6
- data/ext/isomorfeus_ferret_ext/frt_analysis.c +39 -46
- data/ext/isomorfeus_ferret_ext/frt_analysis.h +9 -9
- data/ext/isomorfeus_ferret_ext/frt_array.c +11 -22
- data/ext/isomorfeus_ferret_ext/frt_bitvector.h +3 -6
- data/ext/isomorfeus_ferret_ext/frt_doc_field.c +87 -0
- data/ext/isomorfeus_ferret_ext/frt_doc_field.h +26 -0
- data/ext/isomorfeus_ferret_ext/frt_document.c +4 -97
- data/ext/isomorfeus_ferret_ext/frt_document.h +2 -27
- data/ext/isomorfeus_ferret_ext/frt_except.c +8 -6
- data/ext/isomorfeus_ferret_ext/frt_except.h +1 -2
- data/ext/isomorfeus_ferret_ext/frt_field_index.c +13 -32
- data/ext/isomorfeus_ferret_ext/frt_field_index.h +0 -6
- data/ext/isomorfeus_ferret_ext/frt_field_info.c +69 -0
- data/ext/isomorfeus_ferret_ext/frt_field_info.h +49 -0
- data/ext/isomorfeus_ferret_ext/frt_field_infos.c +196 -0
- data/ext/isomorfeus_ferret_ext/frt_field_infos.h +35 -0
- data/ext/isomorfeus_ferret_ext/frt_global.c +10 -4
- data/ext/isomorfeus_ferret_ext/frt_global.h +11 -15
- data/ext/isomorfeus_ferret_ext/frt_hash.c +8 -8
- data/ext/isomorfeus_ferret_ext/frt_hash.h +1 -2
- data/ext/isomorfeus_ferret_ext/frt_hashset.c +20 -40
- data/ext/isomorfeus_ferret_ext/frt_hashset.h +1 -2
- data/ext/isomorfeus_ferret_ext/frt_helper.c +7 -15
- data/ext/isomorfeus_ferret_ext/frt_in_stream.c +35 -45
- data/ext/isomorfeus_ferret_ext/frt_in_stream.h +3 -2
- data/ext/isomorfeus_ferret_ext/frt_ind.c +20 -38
- data/ext/isomorfeus_ferret_ext/frt_index.c +292 -790
- data/ext/isomorfeus_ferret_ext/frt_index.h +1 -102
- data/ext/isomorfeus_ferret_ext/frt_lang.c +5 -10
- data/ext/isomorfeus_ferret_ext/frt_lazy_doc.c +3 -3
- data/ext/isomorfeus_ferret_ext/frt_lazy_doc.h +1 -1
- data/ext/isomorfeus_ferret_ext/frt_lazy_doc_field.c +18 -25
- data/ext/isomorfeus_ferret_ext/frt_lazy_doc_field.h +5 -5
- data/ext/isomorfeus_ferret_ext/frt_mdbx_store.c +102 -70
- data/ext/isomorfeus_ferret_ext/frt_mempool.c +8 -16
- data/ext/isomorfeus_ferret_ext/frt_multimapper.c +23 -46
- data/ext/isomorfeus_ferret_ext/frt_multimapper.h +4 -8
- data/ext/isomorfeus_ferret_ext/frt_out_stream.c +31 -43
- data/ext/isomorfeus_ferret_ext/frt_out_stream.h +2 -2
- data/ext/isomorfeus_ferret_ext/frt_posh.c +6 -819
- data/ext/isomorfeus_ferret_ext/frt_posh.h +0 -57
- data/ext/isomorfeus_ferret_ext/frt_priorityqueue.c +11 -22
- data/ext/isomorfeus_ferret_ext/frt_priorityqueue.h +1 -2
- data/ext/isomorfeus_ferret_ext/frt_q_boolean.c +85 -171
- data/ext/isomorfeus_ferret_ext/frt_q_match_all.c +8 -16
- data/ext/isomorfeus_ferret_ext/frt_q_multi_term.c +1 -2
- data/ext/isomorfeus_ferret_ext/frt_q_parser.c +49 -98
- data/ext/isomorfeus_ferret_ext/frt_q_phrase.c +52 -104
- data/ext/isomorfeus_ferret_ext/frt_q_range.c +6 -12
- data/ext/isomorfeus_ferret_ext/frt_q_span.c +113 -226
- data/ext/isomorfeus_ferret_ext/frt_q_wildcard.c +1 -2
- data/ext/isomorfeus_ferret_ext/frt_ram_store.c +134 -85
- data/ext/isomorfeus_ferret_ext/frt_search.c +82 -164
- data/ext/isomorfeus_ferret_ext/frt_similarity.c +11 -22
- data/ext/isomorfeus_ferret_ext/frt_similarity.h +1 -2
- data/ext/isomorfeus_ferret_ext/frt_store.c +13 -25
- data/ext/isomorfeus_ferret_ext/frt_store.h +86 -52
- data/ext/isomorfeus_ferret_ext/frt_term_vectors.c +8 -16
- data/ext/isomorfeus_ferret_ext/frt_win32.h +5 -10
- data/ext/isomorfeus_ferret_ext/isomorfeus_ferret.c +12 -11
- data/ext/isomorfeus_ferret_ext/isomorfeus_ferret.h +11 -13
- data/ext/isomorfeus_ferret_ext/lz4.c +422 -195
- data/ext/isomorfeus_ferret_ext/lz4.h +114 -46
- data/ext/isomorfeus_ferret_ext/lz4frame.c +421 -242
- data/ext/isomorfeus_ferret_ext/lz4frame.h +122 -53
- data/ext/isomorfeus_ferret_ext/lz4hc.c +127 -111
- data/ext/isomorfeus_ferret_ext/lz4hc.h +14 -14
- data/ext/isomorfeus_ferret_ext/lz4xxhash.h +1 -1
- data/ext/isomorfeus_ferret_ext/mdbx.c +3762 -2526
- data/ext/isomorfeus_ferret_ext/mdbx.h +115 -70
- data/ext/isomorfeus_ferret_ext/test.c +40 -87
- data/ext/isomorfeus_ferret_ext/test.h +3 -6
- data/ext/isomorfeus_ferret_ext/test_1710.c +11 -13
- data/ext/isomorfeus_ferret_ext/test_analysis.c +32 -64
- data/ext/isomorfeus_ferret_ext/test_array.c +6 -12
- data/ext/isomorfeus_ferret_ext/test_bitvector.c +12 -24
- data/ext/isomorfeus_ferret_ext/test_document.c +23 -33
- data/ext/isomorfeus_ferret_ext/test_except.c +10 -21
- data/ext/isomorfeus_ferret_ext/test_fields.c +62 -68
- data/ext/isomorfeus_ferret_ext/test_file_deleter.c +15 -23
- data/ext/isomorfeus_ferret_ext/test_filter.c +17 -27
- data/ext/isomorfeus_ferret_ext/test_global.c +14 -29
- data/ext/isomorfeus_ferret_ext/test_hash.c +19 -38
- data/ext/isomorfeus_ferret_ext/test_hashset.c +8 -16
- data/ext/isomorfeus_ferret_ext/test_helper.c +4 -8
- data/ext/isomorfeus_ferret_ext/test_highlighter.c +16 -28
- data/ext/isomorfeus_ferret_ext/test_index.c +277 -487
- data/ext/isomorfeus_ferret_ext/test_lang.c +7 -14
- data/ext/isomorfeus_ferret_ext/test_mdbx_store.c +2 -5
- data/ext/isomorfeus_ferret_ext/test_mempool.c +5 -10
- data/ext/isomorfeus_ferret_ext/test_multimapper.c +3 -6
- data/ext/isomorfeus_ferret_ext/test_priorityqueue.c +9 -18
- data/ext/isomorfeus_ferret_ext/test_q_const_score.c +4 -6
- data/ext/isomorfeus_ferret_ext/test_q_filtered.c +3 -4
- data/ext/isomorfeus_ferret_ext/test_q_fuzzy.c +9 -15
- data/ext/isomorfeus_ferret_ext/test_q_parser.c +8 -16
- data/ext/isomorfeus_ferret_ext/test_q_span.c +19 -35
- data/ext/isomorfeus_ferret_ext/test_ram_store.c +14 -13
- data/ext/isomorfeus_ferret_ext/test_search.c +60 -109
- data/ext/isomorfeus_ferret_ext/test_segments.c +8 -13
- data/ext/isomorfeus_ferret_ext/test_similarity.c +2 -4
- data/ext/isomorfeus_ferret_ext/test_sort.c +14 -24
- data/ext/isomorfeus_ferret_ext/test_store.c +96 -115
- data/ext/isomorfeus_ferret_ext/test_term.c +9 -15
- data/ext/isomorfeus_ferret_ext/test_term_vectors.c +9 -14
- data/ext/isomorfeus_ferret_ext/test_test.c +4 -8
- data/ext/isomorfeus_ferret_ext/test_threading.c +14 -20
- data/ext/isomorfeus_ferret_ext/testhelper.c +11 -21
- data/ext/isomorfeus_ferret_ext/testhelper.h +1 -1
- data/ext/isomorfeus_ferret_ext/tests_all.h +1 -2
- data/lib/isomorfeus/ferret/index/index.rb +1 -1
- data/lib/isomorfeus/ferret/version.rb +1 -1
- 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;
|