nostrdb/refactor: move search key printer in case we need it
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -2465,6 +2465,14 @@ static int prefix_count(const char *str1, int len1, const char *str2, int len2)
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ndb_print_text_search_key(struct ndb_text_search_key *key)
|
||||||
|
{
|
||||||
|
printf("K<'%.*s' %d %" PRIu64 " note_id:%" PRIu64 ">", key->str_len, key->str,
|
||||||
|
key->word_index,
|
||||||
|
key->timestamp,
|
||||||
|
key->note_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// This is called when scanning the full text search index. Scanning stops
|
// This is called when scanning the full text search index. Scanning stops
|
||||||
// when we no longer have a prefix match for the word
|
// when we no longer have a prefix match for the word
|
||||||
@@ -2579,14 +2587,6 @@ static void ndb_text_search_results_init(
|
|||||||
results->num_results = 0;
|
results->num_results = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ndb_print_text_search_key(struct ndb_text_search_key *key)
|
|
||||||
{
|
|
||||||
printf("K<'%.*s' %d %" PRIu64 " note_id:%" PRIu64 ">", key->str_len, key->str,
|
|
||||||
key->word_index,
|
|
||||||
key->timestamp,
|
|
||||||
key->note_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ndb_default_text_search_config(struct ndb_text_search_config *cfg)
|
void ndb_default_text_search_config(struct ndb_text_search_config *cfg)
|
||||||
{
|
{
|
||||||
cfg->order = NDB_ORDER_DESCENDING;
|
cfg->order = NDB_ORDER_DESCENDING;
|
||||||
|
|||||||
Reference in New Issue
Block a user