From 1373843b868f9e3501b4188a9bbe315a4815ca28 Mon Sep 17 00:00:00 2001 From: Al Date: Mon, 27 Apr 2015 01:49:02 -0400 Subject: [PATCH] [fix] setting last_node in tokenized trie search in the case where a prefix phrase matches but the longer string doesn't. --- src/trie_search.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/trie_search.c b/src/trie_search.c index 1808b7ec..d81ff518 100644 --- a/src/trie_search.c +++ b/src/trie_search.c @@ -294,6 +294,8 @@ phrase_array *trie_search_tokens(trie_t *self, char *str, token_array *tokens) { i = last_match_index; last_match_index = -1; phrase_start = 0; + last_node = trie_get_root(self); + last_node_id = ROOT_ID; continue; } else if (last_state == SEARCH_STATE_PARTIAL_MATCH) { log_debug("last_state == SEARCH_STATE_PARTIAL_MATCH\n");