Kouhei Sutou
null+****@clear*****
Wed Nov 7 14:53:23 JST 2012
Kouhei Sutou 2012-11-07 14:53:23 +0900 (Wed, 07 Nov 2012) New Revision: cb87daef9c8b4bbc283dc0fa29916f79b01ddbb8 https://github.com/groonga/groonga/commit/cb87daef9c8b4bbc283dc0fa29916f79b01ddbb8 Log: Add snippet() function It is experimental! Added files: test/command/suite/select/function/snippet/more.expected test/command/suite/select/function/snippet/more.test test/command/suite/select/function/snippet/one.expected test/command/suite/select/function/snippet/one.test Modified files: lib/proc.c Modified: lib/proc.c (+97 -6) =================================================================== --- lib/proc.c 2012-11-07 14:49:09 +0900 (5b147dd) +++ lib/proc.c 2012-11-07 14:53:23 +0900 (e5df63e) @@ -48,6 +48,9 @@ const char *grn_document_root = NULL; #define VAR GRN_PROC_GET_VAR_BY_OFFSET +#define GRN_SELECT_INTERNAL_VAR_CONDITION "$condition" +#define GRN_SELECT_INTERNAL_VAR_MATCH_COLUMNS "$match_columns" + /* bulk must be initialized grn_bulk or grn_msg */ static int grn_bulk_put_from_file(grn_ctx *ctx, grn_obj *bulk, const char *path) @@ -450,7 +453,8 @@ grn_select(grn_ctx *ctx, const char *table, unsigned int table_len, const char *cache, unsigned int cache_len, const char *match_escalation_threshold, unsigned int match_escalation_threshold_len, const char *query_expansion, unsigned int query_expansion_len, - const char *query_flags, unsigned int query_flags_len) + const char *query_flags, unsigned int query_flags_len, + grn_obj *condition_ptr, grn_obj *match_columns_ptr) { uint32_t nkeys, nhits; uint16_t cacheable = 1, taintable = 0; @@ -525,9 +529,11 @@ grn_select(grn_ctx *ctx, const char *table, unsigned int table_len, grn_obj *v; GRN_EXPR_CREATE_FOR_QUERY(ctx, table_, cond, v); if (cond) { + GRN_PTR_SET(ctx, condition_ptr, cond); if (match_columns_len) { GRN_EXPR_CREATE_FOR_QUERY(ctx, table_, match_columns_, v); if (match_columns_) { + GRN_PTR_SET(ctx, match_columns_ptr, match_columns_); grn_expr_parse(ctx, match_columns_, match_columns, match_columns_len, NULL, GRN_OP_MATCH, GRN_OP_AND, GRN_EXPR_SYNTAX_SCRIPT); @@ -545,7 +551,6 @@ grn_select(grn_ctx *ctx, const char *table, unsigned int table_len, } else { flags |= GRN_EXPR_ALLOW_PRAGMA|GRN_EXPR_ALLOW_COLUMN; if (ctx->rc) { - grn_obj_unlink(ctx, cond); goto exit; } } @@ -556,7 +561,6 @@ grn_select(grn_ctx *ctx, const char *table, unsigned int table_len, query = GRN_TEXT_VALUE(&query_expansion_buf); query_len = GRN_TEXT_LEN(&query_expansion_buf); } else { - grn_obj_unlink(ctx, cond); GRN_OBJ_FIN(ctx, &query_expansion_buf); goto exit; } @@ -586,8 +590,6 @@ grn_select(grn_ctx *ctx, const char *table, unsigned int table_len, GRN_OBJ_FIN(ctx, &strbuf); */ if (!ctx->rc) { res = grn_table_select(ctx, table_, cond, NULL, GRN_OP_OR); } - if (match_columns_) { grn_obj_unlink(ctx, match_columns_); } - grn_obj_unlink(ctx, cond); } else { /* todo */ ERRCLR(ctx); @@ -785,6 +787,7 @@ proc_select(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data) int drilldown_limit = GRN_TEXT_LEN(VAR(13)) ? grn_atoi(GRN_TEXT_VALUE(VAR(13)), GRN_BULK_CURR(VAR(13)), NULL) : DEFAULT_DRILLDOWN_LIMIT; + grn_obj *condition_ptr, *match_columns_ptr; if (!output_columns_len) { output_columns = DEFAULT_OUTPUT_COLUMNS; output_columns_len = strlen(DEFAULT_OUTPUT_COLUMNS); @@ -793,6 +796,10 @@ proc_select(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data) drilldown_output_columns = DEFAULT_DRILLDOWN_OUTPUT_COLUMNS; drilldown_output_columns_len = strlen(DEFAULT_DRILLDOWN_OUTPUT_COLUMNS); } + condition_ptr = GRN_PROC_GET_OR_ADD_VAR(GRN_SELECT_INTERNAL_VAR_CONDITION); + GRN_PTR_INIT(condition_ptr, 0, GRN_DB_OBJECT); + match_columns_ptr = GRN_PROC_GET_OR_ADD_VAR(GRN_SELECT_INTERNAL_VAR_MATCH_COLUMNS); + GRN_PTR_INIT(match_columns_ptr, 0, GRN_DB_OBJECT); if (grn_select(ctx, GRN_TEXT_VALUE(VAR(0)), GRN_TEXT_LEN(VAR(0)), GRN_TEXT_VALUE(VAR(1)), GRN_TEXT_LEN(VAR(1)), GRN_TEXT_VALUE(VAR(2)), GRN_TEXT_LEN(VAR(2)), @@ -808,7 +815,16 @@ proc_select(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data) GRN_TEXT_VALUE(VAR(14)), GRN_TEXT_LEN(VAR(14)), GRN_TEXT_VALUE(VAR(15)), GRN_TEXT_LEN(VAR(15)), GRN_TEXT_VALUE(VAR(16)), GRN_TEXT_LEN(VAR(16)), - GRN_TEXT_VALUE(VAR(17)), GRN_TEXT_LEN(VAR(17)))) { + GRN_TEXT_VALUE(VAR(17)), GRN_TEXT_LEN(VAR(17)), + condition_ptr, match_columns_ptr)) { + } + if (GRN_BULK_VSIZE(match_columns_ptr) > 0) { + grn_obj *match_columns = GRN_PTR_VALUE(match_columns_ptr); + grn_obj_unlink(ctx, match_columns); + } + if (GRN_BULK_VSIZE(condition_ptr) > 0) { + grn_obj *condition = GRN_PTR_VALUE(condition_ptr); + grn_obj_unlink(ctx, condition); } return NULL; } @@ -3223,6 +3239,77 @@ selector_all_records(grn_ctx *ctx, grn_obj *table, grn_obj *index, return ctx->rc; } +static grn_obj * +func_snippet(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data) +{ + grn_obj *snippets; + + snippets = GRN_PROC_ALLOC(GRN_DB_SHORT_TEXT, GRN_OBJ_VECTOR); + if (!snippets) { + return NULL; + } + + /* TODO: support parameters */ + if (nargs == 1) { + grn_obj *text = args[0]; + grn_obj *command = ctx->impl->curr_expr; + grn_obj *condition_ptr = NULL; + grn_obj *condition = NULL; + grn_snip *snip; + int flags = GRN_SNIP_NORMALIZE | GRN_SNIP_SKIP_LEADING_SPACES; + unsigned int width = 200; + unsigned int max_n_results = 3; + unsigned int n_tags = 1; + const char *open_tags[] = {"<span class=\"keyword\">"}; + unsigned int open_tag_lengths[1]; + const char *close_tags[] = {"</span>"}; + unsigned int close_tag_lengths[1]; + grn_snip_mapping *mapping = GRN_SNIP_MAPPING_HTML_ESCAPE; + + open_tag_lengths[0] = strlen(open_tags[0]); + close_tag_lengths[0] = strlen(close_tags[0]); + + condition_ptr = grn_expr_get_var(ctx, command, + GRN_SELECT_INTERNAL_VAR_CONDITION, + strlen(GRN_SELECT_INTERNAL_VAR_CONDITION)); + if (condition_ptr) { + condition = GRN_PTR_VALUE(condition_ptr); + } + + snip = grn_expr_snip(ctx, condition, flags, + width, max_n_results, n_tags, + open_tags, open_tag_lengths, + close_tags, close_tag_lengths, + mapping); + if (snip) { + grn_rc rc; + unsigned int i, n_results, max_tagged_length; + grn_obj snippet_buffer; + + rc = grn_snip_exec(ctx, snip, + GRN_TEXT_VALUE(text), GRN_TEXT_LEN(text), + &n_results, &max_tagged_length); + GRN_TEXT_INIT(&snippet_buffer, 0); + grn_bulk_space(ctx, &snippet_buffer, max_tagged_length); + for (i = 0; i < n_results; i++) { + unsigned int snippet_length; + + GRN_BULK_REWIND(&snippet_buffer); + rc = grn_snip_get_result(ctx, snip, i, + GRN_TEXT_VALUE(&snippet_buffer), + &snippet_length); + grn_vector_add_element(ctx, snippets, + GRN_TEXT_VALUE(&snippet_buffer), snippet_length, + 0, GRN_DB_SHORT_TEXT); + } + GRN_OBJ_FIN(ctx, &snippet_buffer); + grn_snip_close(ctx, snip); + } + } + + return snippets; +} + #define DEF_VAR(v,name_str) do {\ (v).name = (name_str);\ @@ -3400,4 +3487,8 @@ grn_db_init_builtin_query(grn_ctx *ctx) func_all_records, NULL, NULL, 0, NULL); grn_proc_set_selector(ctx, selector_proc, selector_all_records); } + + /* experimental */ + grn_proc_create(ctx, "snippet", 7, GRN_PROC_FUNCTION, + func_snippet, NULL, NULL, 0, NULL); } Added: test/command/suite/select/function/snippet/more.expected (+108 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/function/snippet/more.expected 2012-11-07 14:53:23 +0900 (df59854) @@ -0,0 +1,108 @@ +table_create Documents TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Documents content COLUMN_SCALAR Text +[[0,0.0,0.0],true] +table_create Terms TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram +[[0,0.0,0.0],true] +column_create Terms document_index COLUMN_INDEX|WITH_POSITION Documents content +[[0,0.0,0.0],true] +load --table Documents +[ +["_key", "content"], +["groonga ã®æ¦è¦", "groonga ã¯è»¢ç½®ç´¢å¼ãç¨ããé«éã»é«ç²¾åº¦ãªå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ãããç»é²ãããææ¸ãããã«æ¤ç´¢çµæã«åæ ã§ãã¾ããã¾ããåç §ããããã¯ããã«æ´æ°ã§ãããã¨ãããå³ææ´æ°ã®å¿ è¦ãªã¢ããªã±ã¼ã·ã§ã³ã«ããã¦ãé«ãæ§è½ãçºæ®ãã¾ãã\n\nå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¨ãã¦éçºããã groonga ã§ãããç¬èªã®ã«ã©ã ã¹ãã¢ãæã¤åæåã®ãã¼ã¿ãã¼ã¹ã¨ãã¦ã®å´é¢ãæã£ã¦ãã¾ãããã®ãããMySQL ã PostgreSQL ãªã©ãæ¢åã®ä»£è¡¨çãªãã¼ã¿ãã¼ã¹ãè¦æã¨ããéè¨ã¯ã¨ãªãé«éã«å¦çã§ããã¨ããç¹å¾´ããããçµã¿åããã«ãã£ã¦å¼±ç¹ãè£ããããªä½¿ãæ¹ãã§ãã¾ãã\n\ngroonga ã®åºæ¬æ©è½ã¯ C ã©ã¤ãã©ãªã¨ãã¦æä¾ããã¦ãã¾ãããMySQL ã PostgreSQL ã¨é£æºãããããRuby ããå¼ã³åºããããããã¨ãã§ãã¾ãããã®ãããä»»æ ã®ã¢ããªã±ã¼ã·ã§ã³ã«çµã¿è¾¼ããã¨ãå¯è½ã§ãããå¤æ§ãªä½¿ãæ¹ãèãããã¾ãã èå³ã®ããæ¹ã¯ å©ç¨ä¾ ãã覧ãã ããã"], +["å ¨ææ¤ç´¢ã¨å³ææ´æ°", "ä¸è¬çãªãã¼ã¿ãã¼ã¹ã«ããã¦ã¯ã追å ã»åé¤ãªã©ã®æä½ãããã«åæ ããã¾ããä¸æ¹ãå ¨ææ¤ç´¢ã«ããã¦ã¯ã転置索å¼ãé次æ´æ°ã®é£ãããã¼ã¿æ§é ã§ãããã¨ãããææ¸ã®è¿½å ã»åé¤ã«å¯¾å¿ããªãã¨ã³ã¸ã³ãå°ãªãããã¾ããã\n\nããã«å¯¾ãã転置索å¼ãç¨ããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ãããªãããgroonga ã¯ææ¸ãçæéã§è¿½å ã»åé¤ãããã¨ãã§ãã¾ãããã®ä¸ãæ´æ°ããªããã§ãæ¤ç´¢ã§ããã¨ããåªããç¹å¾´ãæã£ã¦ãããããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¨ãã¦ã¯ã¨ã¦ãæè»æ§ãããã¾ããã¾ããè¤æ°ã®è»¢ç½®ç´¢å¼ãçµ±åãããããªéãå¦çãå¿ è¦ã¨ããªãã®ã§ãå®å®ãã¦é«ãæ§è½ãçºæ®ãããã¨ãæå¾ ã§ãã¾ãã"], +["ã«ã©ã ã¹ãã¢ã¨éè¨ã¯ã¨ãª", "ç¾ä»£ã¯ãã¤ã³ã¿ã¼ããããæ å ±æºã¨ããã°ããããã§ãæ å ±ãåéã§ããæ代ã§ããããããè¨å¤§ãªæ å ±ããæçãªæ å ±ãå¼ãåºãã®ã¯å°é£ã§ãããå¤é¢çãªåæã«ãã試è¡é¯èª¤ãå¿ è¦ã¨ãªãã¾ãããã¨ãã°ãæ¥ä»ãæé帯ã«ããçµãè¾¼ãã§ã¿ãããå°åã«ããçµãè¾¼ãã§ã¿ãããæ§å¥ãå¹´é½¢ã«ããçµãè¾¼ãã§ã¿ãããããã¨ã§ããããããã¦ããã®ãããªã¨ãã«ä¾¿å©ãªåå¨ãéè¨ã¯ã¨ãªã§ãã\n\néè¨ã¯ã¨ãªã¨ã¯ãæå®ããã«ã©ã ã®å¤ã«ãã£ã¦ã¬ã³ã¼ããã°ã«ã¼ãåããåã°ã«ã¼ãã«å«ã¾ããã¬ã³ã¼ãã®æ°ãæ±ããã¯ã¨ãªã§ãããã¨ãã°ãå°åã® ID ãæ ¼ç´ãã¦ããã«ã©ã ãæå®ããã°ãå°åæ¯ã®ã¬ã³ã¼ãæ°ãæ±ã¾ãã¾ããæ¥ä»ã®ã«ã©ã ãæå®ããã¨ãã®åºåãã°ã©ãåããã°ãã¬ã³ã¼ãæ°ã®æéå¤åã è¦è¦åãããã¨ãã§ãã¾ããããã«ãå°åã«ããçµãè¾¼ã¿ã¨æ¥ä»ã«å¯¾ããéè¨ã¯ã¨ãªãçµã¿åãããã°ãç¹å®ã®å°åã«ãããã¬ã³ã¼ãæ°ã®æéå¤åãè¦è¦åãã¨ãå¯è½ã§ãããã®ããã«ã尺度ãèªç±ã«é¸æãã¦çµãè¾¼ã¿ã»éè¨ã§ãããã¨ã¯ãè¨å¤§ãªæ å ±ãæ±ãä¸ã§ã¨ã¦ãéè¦ã«ãªãã¾ãã\n\ngroonga ãéè¨ã¯ã¨ãªãé«éã«å¦çã§ããçç±ã¯ããã¼ã¿ãã¼ã¹ã®è«çæ§é ã«ã«ã©ã ã¹ãã¢ãæ¡ç¨ãã¦ããããã§ããéè¨ã¯ã¨ãªãåç §ããã®ã¯æå®ãããã«ã©ã ã®ã¿ã§ãããããã«ã©ã åä½ã§ãã¼ã¿ãæ ¼ç´ããåæåã®ãã¼ã¿ãã¼ã¹ã§ã¯ãå¿ è¦ãªã«ã©ã ã®ã¿ãç¡é§ãªãèªã¿åºãããã¨ãå©ç¹ã¨ãªãã¾ããä¸æ¹ãã¬ã³ã¼ãåä½ã§ãã¼ã¿ãæ ¼ç´ããè¡æåã®ãã¼ã¿ãã¼ã¹ã§ã¯ãé£æ¥ããã«ã©ã ãã¾ã¨ãã¦èªã¿åºãã¦ãã¾ããã¨ãæ¬ ç¹ã¨ãªãã¾ãã"], +["転置索å¼ã¨ãã¼ã¯ãã¤ã¶", "転置索å¼ã¯å¤§è¦æ¨¡ãªå ¨ææ¤ç´¢ã«ç¨ããããä¼çµ±çãªãã¼ã¿æ§é ã§ãã転置索å¼ãç¨ããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ã¯ãææ¸ã追å ããã¨ãã«ç´¢å¼èªãè¨é²ãã¦ãããæ¤ç´¢ããã¨ãã¯ã¯ã¨ãªãç´¢å¼èªã«åå²ãã¦åºç¾ææ¸ãæ±ãã¾ãããã®ãããææ¸ãã¯ã¨ãªããç´¢å¼èªãæãåºãæ¹æ³ãéè¦ã«ãªãã¾ãã\n\nãã¼ã¯ãã¤ã¶ã¯ãæååããç´¢å¼èªãæãåºãã¢ã¸ã¥ã¼ã«ã§ããæ¥æ¬èªã対象ã¨ããå ¨ææ¤ç´¢ã«ããã¦ã¯ãå½¢æ ç´ ãç´¢å¼èªã¨ãã¦æãåºãæ¹å¼ã¨æå N-gram ãæãåºãæ¹å¼ã®ããããããããã¯ä¸¡æ¹ãç¨ããã®ãä¸è¬çã§ããå½¢æ ç´ æ¹å¼ã¯æ¤ç´¢æéãç´¢å¼ãµã¤ãºã®é¢ã§åªãã¦ããã»ããæ¤ç´¢çµæã«ä¸è¦ãªææ¸ãå«ã¾ãã«ããã¨ããå©ç¹ãæã£ã¦ãã¾ããä¸æ¹ãN-gram æ¹å¼ã«ã¯æ¤ç´¢æ¼ããçºçãã«ããã¨ããå©ç¹ã ãããç¶æ³ã«ãã£ã¦é©ããæ¹å¼ãé¸æãããã¨ãæã¾ããã¨ããã¦ãã¾ãã\n\ngroonga ã¯å½¢æ ç´ æ¹å¼ã¨ N-gram æ¹å¼ã®ä¸¡æ¹ã«å¯¾å¿ãã¦ãã¾ããåæç¶æ ã§å©ç¨ã§ãããã¼ã¯ãã¤ã¶ã¯ç©ºç½ãåºåãæåã¨ãã¦ç¨ããæ¹å¼ã¨ N-gram æ¹å¼ã®ã¿ã§ãããå½¢æ ç´ è§£æå¨ MeCab ãçµã¿è¾¼ãã ã¨ã㯠MeCab ã«ããåãã¡æ¸ãã®çµæãç¨ããå½¢æ ç´ æ¹å¼ãæå¹ã«ãªãã¾ãããã¼ã¯ãã¤ã¶ã¯ãã©ã°ã¤ã³ã¨ãã¦è¿½å ã§ãããããç¹å¾´çãªãã¼ã¯ã¼ãã®ã¿ãç´¢å¼èªã¨ãã¦æ¡ç¨ãããªã©ãç¬èªã®ãã¼ã¯ãã¤ã¶ãéçºãããã¨ãå¯è½ã§ãã"], +["å ±æå¯è½ãªã¹ãã¬ã¼ã¸ã¨åç §ããã¯ããªã¼", "CPU ã®ãã«ãã³ã¢åãé²ãã§ãããããåæã«è¤æ°ã®ã¯ã¨ãªãå®è¡ããããä¸ã¤ã®ã¯ã¨ãªãè¤æ°ã®ã¹ã¬ããã§å®è¡ããããããã¨ã®éè¦æ§ã¯ã¾ãã¾ãé«ã¾ã£ã¦ãã¾ãã\n\ngroonga ã®ã¹ãã¬ã¼ã¸ã¯ãè¤æ°ã®ã¹ã¬ããã»ããã»ã¹ã§å ±æãããã¨ãã§ãã¾ããã¾ããåç §ããã¯ããªã¼ãªãã¼ã¿æ§é ãæ¡ç¨ãã¦ãããããæ´æ°ã¯ã¨ãªãå®è¡ãã¦ããç¶æ³ã§ãåç §ã¯ã¨ãªãå®è¡ãããã¨ãã§ãã¾ããåç §ã¯ã¨ãªãå®è¡ã§ããç¶æ ãç¶æããªããæ´æ°ã¯ã¨ãªãå®è¡ã§ããã®ã§ããªã¢ã«ã¿ã¤ã ãªã·ã¹ãã ã«é©ãã¦ãã¾ããããã«ã¯ãMySQL ãä»ãã¦æ´æ°ã¯ã¨ãªãå®è¡ãã¦ããæä¸ã« groonga ã® HTTP ãµã¼ããä»ãã¦åç §ã¯ã¨ãªãå®è¡ãããªã©ãå¤å½©ãªéç¨ãå¯è½ã¨ãªã£ã¦ãã¾ãã"], +["ä½ç½®æ å ±ï¼ç·¯åº¦ã»çµåº¦ï¼æ¤ç´¢", "GPS ã«ä»£è¡¨ããã測ä½ã·ã¹ãã ãæè¼ããé«æ©è½ãªæºå¸¯ç«¯æ«ã®æ®åãªã©ã«ãã£ã¦ãä½ç½®æ å ±ãæ±ããµã¼ãã¹ã¯ã¾ãã¾ã便å©ã«ãªã£ã¦ãã¾ãããã¨ãã°ãè¿ãã«ããã¬ã¹ãã©ã³ãæ¢ãã¦ããã¨ãã¯ãç¾å¨å°ããã®è·é¢ãåºæºã¨ãã¦æ¤ç´¢ããããªããæ¤ç´¢çµæãå°å³ä¸ã«è¡¨ç¤ºãã¦ããããããªãµã¼ãã¹ã便å©ã§ãããã®ãããä½ç½®æ å ±æ¤ç´¢ãé«éã«å®ç¾ã§ãããã¨ãéè¦ã«ãªã£ã¦ãã¾ãã\n\ngroonga ã§ã¯è»¢ç½®ç´¢å¼ãå¿ç¨ãã¦é«éãªä½ç½®æ å ±æ¤ç´¢ãå®ç¾ãã¦ãã¾ããç©å½¢ã»åã«ããç¯å²æ¤ç´¢ã«å¯¾å¿ãã¦ããã»ããåºæºç¹ã®è¿ããåªå çã«æ¢ç´¢ããããã¨ãã§ãã¾ããã¾ããè·é¢è¨ç®ããµãã¼ããã¦ããã®ã§ãä½ç½®æ å ±æ¤ç´¢ã®çµæãåºæºç¹ããã®è·é¢ã«ãã£ã¦æ´åãããã¨ãå¯è½ã§ãã"], +["groonga ã©ã¤ãã©ãª", "Groonga ã®åºæ¬æ©è½ã¯ C ã©ã¤ãã©ãªã¨ãã¦æä¾ããã¦ããã®ã§ãä»»æã®ã¢ããªã±ã¼ã·ã§ã³ã«çµã¿è¾¼ãã§å©ç¨ãããã¨ãã§ãã¾ããC/C++ 以å¤ã«ã¤ãã¦ã¯ãRuby ãã groonga ãå©ç¨ããã©ã¤ãã©ãªãªã©ãé¢é£ããã¸ã§ã¯ãã«ããã¦æä¾ããã¦ãã¾ãã詳ãã㯠é¢é£ããã¸ã§ã¯ã ãåç §ãã¦ãã ããã"], +["groonga ãµã¼ã", "groonga ã«ã¯ãµã¼ãæ©è½ããããããã¬ã³ã¿ã«ãµã¼ããªã©ã®æ°ããã©ã¤ãã©ãªãã¤ã³ã¹ãã¼ã«ã§ããªãç°å¢ã«ããã¦ãå©ç¨ã§ãã¾ãã対å¿ãã¦ããã®ã¯ HTTP, memcached binary ãããã³ã«ãããã³ã« groonga ã®ç¬èªãããã³ã«ã§ãã gqtp ã§ãããµã¼ãã¨ãã¦å©ç¨ããã¨ãã¯ã¯ã¨ãªã®ãã£ãã·ã¥æ©è½ãæå¹ã«ãªããããåãã¯ã¨ãªãåãåã£ãã¨ãã¯å¿çæéãçããªãã¨ããç¹å¾´ãããã¾ãã"], +["groonga ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³", "groonga ã¯ç¬èªã®ã«ã©ã ã¹ãã¢ãæã¤åæåã®ãã¼ã¿ãã¼ã¹ã¨ãã¦ã®å´é¢ãæã£ã¦ãã¾ãããæ¢åã® RDBMS ã®ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã¨ãã¦å©ç¨ãããã¨ãã§ãã¾ãããã¨ãã°ãgroonga ããã¼ã¹ã¨ãã MySQL ã®ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã¨ã㦠mroonga ãéçºããã¦ãã¾ããmroonga 㯠MySQL ã®ãã©ã°ã¤ã³ã¨ãã¦åçã«ãã¼ããããã¨ãå¯è½ã§ãããgroonga ã®ã«ã©ã ã¹ãã¢ãã¹ãã¬ã¼ã¸ã¨ãã¦å©ç¨ããããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¨ã㦠groonga ã MyISAM ã InnoDB ã¨é£æºãããããããã¨ãã§ãã¾ããgroonga åä½ã§ã®å©ç¨ãããã³ã« MyISAM, InnoDB ã¨ã®é£æºã«ã¯ä¸é·ä¸çãããã®ã§ãç¨éã«å¿ãã¦é©åãªçµã¿åãããé¸ã¶ãã¨ã大åã§ãã詳ãã㯠é¢é£ããã¸ã§ã¯ã ãåç §ãã¦ãã ããã"] +] +[[0,0.0,0.0],9] +select Documents --match_columns content --query 'groonga' --output_columns '_key, snippet(content)' --command_version 2 +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 9 + ], + [ + [ + "_key", + "ShortText" + ], + [ + "snippet", + "null" + ] + ], + [ + "groonga ã®æ¦è¦", + [ + "<span class=\"keyword\">groonga</span> ã¯è»¢ç½®ç´¢å¼ãç¨ããé«éã»é«ç²¾åº¦ãªå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ãããç»é²ãããææ¸ãããã«æ¤ç´¢çµæã«åæ ã§ãã¾ããã¾ããåç §ããããã¯ããã«", + "ããã¦ãé«ãæ§è½ãçºæ®ãã¾ãã\n\nå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¨ãã¦éçºããã <span class=\"keyword\">groonga</span> ã§ãããç¬èªã®ã«ã©ã ã¹ãã¢ãæã¤åæåã®ãã¼ã¿ãã¼ã¹ã¨ãã¦ã®å´é¢", + "å¾´ããããçµã¿åããã«ãã£ã¦å¼±ç¹ãè£ããããªä½¿ãæ¹ãã§ãã¾ãã\n\n<span class=\"keyword\">groonga</span> ã®åºæ¬æ©è½ã¯ C ã©ã¤ãã©ãªã¨ãã¦æä¾ããã¦ãã¾ãããMySQL ã PostgreSQL " + ] + ], + [ + "å ¨ææ¤ç´¢ã¨å³ææ´æ°", + [ + "ãã\n\nããã«å¯¾ãã転置索å¼ãç¨ããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ãããªããã<span class=\"keyword\">groonga</span> ã¯ææ¸ãçæéã§è¿½å ã»åé¤ãããã¨ãã§ãã¾ãããã®ä¸ãæ´æ°ããªã" + ] + ], + [ + "ã«ã©ã ã¹ãã¢ã¨éè¨ã¯ã¨ãª", + [ + "ã»éè¨ã§ãããã¨ã¯ãè¨å¤§ãªæ å ±ãæ±ãä¸ã§ã¨ã¦ãéè¦ã«ãªãã¾ãã\n\n<span class=\"keyword\">groonga</span> ãéè¨ã¯ã¨ãªãé«éã«å¦çã§ããçç±ã¯ããã¼ã¿ãã¼ã¹ã®è«çæ§é ã«ã«" + ] + ], + [ + "転置索å¼ã¨ãã¼ã¯ãã¤ã¶", + [ + "ç¶æ³ã«ãã£ã¦é©ããæ¹å¼ãé¸æãããã¨ãæã¾ããã¨ããã¦ãã¾ãã\n\n<span class=\"keyword\">groonga</span> ã¯å½¢æ ç´ æ¹å¼ã¨ N-gram æ¹å¼ã®ä¸¡æ¹ã«å¯¾å¿ãã¦ãã¾ããåæç¶æ ã§å©ç¨ã§" + ] + ], + [ + "å ±æå¯è½ãªã¹ãã¬ã¼ã¸ã¨åç §ããã¯ããªã¼", + [ + "ã¹ã¬ããã§å®è¡ããããããã¨ã®éè¦æ§ã¯ã¾ãã¾ãé«ã¾ã£ã¦ãã¾ãã\n\n<span class=\"keyword\">groonga</span> ã®ã¹ãã¬ã¼ã¸ã¯ãè¤æ°ã®ã¹ã¬ããã»ããã»ã¹ã§å ±æãããã¨ãã§ãã¾ã", + "ãã¦ãã¾ããããã«ã¯ãMySQL ãä»ãã¦æ´æ°ã¯ã¨ãªãå®è¡ãã¦ããæä¸ã« <span class=\"keyword\">groonga</span> ã® HTTP ãµã¼ããä»ãã¦åç §ã¯ã¨ãªãå®è¡ãããªã©ãå¤å½©ãªéç¨ãå¯è½" + ] + ], + [ + "ä½ç½®æ å ±ï¼ç·¯åº¦ã»çµåº¦ï¼æ¤ç´¢", + [ + "ãããä½ç½®æ å ±æ¤ç´¢ãé«éã«å®ç¾ã§ãããã¨ãéè¦ã«ãªã£ã¦ãã¾ãã\n\n<span class=\"keyword\">groonga</span> ã§ã¯è»¢ç½®ç´¢å¼ãå¿ç¨ãã¦é«éãªä½ç½®æ å ±æ¤ç´¢ãå®ç¾ãã¦ãã¾ããç©å½¢ã»" + ] + ], + [ + "groonga ã©ã¤ãã©ãª", + [ + "<span class=\"keyword\">Groonga</span> ã®åºæ¬æ©è½ã¯ C ã©ã¤ãã©ãªã¨ãã¦æä¾ããã¦ããã®ã§ãä»»æã®ã¢ããªã±ã¼ã·ã§ã³ã«çµã¿è¾¼ãã§å©ç¨ãããã¨ãã§ãã¾ããC/C++ 以å¤ã«ã¤ãã¦ã¯ã", + "Ruby ãã <span class=\"keyword\">groonga</span> ãå©ç¨ããã©ã¤ãã©ãªãªã©ãé¢é£ããã¸ã§ã¯ãã«ããã¦æä¾ããã¦ãã¾ãã詳ãã㯠é¢é£ããã¸ã§ã¯ã ãåç §ãã¦ãã ããã" + ] + ], + [ + "groonga ãµã¼ã", + [ + "<span class=\"keyword\">groonga</span> ã«ã¯ãµã¼ãæ©è½ããããããã¬ã³ã¿ã«ãµã¼ããªã©ã®æ°ããã©ã¤ãã©ãªãã¤ã³ã¹ãã¼ã«ã§ããªãç°å¢ã«ããã¦ãå©ç¨ã§ãã¾ãã対å¿ãã¦ããã®ã¯", + " HTTP, memcached binary ãããã³ã«ãããã³ã« <span class=\"keyword\">groonga</span> ã®ç¬èªãããã³ã«ã§ãã gqtp ã§ãããµã¼ãã¨ãã¦å©ç¨ããã¨ãã¯ã¯ã¨ãªã®ãã£ãã·ã¥æ©è½ãæå¹ã«ãª" + ] + ], + [ + "groonga ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³", + [ + "<span class=\"keyword\">groonga</span> ã¯ç¬èªã®ã«ã©ã ã¹ãã¢ãæã¤åæåã®ãã¼ã¿ãã¼ã¹ã¨ãã¦ã®å´é¢ãæã£ã¦ãã¾ãããæ¢åã® RDBMS ã®ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã¨ãã¦å©ç¨ãããã¨ã", + "ã§ãã¾ãããã¨ãã°ã<span class=\"keyword\">groonga</span> ããã¼ã¹ã¨ãã MySQL ã®ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã¨ã㦠mroonga ãéçºããã¦ãã¾ããmroonga 㯠MySQL ã®ãã©ã°ã¤ã³ã¨ãã¦åçã«", + "<span class=\"keyword\">groonga</span> ã®ã«ã©ã ã¹ãã¢ãã¹ãã¬ã¼ã¸ã¨ãã¦å©ç¨ããããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¨ã㦠<span class=\"keyword\">groonga</span> ã MyISAM ã InnoDB ã¨é£æºãããããããã¨ãã§ãã¾ãã<span class=\"keyword\">groonga</span> å" + ] + ] + ] + ] +] Added: test/command/suite/select/function/snippet/more.test (+24 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/function/snippet/more.test 2012-11-07 14:53:23 +0900 (e986183) @@ -0,0 +1,24 @@ +table_create Documents TABLE_HASH_KEY ShortText +column_create Documents content COLUMN_SCALAR Text + +table_create Terms TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram +column_create Terms document_index COLUMN_INDEX|WITH_POSITION Documents content + +load --table Documents +[ +["_key", "content"], +["groonga ã®æ¦è¦", "groonga ã¯è»¢ç½®ç´¢å¼ãç¨ããé«éã»é«ç²¾åº¦ãªå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ãããç»é²ãããææ¸ãããã«æ¤ç´¢çµæã«åæ ã§ãã¾ããã¾ããåç §ããããã¯ããã«æ´æ°ã§ãããã¨ãããå³ææ´æ°ã®å¿ è¦ãªã¢ããªã±ã¼ã·ã§ã³ã«ããã¦ãé«ãæ§è½ãçºæ®ãã¾ãã\n\nå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¨ãã¦éçºããã groonga ã§ãããç¬èªã®ã«ã©ã ã¹ãã¢ãæã¤åæåã®ãã¼ã¿ãã¼ã¹ã¨ãã¦ã®å´é¢ãæã£ã¦ãã¾ãããã®ãããMySQL ã PostgreSQL ãªã©ãæ¢åã®ä»£è¡¨çãªãã¼ã¿ãã¼ã¹ãè¦æã¨ããéè¨ã¯ã¨ãªãé«éã«å¦çã§ããã¨ããç¹å¾´ããããçµã¿åããã«ãã£ã¦å¼±ç¹ãè£ããããªä½¿ãæ¹ãã§ãã¾ãã\n\ngroonga ã®åºæ¬æ©è½ã¯ C ã©ã¤ãã©ãªã¨ãã¦æä¾ããã¦ãã¾ãããMySQL ã PostgreSQL ã¨é£æºãããããRuby ããå¼ã³åºããããããã¨ãã§ãã¾ãããã®ãããä»»æ ã®ã¢ããªã±ã¼ã·ã§ã³ã«çµã¿è¾¼ããã¨ãå¯è½ã§ãããå¤æ§ãªä½¿ãæ¹ãèãããã¾ãã èå³ã®ããæ¹ã¯ å©ç¨ä¾ ãã覧ãã ããã"], +["å ¨ææ¤ç´¢ã¨å³ææ´æ°", "ä¸è¬çãªãã¼ã¿ãã¼ã¹ã«ããã¦ã¯ã追å ã»åé¤ãªã©ã®æä½ãããã«åæ ããã¾ããä¸æ¹ãå ¨ææ¤ç´¢ã«ããã¦ã¯ã転置索å¼ãé次æ´æ°ã®é£ãããã¼ã¿æ§é ã§ãããã¨ãããææ¸ã®è¿½å ã»åé¤ã«å¯¾å¿ããªãã¨ã³ã¸ã³ãå°ãªãããã¾ããã\n\nããã«å¯¾ãã転置索å¼ãç¨ããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ãããªãããgroonga ã¯ææ¸ãçæéã§è¿½å ã»åé¤ãããã¨ãã§ãã¾ãããã®ä¸ãæ´æ°ããªããã§ãæ¤ç´¢ã§ããã¨ããåªããç¹å¾´ãæã£ã¦ãããããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¨ãã¦ã¯ã¨ã¦ãæè»æ§ãããã¾ããã¾ããè¤æ°ã®è»¢ç½®ç´¢å¼ãçµ±åãããããªéãå¦çãå¿ è¦ã¨ããªãã®ã§ãå®å®ãã¦é«ãæ§è½ãçºæ®ãããã¨ãæå¾ ã§ãã¾ãã"], +["ã«ã©ã ã¹ãã¢ã¨éè¨ã¯ã¨ãª", "ç¾ä»£ã¯ãã¤ã³ã¿ã¼ããããæ å ±æºã¨ããã°ããããã§ãæ å ±ãåéã§ããæ代ã§ããããããè¨å¤§ãªæ å ±ããæçãªæ å ±ãå¼ãåºãã®ã¯å°é£ã§ãããå¤é¢çãªåæã«ãã試è¡é¯èª¤ãå¿ è¦ã¨ãªãã¾ãããã¨ãã°ãæ¥ä»ãæé帯ã«ããçµãè¾¼ãã§ã¿ãããå°åã«ããçµãè¾¼ãã§ã¿ãããæ§å¥ãå¹´é½¢ã«ããçµãè¾¼ãã§ã¿ãããããã¨ã§ããããããã¦ããã®ãããªã¨ãã«ä¾¿å©ãªåå¨ãéè¨ã¯ã¨ãªã§ãã\n\néè¨ã¯ã¨ãªã¨ã¯ãæå®ããã«ã©ã ã®å¤ã«ãã£ã¦ã¬ã³ã¼ããã°ã«ã¼ãåããåã°ã«ã¼ãã«å«ã¾ããã¬ã³ã¼ãã®æ°ãæ±ããã¯ã¨ãªã§ãããã¨ãã°ãå°åã® ID ãæ ¼ç´ãã¦ããã«ã©ã ãæå®ããã°ãå°åæ¯ã®ã¬ã³ã¼ãæ°ãæ±ã¾ãã¾ããæ¥ä»ã®ã«ã©ã ãæå®ããã¨ãã®åºåãã°ã©ãåããã°ãã¬ã³ã¼ãæ°ã®æéå¤åã è¦è¦åãããã¨ãã§ãã¾ããããã«ãå°åã«ããçµãè¾¼ã¿ã¨æ¥ä»ã«å¯¾ããéè¨ã¯ã¨ãªãçµã¿åãããã°ãç¹å®ã®å°åã«ãããã¬ã³ã¼ãæ°ã®æéå¤åãè¦è¦åãã¨ãå¯è½ã§ãããã®ããã«ã尺度ãèªç±ã«é¸æãã¦çµãè¾¼ã¿ã»éè¨ã§ãããã¨ã¯ãè¨å¤§ãªæ å ±ãæ±ãä¸ã§ã¨ã¦ãéè¦ã«ãªãã¾ãã\n\ngroonga ãéè¨ã¯ã¨ãªãé«éã«å¦çã§ããçç±ã¯ããã¼ã¿ãã¼ã¹ã®è«çæ§é ã«ã«ã©ã ã¹ãã¢ãæ¡ç¨ãã¦ããããã§ããéè¨ã¯ã¨ãªãåç §ããã®ã¯æå®ãããã«ã©ã ã®ã¿ã§ãããããã«ã©ã åä½ã§ãã¼ã¿ãæ ¼ç´ããåæåã®ãã¼ã¿ãã¼ã¹ã§ã¯ãå¿ è¦ãªã«ã©ã ã®ã¿ãç¡é§ãªãèªã¿åºãããã¨ãå©ç¹ã¨ãªãã¾ããä¸æ¹ãã¬ã³ã¼ãåä½ã§ãã¼ã¿ãæ ¼ç´ããè¡æåã®ãã¼ã¿ãã¼ã¹ã§ã¯ãé£æ¥ããã«ã©ã ãã¾ã¨ãã¦èªã¿åºãã¦ãã¾ããã¨ãæ¬ ç¹ã¨ãªãã¾ãã"], +["転置索å¼ã¨ãã¼ã¯ãã¤ã¶", "転置索å¼ã¯å¤§è¦æ¨¡ãªå ¨ææ¤ç´¢ã«ç¨ããããä¼çµ±çãªãã¼ã¿æ§é ã§ãã転置索å¼ãç¨ããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ã¯ãææ¸ã追å ããã¨ãã«ç´¢å¼èªãè¨é²ãã¦ãããæ¤ç´¢ããã¨ãã¯ã¯ã¨ãªãç´¢å¼èªã«åå²ãã¦åºç¾ææ¸ãæ±ãã¾ãããã®ãããææ¸ãã¯ã¨ãªããç´¢å¼èªãæãåºãæ¹æ³ãéè¦ã«ãªãã¾ãã\n\nãã¼ã¯ãã¤ã¶ã¯ãæååããç´¢å¼èªãæãåºãã¢ã¸ã¥ã¼ã«ã§ããæ¥æ¬èªã対象ã¨ããå ¨ææ¤ç´¢ã«ããã¦ã¯ãå½¢æ ç´ ãç´¢å¼èªã¨ãã¦æãåºãæ¹å¼ã¨æå N-gram ãæãåºãæ¹å¼ã®ããããããããã¯ä¸¡æ¹ãç¨ããã®ãä¸è¬çã§ããå½¢æ ç´ æ¹å¼ã¯æ¤ç´¢æéãç´¢å¼ãµã¤ãºã®é¢ã§åªãã¦ããã»ããæ¤ç´¢çµæã«ä¸è¦ãªææ¸ãå«ã¾ãã«ããã¨ããå©ç¹ãæã£ã¦ãã¾ããä¸æ¹ãN-gram æ¹å¼ã«ã¯æ¤ç´¢æ¼ããçºçãã«ããã¨ããå©ç¹ã ãããç¶æ³ã«ãã£ã¦é©ããæ¹å¼ãé¸æãããã¨ãæã¾ããã¨ããã¦ãã¾ãã\n\ngroonga ã¯å½¢æ ç´ æ¹å¼ã¨ N-gram æ¹å¼ã®ä¸¡æ¹ã«å¯¾å¿ãã¦ãã¾ããåæç¶æ ã§å©ç¨ã§ãããã¼ã¯ãã¤ã¶ã¯ç©ºç½ãåºåãæåã¨ãã¦ç¨ããæ¹å¼ã¨ N-gram æ¹å¼ã®ã¿ã§ãããå½¢æ ç´ è§£æå¨ MeCab ãçµã¿è¾¼ãã ã¨ã㯠MeCab ã«ããåãã¡æ¸ãã®çµæãç¨ããå½¢æ ç´ æ¹å¼ãæå¹ã«ãªãã¾ãããã¼ã¯ãã¤ã¶ã¯ãã©ã°ã¤ã³ã¨ãã¦è¿½å ã§ãããããç¹å¾´çãªãã¼ã¯ã¼ãã®ã¿ãç´¢å¼èªã¨ãã¦æ¡ç¨ãããªã©ãç¬èªã®ãã¼ã¯ãã¤ã¶ãéçºãããã¨ãå¯è½ã§ãã"], +["å ±æå¯è½ãªã¹ãã¬ã¼ã¸ã¨åç §ããã¯ããªã¼", "CPU ã®ãã«ãã³ã¢åãé²ãã§ãããããåæã«è¤æ°ã®ã¯ã¨ãªãå®è¡ããããä¸ã¤ã®ã¯ã¨ãªãè¤æ°ã®ã¹ã¬ããã§å®è¡ããããããã¨ã®éè¦æ§ã¯ã¾ãã¾ãé«ã¾ã£ã¦ãã¾ãã\n\ngroonga ã®ã¹ãã¬ã¼ã¸ã¯ãè¤æ°ã®ã¹ã¬ããã»ããã»ã¹ã§å ±æãããã¨ãã§ãã¾ããã¾ããåç §ããã¯ããªã¼ãªãã¼ã¿æ§é ãæ¡ç¨ãã¦ãããããæ´æ°ã¯ã¨ãªãå®è¡ãã¦ããç¶æ³ã§ãåç §ã¯ã¨ãªãå®è¡ãããã¨ãã§ãã¾ããåç §ã¯ã¨ãªãå®è¡ã§ããç¶æ ãç¶æããªããæ´æ°ã¯ã¨ãªãå®è¡ã§ããã®ã§ããªã¢ã«ã¿ã¤ã ãªã·ã¹ãã ã«é©ãã¦ãã¾ããããã«ã¯ãMySQL ãä»ãã¦æ´æ°ã¯ã¨ãªãå®è¡ãã¦ããæä¸ã« groonga ã® HTTP ãµã¼ããä»ãã¦åç §ã¯ã¨ãªãå®è¡ãããªã©ãå¤å½©ãªéç¨ãå¯è½ã¨ãªã£ã¦ãã¾ãã"], +["ä½ç½®æ å ±ï¼ç·¯åº¦ã»çµåº¦ï¼æ¤ç´¢", "GPS ã«ä»£è¡¨ããã測ä½ã·ã¹ãã ãæè¼ããé«æ©è½ãªæºå¸¯ç«¯æ«ã®æ®åãªã©ã«ãã£ã¦ãä½ç½®æ å ±ãæ±ããµã¼ãã¹ã¯ã¾ãã¾ã便å©ã«ãªã£ã¦ãã¾ãããã¨ãã°ãè¿ãã«ããã¬ã¹ãã©ã³ãæ¢ãã¦ããã¨ãã¯ãç¾å¨å°ããã®è·é¢ãåºæºã¨ãã¦æ¤ç´¢ããããªããæ¤ç´¢çµæãå°å³ä¸ã«è¡¨ç¤ºãã¦ããããããªãµã¼ãã¹ã便å©ã§ãããã®ãããä½ç½®æ å ±æ¤ç´¢ãé«éã«å®ç¾ã§ãããã¨ãéè¦ã«ãªã£ã¦ãã¾ãã\n\ngroonga ã§ã¯è»¢ç½®ç´¢å¼ãå¿ç¨ãã¦é«éãªä½ç½®æ å ±æ¤ç´¢ãå®ç¾ãã¦ãã¾ããç©å½¢ã»åã«ããç¯å²æ¤ç´¢ã«å¯¾å¿ãã¦ããã»ããåºæºç¹ã®è¿ããåªå çã«æ¢ç´¢ããããã¨ãã§ãã¾ããã¾ããè·é¢è¨ç®ããµãã¼ããã¦ããã®ã§ãä½ç½®æ å ±æ¤ç´¢ã®çµæãåºæºç¹ããã®è·é¢ã«ãã£ã¦æ´åãããã¨ãå¯è½ã§ãã"], +["groonga ã©ã¤ãã©ãª", "Groonga ã®åºæ¬æ©è½ã¯ C ã©ã¤ãã©ãªã¨ãã¦æä¾ããã¦ããã®ã§ãä»»æã®ã¢ããªã±ã¼ã·ã§ã³ã«çµã¿è¾¼ãã§å©ç¨ãããã¨ãã§ãã¾ããC/C++ 以å¤ã«ã¤ãã¦ã¯ãRuby ãã groonga ãå©ç¨ããã©ã¤ãã©ãªãªã©ãé¢é£ããã¸ã§ã¯ãã«ããã¦æä¾ããã¦ãã¾ãã詳ãã㯠é¢é£ããã¸ã§ã¯ã ãåç §ãã¦ãã ããã"], +["groonga ãµã¼ã", "groonga ã«ã¯ãµã¼ãæ©è½ããããããã¬ã³ã¿ã«ãµã¼ããªã©ã®æ°ããã©ã¤ãã©ãªãã¤ã³ã¹ãã¼ã«ã§ããªãç°å¢ã«ããã¦ãå©ç¨ã§ãã¾ãã対å¿ãã¦ããã®ã¯ HTTP, memcached binary ãããã³ã«ãããã³ã« groonga ã®ç¬èªãããã³ã«ã§ãã gqtp ã§ãããµã¼ãã¨ãã¦å©ç¨ããã¨ãã¯ã¯ã¨ãªã®ãã£ãã·ã¥æ©è½ãæå¹ã«ãªããããåãã¯ã¨ãªãåãåã£ãã¨ãã¯å¿çæéãçããªãã¨ããç¹å¾´ãããã¾ãã"], +["groonga ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³", "groonga ã¯ç¬èªã®ã«ã©ã ã¹ãã¢ãæã¤åæåã®ãã¼ã¿ãã¼ã¹ã¨ãã¦ã®å´é¢ãæã£ã¦ãã¾ãããæ¢åã® RDBMS ã®ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã¨ãã¦å©ç¨ãããã¨ãã§ãã¾ãããã¨ãã°ãgroonga ããã¼ã¹ã¨ãã MySQL ã®ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã¨ã㦠mroonga ãéçºããã¦ãã¾ããmroonga 㯠MySQL ã®ãã©ã°ã¤ã³ã¨ãã¦åçã«ãã¼ããããã¨ãå¯è½ã§ãããgroonga ã®ã«ã©ã ã¹ãã¢ãã¹ãã¬ã¼ã¸ã¨ãã¦å©ç¨ããããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¨ã㦠groonga ã MyISAM ã InnoDB ã¨é£æºãããããããã¨ãã§ãã¾ããgroonga åä½ã§ã®å©ç¨ãããã³ã« MyISAM, InnoDB ã¨ã®é£æºã«ã¯ä¸é·ä¸çãããã®ã§ãç¨éã«å¿ãã¦é©åãªçµã¿åãããé¸ã¶ãã¨ã大åã§ãã詳ãã㯠é¢é£ããã¸ã§ã¯ã ãåç §ãã¦ãã ããã"] +] + +select Documents \ + --match_columns content --query 'groonga' \ + --output_columns '_key, snippet(content)' \ + --command_version 2 Added: test/command/suite/select/function/snippet/one.expected (+53 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/function/snippet/one.expected 2012-11-07 14:53:23 +0900 (51068eb) @@ -0,0 +1,53 @@ +table_create Documents TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Documents content COLUMN_SCALAR Text +[[0,0.0,0.0],true] +table_create Terms TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram +[[0,0.0,0.0],true] +column_create Terms document_index COLUMN_INDEX|WITH_POSITION Documents content +[[0,0.0,0.0],true] +load --table Documents +[ +["_key", "content"], +["groonga ã®æ¦è¦", "groonga ã¯è»¢ç½®ç´¢å¼ãç¨ããé«éã»é«ç²¾åº¦ãªå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ãããç»é²ãããææ¸ãããã«æ¤ç´¢çµæã«åæ ã§ãã¾ããã¾ããåç §ããããã¯ããã«æ´æ°ã§ãããã¨ãããå³ææ´æ°ã®å¿ è¦ãªã¢ããªã±ã¼ã·ã§ã³ã«ããã¦ãé«ãæ§è½ãçºæ®ãã¾ãã\n\nå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¨ãã¦éçºããã groonga ã§ãããç¬èªã®ã«ã©ã ã¹ãã¢ãæã¤åæåã®ãã¼ã¿ãã¼ã¹ã¨ãã¦ã®å´é¢ãæã£ã¦ãã¾ãããã®ãããMySQL ã PostgreSQL ãªã©ãæ¢åã®ä»£è¡¨çãªãã¼ã¿ãã¼ã¹ãè¦æã¨ããéè¨ã¯ã¨ãªãé«éã«å¦çã§ããã¨ããç¹å¾´ããããçµã¿åããã«ãã£ã¦å¼±ç¹ãè£ããããªä½¿ãæ¹ãã§ãã¾ãã\n\ngroonga ã®åºæ¬æ©è½ã¯ C ã©ã¤ãã©ãªã¨ãã¦æä¾ããã¦ãã¾ãããMySQL ã PostgreSQL ã¨é£æºãããããRuby ããå¼ã³åºããããããã¨ãã§ãã¾ãããã®ãããä»»æ ã®ã¢ããªã±ã¼ã·ã§ã³ã«çµã¿è¾¼ããã¨ãå¯è½ã§ãããå¤æ§ãªä½¿ãæ¹ãèãããã¾ãã èå³ã®ããæ¹ã¯ å©ç¨ä¾ ãã覧ãã ããã"], +["å ¨ææ¤ç´¢ã¨å³ææ´æ°", "ä¸è¬çãªãã¼ã¿ãã¼ã¹ã«ããã¦ã¯ã追å ã»åé¤ãªã©ã®æä½ãããã«åæ ããã¾ããä¸æ¹ãå ¨ææ¤ç´¢ã«ããã¦ã¯ã転置索å¼ãé次æ´æ°ã®é£ãããã¼ã¿æ§é ã§ãããã¨ãããææ¸ã®è¿½å ã»åé¤ã«å¯¾å¿ããªãã¨ã³ã¸ã³ãå°ãªãããã¾ããã\n\nããã«å¯¾ãã転置索å¼ãç¨ããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ãããªãããgroonga ã¯ææ¸ãçæéã§è¿½å ã»åé¤ãããã¨ãã§ãã¾ãããã®ä¸ãæ´æ°ããªããã§ãæ¤ç´¢ã§ããã¨ããåªããç¹å¾´ãæã£ã¦ãããããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¨ãã¦ã¯ã¨ã¦ãæè»æ§ãããã¾ããã¾ããè¤æ°ã®è»¢ç½®ç´¢å¼ãçµ±åãããããªéãå¦çãå¿ è¦ã¨ããªãã®ã§ãå®å®ãã¦é«ãæ§è½ãçºæ®ãããã¨ãæå¾ ã§ãã¾ãã"], +["ã«ã©ã ã¹ãã¢ã¨éè¨ã¯ã¨ãª", "ç¾ä»£ã¯ãã¤ã³ã¿ã¼ããããæ å ±æºã¨ããã°ããããã§ãæ å ±ãåéã§ããæ代ã§ããããããè¨å¤§ãªæ å ±ããæçãªæ å ±ãå¼ãåºãã®ã¯å°é£ã§ãããå¤é¢çãªåæã«ãã試è¡é¯èª¤ãå¿ è¦ã¨ãªãã¾ãããã¨ãã°ãæ¥ä»ãæé帯ã«ããçµãè¾¼ãã§ã¿ãããå°åã«ããçµãè¾¼ãã§ã¿ãããæ§å¥ãå¹´é½¢ã«ããçµãè¾¼ãã§ã¿ãããããã¨ã§ããããããã¦ããã®ãããªã¨ãã«ä¾¿å©ãªåå¨ãéè¨ã¯ã¨ãªã§ãã\n\néè¨ã¯ã¨ãªã¨ã¯ãæå®ããã«ã©ã ã®å¤ã«ãã£ã¦ã¬ã³ã¼ããã°ã«ã¼ãåããåã°ã«ã¼ãã«å«ã¾ããã¬ã³ã¼ãã®æ°ãæ±ããã¯ã¨ãªã§ãããã¨ãã°ãå°åã® ID ãæ ¼ç´ãã¦ããã«ã©ã ãæå®ããã°ãå°åæ¯ã®ã¬ã³ã¼ãæ°ãæ±ã¾ãã¾ããæ¥ä»ã®ã«ã©ã ãæå®ããã¨ãã®åºåãã°ã©ãåããã°ãã¬ã³ã¼ãæ°ã®æéå¤åã è¦è¦åãããã¨ãã§ãã¾ããããã«ãå°åã«ããçµãè¾¼ã¿ã¨æ¥ä»ã«å¯¾ããéè¨ã¯ã¨ãªãçµã¿åãããã°ãç¹å®ã®å°åã«ãããã¬ã³ã¼ãæ°ã®æéå¤åãè¦è¦åãã¨ãå¯è½ã§ãããã®ããã«ã尺度ãèªç±ã«é¸æãã¦çµãè¾¼ã¿ã»éè¨ã§ãããã¨ã¯ãè¨å¤§ãªæ å ±ãæ±ãä¸ã§ã¨ã¦ãéè¦ã«ãªãã¾ãã\n\ngroonga ãéè¨ã¯ã¨ãªãé«éã«å¦çã§ããçç±ã¯ããã¼ã¿ãã¼ã¹ã®è«çæ§é ã«ã«ã©ã ã¹ãã¢ãæ¡ç¨ãã¦ããããã§ããéè¨ã¯ã¨ãªãåç §ããã®ã¯æå®ãããã«ã©ã ã®ã¿ã§ãããããã«ã©ã åä½ã§ãã¼ã¿ãæ ¼ç´ããåæåã®ãã¼ã¿ãã¼ã¹ã§ã¯ãå¿ è¦ãªã«ã©ã ã®ã¿ãç¡é§ãªãèªã¿åºãããã¨ãå©ç¹ã¨ãªãã¾ããä¸æ¹ãã¬ã³ã¼ãåä½ã§ãã¼ã¿ãæ ¼ç´ããè¡æåã®ãã¼ã¿ãã¼ã¹ã§ã¯ãé£æ¥ããã«ã©ã ãã¾ã¨ãã¦èªã¿åºãã¦ãã¾ããã¨ãæ¬ ç¹ã¨ãªãã¾ãã"], +["転置索å¼ã¨ãã¼ã¯ãã¤ã¶", "転置索å¼ã¯å¤§è¦æ¨¡ãªå ¨ææ¤ç´¢ã«ç¨ããããä¼çµ±çãªãã¼ã¿æ§é ã§ãã転置索å¼ãç¨ããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ã¯ãææ¸ã追å ããã¨ãã«ç´¢å¼èªãè¨é²ãã¦ãããæ¤ç´¢ããã¨ãã¯ã¯ã¨ãªãç´¢å¼èªã«åå²ãã¦åºç¾ææ¸ãæ±ãã¾ãããã®ãããææ¸ãã¯ã¨ãªããç´¢å¼èªãæãåºãæ¹æ³ãéè¦ã«ãªãã¾ãã\n\nãã¼ã¯ãã¤ã¶ã¯ãæååããç´¢å¼èªãæãåºãã¢ã¸ã¥ã¼ã«ã§ããæ¥æ¬èªã対象ã¨ããå ¨ææ¤ç´¢ã«ããã¦ã¯ãå½¢æ ç´ ãç´¢å¼èªã¨ãã¦æãåºãæ¹å¼ã¨æå N-gram ãæãåºãæ¹å¼ã®ããããããããã¯ä¸¡æ¹ãç¨ããã®ãä¸è¬çã§ããå½¢æ ç´ æ¹å¼ã¯æ¤ç´¢æéãç´¢å¼ãµã¤ãºã®é¢ã§åªãã¦ããã»ããæ¤ç´¢çµæã«ä¸è¦ãªææ¸ãå«ã¾ãã«ããã¨ããå©ç¹ãæã£ã¦ãã¾ããä¸æ¹ãN-gram æ¹å¼ã«ã¯æ¤ç´¢æ¼ããçºçãã«ããã¨ããå©ç¹ã ãããç¶æ³ã«ãã£ã¦é©ããæ¹å¼ãé¸æãããã¨ãæã¾ããã¨ããã¦ãã¾ãã\n\ngroonga ã¯å½¢æ ç´ æ¹å¼ã¨ N-gram æ¹å¼ã®ä¸¡æ¹ã«å¯¾å¿ãã¦ãã¾ããåæç¶æ ã§å©ç¨ã§ãããã¼ã¯ãã¤ã¶ã¯ç©ºç½ãåºåãæåã¨ãã¦ç¨ããæ¹å¼ã¨ N-gram æ¹å¼ã®ã¿ã§ãããå½¢æ ç´ è§£æå¨ MeCab ãçµã¿è¾¼ãã ã¨ã㯠MeCab ã«ããåãã¡æ¸ãã®çµæãç¨ããå½¢æ ç´ æ¹å¼ãæå¹ã«ãªãã¾ãããã¼ã¯ãã¤ã¶ã¯ãã©ã°ã¤ã³ã¨ãã¦è¿½å ã§ãããããç¹å¾´çãªãã¼ã¯ã¼ãã®ã¿ãç´¢å¼èªã¨ãã¦æ¡ç¨ãããªã©ãç¬èªã®ãã¼ã¯ãã¤ã¶ãéçºãããã¨ãå¯è½ã§ãã"], +["å ±æå¯è½ãªã¹ãã¬ã¼ã¸ã¨åç §ããã¯ããªã¼", "CPU ã®ãã«ãã³ã¢åãé²ãã§ãããããåæã«è¤æ°ã®ã¯ã¨ãªãå®è¡ããããä¸ã¤ã®ã¯ã¨ãªãè¤æ°ã®ã¹ã¬ããã§å®è¡ããããããã¨ã®éè¦æ§ã¯ã¾ãã¾ãé«ã¾ã£ã¦ãã¾ãã\n\ngroonga ã®ã¹ãã¬ã¼ã¸ã¯ãè¤æ°ã®ã¹ã¬ããã»ããã»ã¹ã§å ±æãããã¨ãã§ãã¾ããã¾ããåç §ããã¯ããªã¼ãªãã¼ã¿æ§é ãæ¡ç¨ãã¦ãããããæ´æ°ã¯ã¨ãªãå®è¡ãã¦ããç¶æ³ã§ãåç §ã¯ã¨ãªãå®è¡ãããã¨ãã§ãã¾ããåç §ã¯ã¨ãªãå®è¡ã§ããç¶æ ãç¶æããªããæ´æ°ã¯ã¨ãªãå®è¡ã§ããã®ã§ããªã¢ã«ã¿ã¤ã ãªã·ã¹ãã ã«é©ãã¦ãã¾ããããã«ã¯ãMySQL ãä»ãã¦æ´æ°ã¯ã¨ãªãå®è¡ãã¦ããæä¸ã« groonga ã® HTTP ãµã¼ããä»ãã¦åç §ã¯ã¨ãªãå®è¡ãããªã©ãå¤å½©ãªéç¨ãå¯è½ã¨ãªã£ã¦ãã¾ãã"], +["ä½ç½®æ å ±ï¼ç·¯åº¦ã»çµåº¦ï¼æ¤ç´¢", "GPS ã«ä»£è¡¨ããã測ä½ã·ã¹ãã ãæè¼ããé«æ©è½ãªæºå¸¯ç«¯æ«ã®æ®åãªã©ã«ãã£ã¦ãä½ç½®æ å ±ãæ±ããµã¼ãã¹ã¯ã¾ãã¾ã便å©ã«ãªã£ã¦ãã¾ãããã¨ãã°ãè¿ãã«ããã¬ã¹ãã©ã³ãæ¢ãã¦ããã¨ãã¯ãç¾å¨å°ããã®è·é¢ãåºæºã¨ãã¦æ¤ç´¢ããããªããæ¤ç´¢çµæãå°å³ä¸ã«è¡¨ç¤ºãã¦ããããããªãµã¼ãã¹ã便å©ã§ãããã®ãããä½ç½®æ å ±æ¤ç´¢ãé«éã«å®ç¾ã§ãããã¨ãéè¦ã«ãªã£ã¦ãã¾ãã\n\ngroonga ã§ã¯è»¢ç½®ç´¢å¼ãå¿ç¨ãã¦é«éãªä½ç½®æ å ±æ¤ç´¢ãå®ç¾ãã¦ãã¾ããç©å½¢ã»åã«ããç¯å²æ¤ç´¢ã«å¯¾å¿ãã¦ããã»ããåºæºç¹ã®è¿ããåªå çã«æ¢ç´¢ããããã¨ãã§ãã¾ããã¾ããè·é¢è¨ç®ããµãã¼ããã¦ããã®ã§ãä½ç½®æ å ±æ¤ç´¢ã®çµæãåºæºç¹ããã®è·é¢ã«ãã£ã¦æ´åãããã¨ãå¯è½ã§ãã"], +["groonga ã©ã¤ãã©ãª", "Groonga ã®åºæ¬æ©è½ã¯ C ã©ã¤ãã©ãªã¨ãã¦æä¾ããã¦ããã®ã§ãä»»æã®ã¢ããªã±ã¼ã·ã§ã³ã«çµã¿è¾¼ãã§å©ç¨ãããã¨ãã§ãã¾ããC/C++ 以å¤ã«ã¤ãã¦ã¯ãRuby ãã groonga ãå©ç¨ããã©ã¤ãã©ãªãªã©ãé¢é£ããã¸ã§ã¯ãã«ããã¦æä¾ããã¦ãã¾ãã詳ãã㯠é¢é£ããã¸ã§ã¯ã ãåç §ãã¦ãã ããã"], +["groonga ãµã¼ã", "groonga ã«ã¯ãµã¼ãæ©è½ããããããã¬ã³ã¿ã«ãµã¼ããªã©ã®æ°ããã©ã¤ãã©ãªãã¤ã³ã¹ãã¼ã«ã§ããªãç°å¢ã«ããã¦ãå©ç¨ã§ãã¾ãã対å¿ãã¦ããã®ã¯ HTTP, memcached binary ãããã³ã«ãããã³ã« groonga ã®ç¬èªãããã³ã«ã§ãã gqtp ã§ãããµã¼ãã¨ãã¦å©ç¨ããã¨ãã¯ã¯ã¨ãªã®ãã£ãã·ã¥æ©è½ãæå¹ã«ãªããããåãã¯ã¨ãªãåãåã£ãã¨ãã¯å¿çæéãçããªãã¨ããç¹å¾´ãããã¾ãã"], +["groonga ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³", "groonga ã¯ç¬èªã®ã«ã©ã ã¹ãã¢ãæã¤åæåã®ãã¼ã¿ãã¼ã¹ã¨ãã¦ã®å´é¢ãæã£ã¦ãã¾ãããæ¢åã® RDBMS ã®ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã¨ãã¦å©ç¨ãããã¨ãã§ãã¾ãããã¨ãã°ãgroonga ããã¼ã¹ã¨ãã MySQL ã®ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã¨ã㦠mroonga ãéçºããã¦ãã¾ããmroonga 㯠MySQL ã®ãã©ã°ã¤ã³ã¨ãã¦åçã«ãã¼ããããã¨ãå¯è½ã§ãããgroonga ã®ã«ã©ã ã¹ãã¢ãã¹ãã¬ã¼ã¸ã¨ãã¦å©ç¨ããããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¨ã㦠groonga ã MyISAM ã InnoDB ã¨é£æºãããããããã¨ãã§ãã¾ããgroonga åä½ã§ã®å©ç¨ãããã³ã« MyISAM, InnoDB ã¨ã®é£æºã«ã¯ä¸é·ä¸çãããã®ã§ãç¨éã«å¿ãã¦é©åãªçµã¿åãããé¸ã¶ãã¨ã大åã§ãã詳ãã㯠é¢é£ããã¸ã§ã¯ã ãåç §ãã¦ãã ããã"] +] +[[0,0.0,0.0],9] +select Documents --match_columns content --query 'mroonga MySQL' --output_columns '_key, snippet(content)' --command_version 2 +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 1 + ], + [ + [ + "_key", + "ShortText" + ], + [ + "snippet", + "null" + ] + ], + [ + "groonga ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³", + [ + "ããã¨ãã°ãgroonga ããã¼ã¹ã¨ãã <span class=\"keyword\">MySQL</span> ã®ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã¨ã㦠<span class=\"keyword\">mroonga</span> ãéçºããã¦ãã¾ãã<span class=\"keyword\">mroonga</span> 㯠<span class=\"keyword\">MySQL</span> ã®ãã©ã°ã¤ã³ã¨ãã¦åçã«ãã¼ãã" + ] + ] + ] + ] +] Added: test/command/suite/select/function/snippet/one.test (+24 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/function/snippet/one.test 2012-11-07 14:53:23 +0900 (8bd0a6a) @@ -0,0 +1,24 @@ +table_create Documents TABLE_HASH_KEY ShortText +column_create Documents content COLUMN_SCALAR Text + +table_create Terms TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram +column_create Terms document_index COLUMN_INDEX|WITH_POSITION Documents content + +load --table Documents +[ +["_key", "content"], +["groonga ã®æ¦è¦", "groonga ã¯è»¢ç½®ç´¢å¼ãç¨ããé«éã»é«ç²¾åº¦ãªå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ãããç»é²ãããææ¸ãããã«æ¤ç´¢çµæã«åæ ã§ãã¾ããã¾ããåç §ããããã¯ããã«æ´æ°ã§ãããã¨ãããå³ææ´æ°ã®å¿ è¦ãªã¢ããªã±ã¼ã·ã§ã³ã«ããã¦ãé«ãæ§è½ãçºæ®ãã¾ãã\n\nå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¨ãã¦éçºããã groonga ã§ãããç¬èªã®ã«ã©ã ã¹ãã¢ãæã¤åæåã®ãã¼ã¿ãã¼ã¹ã¨ãã¦ã®å´é¢ãæã£ã¦ãã¾ãããã®ãããMySQL ã PostgreSQL ãªã©ãæ¢åã®ä»£è¡¨çãªãã¼ã¿ãã¼ã¹ãè¦æã¨ããéè¨ã¯ã¨ãªãé«éã«å¦çã§ããã¨ããç¹å¾´ããããçµã¿åããã«ãã£ã¦å¼±ç¹ãè£ããããªä½¿ãæ¹ãã§ãã¾ãã\n\ngroonga ã®åºæ¬æ©è½ã¯ C ã©ã¤ãã©ãªã¨ãã¦æä¾ããã¦ãã¾ãããMySQL ã PostgreSQL ã¨é£æºãããããRuby ããå¼ã³åºããããããã¨ãã§ãã¾ãããã®ãããä»»æ ã®ã¢ããªã±ã¼ã·ã§ã³ã«çµã¿è¾¼ããã¨ãå¯è½ã§ãããå¤æ§ãªä½¿ãæ¹ãèãããã¾ãã èå³ã®ããæ¹ã¯ å©ç¨ä¾ ãã覧ãã ããã"], +["å ¨ææ¤ç´¢ã¨å³ææ´æ°", "ä¸è¬çãªãã¼ã¿ãã¼ã¹ã«ããã¦ã¯ã追å ã»åé¤ãªã©ã®æä½ãããã«åæ ããã¾ããä¸æ¹ãå ¨ææ¤ç´¢ã«ããã¦ã¯ã転置索å¼ãé次æ´æ°ã®é£ãããã¼ã¿æ§é ã§ãããã¨ãããææ¸ã®è¿½å ã»åé¤ã«å¯¾å¿ããªãã¨ã³ã¸ã³ãå°ãªãããã¾ããã\n\nããã«å¯¾ãã転置索å¼ãç¨ããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ãããªãããgroonga ã¯ææ¸ãçæéã§è¿½å ã»åé¤ãããã¨ãã§ãã¾ãããã®ä¸ãæ´æ°ããªããã§ãæ¤ç´¢ã§ããã¨ããåªããç¹å¾´ãæã£ã¦ãããããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¨ãã¦ã¯ã¨ã¦ãæè»æ§ãããã¾ããã¾ããè¤æ°ã®è»¢ç½®ç´¢å¼ãçµ±åãããããªéãå¦çãå¿ è¦ã¨ããªãã®ã§ãå®å®ãã¦é«ãæ§è½ãçºæ®ãããã¨ãæå¾ ã§ãã¾ãã"], +["ã«ã©ã ã¹ãã¢ã¨éè¨ã¯ã¨ãª", "ç¾ä»£ã¯ãã¤ã³ã¿ã¼ããããæ å ±æºã¨ããã°ããããã§ãæ å ±ãåéã§ããæ代ã§ããããããè¨å¤§ãªæ å ±ããæçãªæ å ±ãå¼ãåºãã®ã¯å°é£ã§ãããå¤é¢çãªåæã«ãã試è¡é¯èª¤ãå¿ è¦ã¨ãªãã¾ãããã¨ãã°ãæ¥ä»ãæé帯ã«ããçµãè¾¼ãã§ã¿ãããå°åã«ããçµãè¾¼ãã§ã¿ãããæ§å¥ãå¹´é½¢ã«ããçµãè¾¼ãã§ã¿ãããããã¨ã§ããããããã¦ããã®ãããªã¨ãã«ä¾¿å©ãªåå¨ãéè¨ã¯ã¨ãªã§ãã\n\néè¨ã¯ã¨ãªã¨ã¯ãæå®ããã«ã©ã ã®å¤ã«ãã£ã¦ã¬ã³ã¼ããã°ã«ã¼ãåããåã°ã«ã¼ãã«å«ã¾ããã¬ã³ã¼ãã®æ°ãæ±ããã¯ã¨ãªã§ãããã¨ãã°ãå°åã® ID ãæ ¼ç´ãã¦ããã«ã©ã ãæå®ããã°ãå°åæ¯ã®ã¬ã³ã¼ãæ°ãæ±ã¾ãã¾ããæ¥ä»ã®ã«ã©ã ãæå®ããã¨ãã®åºåãã°ã©ãåããã°ãã¬ã³ã¼ãæ°ã®æéå¤åã è¦è¦åãããã¨ãã§ãã¾ããããã«ãå°åã«ããçµãè¾¼ã¿ã¨æ¥ä»ã«å¯¾ããéè¨ã¯ã¨ãªãçµã¿åãããã°ãç¹å®ã®å°åã«ãããã¬ã³ã¼ãæ°ã®æéå¤åãè¦è¦åãã¨ãå¯è½ã§ãããã®ããã«ã尺度ãèªç±ã«é¸æãã¦çµãè¾¼ã¿ã»éè¨ã§ãããã¨ã¯ãè¨å¤§ãªæ å ±ãæ±ãä¸ã§ã¨ã¦ãéè¦ã«ãªãã¾ãã\n\ngroonga ãéè¨ã¯ã¨ãªãé«éã«å¦çã§ããçç±ã¯ããã¼ã¿ãã¼ã¹ã®è«çæ§é ã«ã«ã©ã ã¹ãã¢ãæ¡ç¨ãã¦ããããã§ããéè¨ã¯ã¨ãªãåç §ããã®ã¯æå®ãããã«ã©ã ã®ã¿ã§ãããããã«ã©ã åä½ã§ãã¼ã¿ãæ ¼ç´ããåæåã®ãã¼ã¿ãã¼ã¹ã§ã¯ãå¿ è¦ãªã«ã©ã ã®ã¿ãç¡é§ãªãèªã¿åºãããã¨ãå©ç¹ã¨ãªãã¾ããä¸æ¹ãã¬ã³ã¼ãåä½ã§ãã¼ã¿ãæ ¼ç´ããè¡æåã®ãã¼ã¿ãã¼ã¹ã§ã¯ãé£æ¥ããã«ã©ã ãã¾ã¨ãã¦èªã¿åºãã¦ãã¾ããã¨ãæ¬ ç¹ã¨ãªãã¾ãã"], +["転置索å¼ã¨ãã¼ã¯ãã¤ã¶", "転置索å¼ã¯å¤§è¦æ¨¡ãªå ¨ææ¤ç´¢ã«ç¨ããããä¼çµ±çãªãã¼ã¿æ§é ã§ãã転置索å¼ãç¨ããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã§ã¯ãææ¸ã追å ããã¨ãã«ç´¢å¼èªãè¨é²ãã¦ãããæ¤ç´¢ããã¨ãã¯ã¯ã¨ãªãç´¢å¼èªã«åå²ãã¦åºç¾ææ¸ãæ±ãã¾ãããã®ãããææ¸ãã¯ã¨ãªããç´¢å¼èªãæãåºãæ¹æ³ãéè¦ã«ãªãã¾ãã\n\nãã¼ã¯ãã¤ã¶ã¯ãæååããç´¢å¼èªãæãåºãã¢ã¸ã¥ã¼ã«ã§ããæ¥æ¬èªã対象ã¨ããå ¨ææ¤ç´¢ã«ããã¦ã¯ãå½¢æ ç´ ãç´¢å¼èªã¨ãã¦æãåºãæ¹å¼ã¨æå N-gram ãæãåºãæ¹å¼ã®ããããããããã¯ä¸¡æ¹ãç¨ããã®ãä¸è¬çã§ããå½¢æ ç´ æ¹å¼ã¯æ¤ç´¢æéãç´¢å¼ãµã¤ãºã®é¢ã§åªãã¦ããã»ããæ¤ç´¢çµæã«ä¸è¦ãªææ¸ãå«ã¾ãã«ããã¨ããå©ç¹ãæã£ã¦ãã¾ããä¸æ¹ãN-gram æ¹å¼ã«ã¯æ¤ç´¢æ¼ããçºçãã«ããã¨ããå©ç¹ã ãããç¶æ³ã«ãã£ã¦é©ããæ¹å¼ãé¸æãããã¨ãæã¾ããã¨ããã¦ãã¾ãã\n\ngroonga ã¯å½¢æ ç´ æ¹å¼ã¨ N-gram æ¹å¼ã®ä¸¡æ¹ã«å¯¾å¿ãã¦ãã¾ããåæç¶æ ã§å©ç¨ã§ãããã¼ã¯ãã¤ã¶ã¯ç©ºç½ãåºåãæåã¨ãã¦ç¨ããæ¹å¼ã¨ N-gram æ¹å¼ã®ã¿ã§ãããå½¢æ ç´ è§£æå¨ MeCab ãçµã¿è¾¼ãã ã¨ã㯠MeCab ã«ããåãã¡æ¸ãã®çµæãç¨ããå½¢æ ç´ æ¹å¼ãæå¹ã«ãªãã¾ãããã¼ã¯ãã¤ã¶ã¯ãã©ã°ã¤ã³ã¨ãã¦è¿½å ã§ãããããç¹å¾´çãªãã¼ã¯ã¼ãã®ã¿ãç´¢å¼èªã¨ãã¦æ¡ç¨ãããªã©ãç¬èªã®ãã¼ã¯ãã¤ã¶ãéçºãããã¨ãå¯è½ã§ãã"], +["å ±æå¯è½ãªã¹ãã¬ã¼ã¸ã¨åç §ããã¯ããªã¼", "CPU ã®ãã«ãã³ã¢åãé²ãã§ãããããåæã«è¤æ°ã®ã¯ã¨ãªãå®è¡ããããä¸ã¤ã®ã¯ã¨ãªãè¤æ°ã®ã¹ã¬ããã§å®è¡ããããããã¨ã®éè¦æ§ã¯ã¾ãã¾ãé«ã¾ã£ã¦ãã¾ãã\n\ngroonga ã®ã¹ãã¬ã¼ã¸ã¯ãè¤æ°ã®ã¹ã¬ããã»ããã»ã¹ã§å ±æãããã¨ãã§ãã¾ããã¾ããåç §ããã¯ããªã¼ãªãã¼ã¿æ§é ãæ¡ç¨ãã¦ãããããæ´æ°ã¯ã¨ãªãå®è¡ãã¦ããç¶æ³ã§ãåç §ã¯ã¨ãªãå®è¡ãããã¨ãã§ãã¾ããåç §ã¯ã¨ãªãå®è¡ã§ããç¶æ ãç¶æããªããæ´æ°ã¯ã¨ãªãå®è¡ã§ããã®ã§ããªã¢ã«ã¿ã¤ã ãªã·ã¹ãã ã«é©ãã¦ãã¾ããããã«ã¯ãMySQL ãä»ãã¦æ´æ°ã¯ã¨ãªãå®è¡ãã¦ããæä¸ã« groonga ã® HTTP ãµã¼ããä»ãã¦åç §ã¯ã¨ãªãå®è¡ãããªã©ãå¤å½©ãªéç¨ãå¯è½ã¨ãªã£ã¦ãã¾ãã"], +["ä½ç½®æ å ±ï¼ç·¯åº¦ã»çµåº¦ï¼æ¤ç´¢", "GPS ã«ä»£è¡¨ããã測ä½ã·ã¹ãã ãæè¼ããé«æ©è½ãªæºå¸¯ç«¯æ«ã®æ®åãªã©ã«ãã£ã¦ãä½ç½®æ å ±ãæ±ããµã¼ãã¹ã¯ã¾ãã¾ã便å©ã«ãªã£ã¦ãã¾ãããã¨ãã°ãè¿ãã«ããã¬ã¹ãã©ã³ãæ¢ãã¦ããã¨ãã¯ãç¾å¨å°ããã®è·é¢ãåºæºã¨ãã¦æ¤ç´¢ããããªããæ¤ç´¢çµæãå°å³ä¸ã«è¡¨ç¤ºãã¦ããããããªãµã¼ãã¹ã便å©ã§ãããã®ãããä½ç½®æ å ±æ¤ç´¢ãé«éã«å®ç¾ã§ãããã¨ãéè¦ã«ãªã£ã¦ãã¾ãã\n\ngroonga ã§ã¯è»¢ç½®ç´¢å¼ãå¿ç¨ãã¦é«éãªä½ç½®æ å ±æ¤ç´¢ãå®ç¾ãã¦ãã¾ããç©å½¢ã»åã«ããç¯å²æ¤ç´¢ã«å¯¾å¿ãã¦ããã»ããåºæºç¹ã®è¿ããåªå çã«æ¢ç´¢ããããã¨ãã§ãã¾ããã¾ããè·é¢è¨ç®ããµãã¼ããã¦ããã®ã§ãä½ç½®æ å ±æ¤ç´¢ã®çµæãåºæºç¹ããã®è·é¢ã«ãã£ã¦æ´åãããã¨ãå¯è½ã§ãã"], +["groonga ã©ã¤ãã©ãª", "Groonga ã®åºæ¬æ©è½ã¯ C ã©ã¤ãã©ãªã¨ãã¦æä¾ããã¦ããã®ã§ãä»»æã®ã¢ããªã±ã¼ã·ã§ã³ã«çµã¿è¾¼ãã§å©ç¨ãããã¨ãã§ãã¾ããC/C++ 以å¤ã«ã¤ãã¦ã¯ãRuby ãã groonga ãå©ç¨ããã©ã¤ãã©ãªãªã©ãé¢é£ããã¸ã§ã¯ãã«ããã¦æä¾ããã¦ãã¾ãã詳ãã㯠é¢é£ããã¸ã§ã¯ã ãåç §ãã¦ãã ããã"], +["groonga ãµã¼ã", "groonga ã«ã¯ãµã¼ãæ©è½ããããããã¬ã³ã¿ã«ãµã¼ããªã©ã®æ°ããã©ã¤ãã©ãªãã¤ã³ã¹ãã¼ã«ã§ããªãç°å¢ã«ããã¦ãå©ç¨ã§ãã¾ãã対å¿ãã¦ããã®ã¯ HTTP, memcached binary ãããã³ã«ãããã³ã« groonga ã®ç¬èªãããã³ã«ã§ãã gqtp ã§ãããµã¼ãã¨ãã¦å©ç¨ããã¨ãã¯ã¯ã¨ãªã®ãã£ãã·ã¥æ©è½ãæå¹ã«ãªããããåãã¯ã¨ãªãåãåã£ãã¨ãã¯å¿çæéãçããªãã¨ããç¹å¾´ãããã¾ãã"], +["groonga ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³", "groonga ã¯ç¬èªã®ã«ã©ã ã¹ãã¢ãæã¤åæåã®ãã¼ã¿ãã¼ã¹ã¨ãã¦ã®å´é¢ãæã£ã¦ãã¾ãããæ¢åã® RDBMS ã®ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã¨ãã¦å©ç¨ãããã¨ãã§ãã¾ãããã¨ãã°ãgroonga ããã¼ã¹ã¨ãã MySQL ã®ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã¨ã㦠mroonga ãéçºããã¦ãã¾ããmroonga 㯠MySQL ã®ãã©ã°ã¤ã³ã¨ãã¦åçã«ãã¼ããããã¨ãå¯è½ã§ãããgroonga ã®ã«ã©ã ã¹ãã¢ãã¹ãã¬ã¼ã¸ã¨ãã¦å©ç¨ããããå ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¨ã㦠groonga ã MyISAM ã InnoDB ã¨é£æºãããããããã¨ãã§ãã¾ããgroonga åä½ã§ã®å©ç¨ãããã³ã« MyISAM, InnoDB ã¨ã®é£æºã«ã¯ä¸é·ä¸çãããã®ã§ãç¨éã«å¿ãã¦é©åãªçµã¿åãããé¸ã¶ãã¨ã大åã§ãã詳ãã㯠é¢é£ããã¸ã§ã¯ã ãåç §ãã¦ãã ããã"] +] + +select Documents \ + --match_columns content --query 'mroonga MySQL' \ + --output_columns '_key, snippet(content)' \ + --command_version 2 -------------- next part -------------- HTML����������������������������... Download