[fix] setting last_node in tokenized trie search in the case where a prefix phrase matches but the longer string doesn't.

This commit is contained in:
Al
2015-04-27 01:49:02 -04:00
parent b2ba629f95
commit 1373843b86

View File

@@ -294,6 +294,8 @@ phrase_array *trie_search_tokens(trie_t *self, char *str, token_array *tokens) {
i = last_match_index; i = last_match_index;
last_match_index = -1; last_match_index = -1;
phrase_start = 0; phrase_start = 0;
last_node = trie_get_root(self);
last_node_id = ROOT_ID;
continue; continue;
} else if (last_state == SEARCH_STATE_PARTIAL_MATCH) { } else if (last_state == SEARCH_STATE_PARTIAL_MATCH) {
log_debug("last_state == SEARCH_STATE_PARTIAL_MATCH\n"); log_debug("last_state == SEARCH_STATE_PARTIAL_MATCH\n");