#ifndef TINY_CONVMEM_DOMAIN_SEARCH_H #define TINY_CONVMEM_DOMAIN_SEARCH_H #include #include #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); uint64_t tiny_search_index_memory_estimate(const tiny_search_index_t *index); 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