Increase default capacity in SearchIndexWrapper and enhance similarity calculation in calculate_similarity function to boost similarity score when all query words are found. Update MAX_WORDS and MAX_STRING_LEN definitions for improved handling.
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MAX_STRING_LEN 100
|
||||
#define MAX_WORDS 20
|
||||
#define MAX_STRING_LEN 1000
|
||||
#define MAX_WORDS 100
|
||||
|
||||
// Public API
|
||||
|
||||
@@ -19,7 +19,7 @@ typedef struct {
|
||||
|
||||
// Structure to hold a search result
|
||||
typedef struct {
|
||||
const char *string;
|
||||
char *string;
|
||||
float similarity;
|
||||
} SearchResult;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user