diff options
Diffstat (limited to 'src/structs.c')
-rw-r--r-- | src/structs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/structs.c b/src/structs.c index 6deea3e..f23e52f 100644 --- a/src/structs.c +++ b/src/structs.c @@ -84,6 +84,8 @@ struct sc_query { SC_IN_STRUCT_ARRAY(struct sc_result, results); /* yesfree */ char * string; /* yesfree - query string, stripped of any excess characters that should be excluded from indexing */ time_t lookup_time; /* time of last lookup */ + char * suggested; /* yesfree - suggested search query (did you mean) */ + bool redirect; /* true if client is encouraged to be redirected to suggested (showing results for) */ SC_OPT_TYPE opt; /* some options including engines */ }; struct sc_query * sc_query_init () { @@ -95,6 +97,7 @@ struct sc_query * sc_query_init () { q->results[i]->query = q; } q->string = NULL; + q->suggested = NULL; q->opt = SC_OPT_INIT; return q; } @@ -122,8 +125,9 @@ sc_query_free ( #endif ; if (q->cache) - SC_LOG(SC_LOG_DEBUG, q->cache, "sc_query_free: %s", q->string ? q->string : "NULL"); + SC_LOG(SC_LOG_DEBUG, q->cache, "sc_query_free: %s (sugg: %s)", q->string ? q->string : "NULL", q->suggested ? q->suggested : "NULL"); free(q->string); /* if they were not alloced, they are NULL, if they were free'd somewhere else, they are also set to NULL */ + free(q->suggested); for (size_t i = 0; i < q->results_sizeof; i++) sc_result_free(q->results[i]); free(q->results); |