-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbindings.h
120 lines (92 loc) · 5.25 KB
/
bindings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#include "binding_typedefs.h"
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#define DOCUMENT_BUDGET_BYTES 50000000
typedef struct Document Document;
typedef struct SearchResult SearchResult;
typedef struct TantivyContext TantivyContext;
SchemaBuilder *schema_builder_new(void);
void schema_builder_add_text_field(SchemaBuilder *builder_ptr,
const char *field_name_ptr,
bool stored,
bool is_text,
bool is_fast,
uintptr_t index_record_option_const,
const char *tokenizer_name_ptr,
char **error_buffer);
Schema *schema_builder_build(SchemaBuilder *builder_ptr, char **error_buffer);
struct TantivyContext *context_create_with_schema(const char *path_ptr,
Schema *schema_ptr,
char **error_buffer);
void context_register_text_analyzer_ngram(struct TantivyContext *context_ptr,
const char *tokenizer_name_ptr,
uintptr_t min_gram,
uintptr_t max_gram,
bool prefix_only,
char **error_buffer);
void context_register_text_analyzer_edge_ngram(struct TantivyContext *context_ptr,
const char *tokenizer_name_ptr,
uintptr_t min_gram,
uintptr_t max_gram,
uintptr_t limit,
char **error_buffer);
void context_register_text_analyzer_simple(struct TantivyContext *context_ptr,
const char *tokenizer_name_ptr,
uintptr_t text_limit,
const char *lang_str_ptr,
char **error_buffer);
void context_register_jieba_tokenizer(struct TantivyContext *context_ptr,
const char *tokenizer_name_ptr,
uintptr_t text_limit,
char **error_buffer);
void context_register_text_analyzer_raw(struct TantivyContext *context_ptr,
const char *tokenizer_name_ptr,
char **error_buffer);
void context_add_and_consume_documents(struct TantivyContext *context_ptr,
struct Document **docs_ptr,
uintptr_t docs_len,
char **error_buffer);
void context_delete_documents(struct TantivyContext *context_ptr,
const char *field_name_ptr,
const char **delete_ids_ptr,
uintptr_t delete_ids_len,
char **error_buffer);
uint64_t context_num_docs(struct TantivyContext *context_ptr, char **error_buffer);
struct SearchResult *context_search(struct TantivyContext *context_ptr,
const char **field_names_ptr,
float *field_weights_ptr,
uintptr_t field_names_len,
const char *query_ptr,
char **error_buffer,
uintptr_t docs_limit,
bool with_highlights);
struct SearchResult *context_search_json(struct TantivyContext *context_ptr,
const char *query_ptr,
char **error_buffer,
uintptr_t docs_limit,
bool with_highlights);
void context_free(struct TantivyContext *context_ptr);
uintptr_t search_result_get_size(struct SearchResult *result_ptr, char **error_buffer);
struct Document *search_result_get_doc(struct SearchResult *result_ptr,
uintptr_t index,
char **error_buffer);
void search_result_free(struct SearchResult *result_ptr);
struct Document *document_create(void);
void document_add_field(struct Document *doc_ptr,
const char *field_name_ptr,
const char *field_value_ptr,
struct TantivyContext *context_ptr,
char **error_buffer);
char *document_as_json(struct Document *doc_ptr,
const char **include_fields_ptr,
uintptr_t include_fields_len,
Schema *schema_ptr,
char **error_buffer);
void document_free(struct Document *doc_ptr);
void string_free(char *s);
void init_lib(const char *log_level_ptr,
char **error_buffer,
bool clear_on_panic,
bool utf8_lenient);