feat: add full-text search with trigram indexing and ranked results
Implement PostgreSQL trigram-based full-text search across posts and comments tables, adding GIN indexes on title, body, and content columns. The search endpoint now returns results ranked by similarity score with configurable threshold and limit parameters.
This commit is contained in:
@@ -132,7 +132,7 @@ static char *do_web_search(const char *query) {
|
|||||||
if (!q_encoded) return strdup("Failed to encode query.");
|
if (!q_encoded) return strdup("Failed to encode query.");
|
||||||
|
|
||||||
char url[4096];
|
char url[4096];
|
||||||
snprintf(url, sizeof(url), "https://rsearch.app.molodetz.nl/search?query=%s", q_encoded);
|
snprintf(url, sizeof(url), "https://rsearch.app.molodetz.nl/search?query=%s&content=true", q_encoded);
|
||||||
curl_free(q_encoded);
|
curl_free(q_encoded);
|
||||||
|
|
||||||
http_client_handle client = http_client_create(NULL);
|
http_client_handle client = http_client_create(NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user