blob: a891a27972fbc017df5ce26bcae41f182ecace09 (
plain)
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
|
#ifndef TINY_CONVMEM_DOMAIN_SEARCH_H
#define TINY_CONVMEM_DOMAIN_SEARCH_H
#include <stdbool.h>
#include <stddef.h>
#include "domain/message.h"
typedef struct tiny_search_index tiny_search_index_t;
tiny_search_index_t *tiny_search_index_create(void);
void tiny_search_index_free(tiny_search_index_t *index);
bool tiny_search_index_add(tiny_search_index_t *index,
const tiny_message_t *message,
size_t message_index);
bool tiny_search_index_candidates(const tiny_search_index_t *index,
const char *query,
size_t **output,
size_t *count);
typedef struct tiny_search_breakdown
{
double total;
double content;
double summary;
double tags;
} tiny_search_breakdown_t;
double tiny_search_score(const char *query, const tiny_message_t *message);
bool tiny_search_score_breakdown(const char *query,
const tiny_message_t *message,
tiny_search_breakdown_t *breakdown);
#endif
|