This repository has been archived by the owner on Dec 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
sphinx.h
60 lines (48 loc) · 1.78 KB
/
sphinx.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
#ifndef SPHINX_H_INCLUDED
#define SPHINX_H_INCLUDED
#include "pstring.h"
#include "dict.h"
typedef int SPH_BOOL;
#define SPH_TRUE (1)
#define SPH_FALSE (0)
typedef struct {
char host[128];
unsigned short port;
char username[64];
char password[64];
char prefix[64];
} sphinx_config;
void default_config(sphinx_config *config);
typedef struct sphinx_context *sphinx_context;
sphinx_context sphinx_select(sphinx_config *config,
const PString *index,
const PString *match,
const PString *condition,
const PString *order,
int offset,
int limit,
const PString *options,
char **error);
SPH_BOOL sphinx_context_next(sphinx_context ctx,
/*OUT*/ int *id,
/*OUT*/ int *weight);
void sphinx_context_free(sphinx_context ctx);
void sphinx_replace(sphinx_config *config,
const PString *index,
int id,
const Dict *data,
char **error);
void sphinx_delete(sphinx_config *config,
const PString *index,
int id,
char **error);
typedef void (*return_data_callback)(void *data, size_t size, void *user_data);
void sphinx_snippet(sphinx_config *config,
const PString *index,
const PString *match,
const PString *data,
const Dict *options,
return_data_callback callback,
void *user_data,
char **error);
#endif