svnno****@sourc*****
svnno****@sourc*****
Sat Mar 1 08:28:14 JST 2008
Revision: 3421 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3421 Author: pal_gene Date: 2008-03-01 08:28:14 +0900 (Sat, 01 Mar 2008) Log Message: ----------- * module/search/kz-hyper-estraier-search.c: add NOT support. (ANDNOT in HyperEstraier) usage: type "keyword1 keyword2 -ignore" to "keyword1 AND keyword2 ANDNOT ignore" Modified Paths: -------------- kazehakase/trunk/module/search/kz-hyper-estraier-search.c Modified: kazehakase/trunk/module/search/kz-hyper-estraier-search.c =================================================================== --- kazehakase/trunk/module/search/kz-hyper-estraier-search.c 2008-02-29 23:28:10 UTC (rev 3420) +++ kazehakase/trunk/module/search/kz-hyper-estraier-search.c 2008-02-29 23:28:14 UTC (rev 3421) @@ -277,17 +277,24 @@ g_return_val_if_fail(he_search->db, NULL); cond = est_cond_new(); + highlights = cblistopen(); texts = g_strsplit(text, " ", -1); + phrase = g_string_new(texts[0]); - highlights = cblistopen(); - for (i = 0; texts[i]; i++) + for (i = 1; texts[i]; i++) { - cblistpush(highlights, texts[i], -1); + if(*texts[i] == '-') + { + g_string_append(phrase, " " ESTOPDIFF " "); + g_string_append(phrase, texts[i]+1); + } + else{ + cblistpush(highlights, texts[i], -1); + g_string_append(phrase, " " ESTOPISECT " "); + g_string_append(phrase, texts[i]); + } } - tmp = g_strjoinv(" " ESTOPISECT " ", texts); g_strfreev(texts); - phrase = g_string_new(tmp); - g_free(tmp); except_word = KZ_CONF_GET_STR("History", "except_keyword"); if (except_word && *except_word) @@ -297,12 +304,13 @@ i = 0; while (texts[i]) { - phrase = g_string_append(phrase, " " ESTOPDIFF " "); - phrase = g_string_append(phrase, texts[i]); + g_string_append(phrase, " " ESTOPDIFF " "); + g_string_append(phrase, texts[i]); i++; } g_strfreev(texts); } + est_cond_set_phrase(cond, phrase->str); g_string_free(phrase, TRUE); @@ -346,7 +354,7 @@ else { cache_str = g_strdup(""); - } + } uri = create_uri_from_filename(cache_link + strlen("file://") + he_search->cache_path_len +