.. -*- rst -*- .. highlightlang:: none .. groonga-command .. table_remove Blog1 .. table_remove IndexBlog1 .. table_remove Blog2 .. table_remove IndexBlog2 match_columnsãã©ã¡ã¼ã¿ ======================= è¤æ°ã®ã«ã©ã ã対象ã¨ããå ¨ææ¤ç´¢ -------------------------------- groongaã§ã¯ãè¤æ°ã®ã«ã©ã ã対象ã¨ããå ¨ææ¤ç´¢ãè¡ããã¨ãã§ãã¾ããä¾ãã°ãããã°ã®ãã¼ãã«ã§ãã¿ã¤ãã«ã¨å 容ã¨ãããããå¥ã®ã«ã©ã ã«å ¥ã£ããã®ãããã¨ãã¾ãããããã¿ã¤ãã«ãããã¯å 容ã«ç¹å®ã®åèªãå«ããæ¤ç´¢ãè¡ãããã¨ãã¾ãã ãã®å ´åã2ã¤ã®ã¤ã³ããã¯ã¹ä½ææ¹å¼ãããã¾ãã1ã¤ã¯ãããããã®ã«ã©ã ã«1ã¤ãã¤ã¤ã³ããã¯ã¹ãä»ä¸ããæ¹å¼ã§ãããã1ã¤ã¯ãè¤æ°ã®ã«ã©ã ã«å¯¾ãã¦1ã¤ã®ã¤ã³ããã¯ã¹ãä»ä¸ããæ¹å¼ã§ããgroongaã§ã¯ãã©ã¡ãã®å½¢å¼ã®ã¤ã³ããã¯ã¹ãåå¨ãã¦ããå ´åã§ããåä¸ã®è¨æ³ã§å ¨ææ¤ç´¢ãè¡ããã¨ãã§ãã¾ãã ã«ã©ã ãã¨ã«ã¤ã³ããã¯ã¹ãä»ä¸ããå ´å ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Blog1ãã¼ãã«ãä½ããã¿ã¤ãã«æååã®titleã«ã©ã ãæ¬æã®messageã«ã©ã ã追å ãã¦ãã¾ãã ã¤ã³ããã¯ã¹ç¨ã®IndexBlog1ãã¼ãã«ãä½ããtitleã«ã©ã ã®ã¤ã³ããã¯ã¹ç¨ã«index_titleã«ã©ã ãmessageã«ã©ã ã®ã¤ã³ããã¯ç¨ã«index_messageã«ã©ã ã¨ããããã1ã«ã©ã ãã¨ã«1ã¤ãã¤è¿½å ãã¦ãã¾ãã .. groonga-command .. include:: ../example/tutorial/match_columns-1.log .. table_create --name Blog1 --flags TABLE_HASH_KEY --key_type ShortText .. column_create --table Blog1 --name title --flags COLUMN_SCALAR --type ShortText .. column_create --table Blog1 --name message --flags COLUMN_SCALAR --type ShortText .. table_create --name IndexBlog1 --flags TABLE_PAT_KEY|KEY_NORMALIZE --key_type ShortText --default_tokenizer TokenBigram .. column_create --table IndexBlog1 --name index_title --flags COLUMN_INDEX|WITH_POSITION --type Blog1 --source title .. column_create --table IndexBlog1 --name index_message --flags COLUMN_INDEX|WITH_POSITION --type Blog1 --source message .. load --table Blog1 .. [ .. {"_key":"grn1","title":"groonga test","message":"groonga message"}, .. {"_key":"grn2","title":"baseball result","message":"rakutan eggs 4 - 4 groonga moritars"}, .. {"_key":"grn3","title":"groonga message","message":"none"} .. ] match_columnsãªãã·ã§ã³ã§ãæ¤ç´¢å¯¾è±¡ã®ã«ã©ã ãè¤æ°æå®ãããã¨ãåºæ¥ã¾ããæ¤ç´¢ããæååã¯queryãªãã·ã§ã³ã§æå®ãã¾ããããã使ããã¨ã§ãã¿ã¤ãã«ã¨æ¬æãå ¨ææ¤ç´¢ãããã¨ãã§ãã¾ãã å®éã«æ¤ç´¢ãã¦ã¿ã¾ãããã .. groonga-command .. include:: ../example/tutorial/match_columns-2.log .. select --table Blog1 --match_columns title||message --query groonga .. select --table Blog1 --match_columns title||message --query message .. select --table Blog1 --match_columns title --query message è¤æ°ã®ã«ã©ã ã«ã¾ããã£ãã¤ã³ããã¯ã¹ãä»ä¸ããå ´å ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ å 容ã¯ä¸ã®ä¾ã¨ã»ã¼åãã§ãããtitleã¨messageã®2ã¤ã®ã«ã©ã ã«å¯¾ããã¤ã³ããã¯ã¹ãå ±éã«ãªã£ã¦ãããã¤ã³ããã¯ã¹ã«ã©ã ã1ã¤ããããã¾ããã å ±éã®ã¤ã³ããã¯ã¹ãç¨ãã¦ããtitleã«ã©ã ã®ã¿ã§ã®æ¤ç´¢ãmessageã«ã©ã ã®ã¿ã§ã®æ¤ç´¢ãtitleãããã¯messageã«ã©ã ã§ã®æ¤ç´¢ãå ¨ã¦ã®æ¤ç´¢ãè¡ããã¨ãã§ãã¾ãã .. groonga-command .. include:: ../example/tutorial/match_columns-3.log .. table_create --name Blog2 --flags TABLE_HASH_KEY --key_type ShortText .. column_create --table Blog2 --name title --flags COLUMN_SCALAR --type ShortText .. column_create --table Blog2 --name message --flags COLUMN_SCALAR --type ShortText .. table_create --name IndexBlog2 --flags TABLE_PAT_KEY|KEY_NORMALIZE --key_type ShortText --default_tokenizer TokenBigram .. column_create --table IndexBlog2 --name index_blog --flags COLUMN_INDEX|WITH_POSITION|WITH_SECTION --type Blog2 --source title,message .. load --table Blog2 .. [ .. {"_key":"grn1","title":"groonga test","message":"groonga message"}, .. {"_key":"grn2","title":"baseball result","message":"rakutan eggs 4 - 4 groonga moritars"}, .. {"_key":"grn3","title":"groonga message","message":"none"} .. ] å®éã«æ¤ç´¢ãã¦ã¿ã¾ããããçµæã¯ä¸ã®ä¾ã¨åãã«ãªãã¾ãã .. groonga-command .. include:: ../example/tutorial/match_columns-4.log .. select --table Blog2 --match_columns title||message --query groonga .. select --table Blog2 --match_columns title||message --query message .. select --table Blog2 --match_columns title --query message ã¤ã³ããã¯ã¹åãæå®ããå ¨ææ¤ç´¢ -------------------------------- å·çä¸ã§ãã .. TODO: match_columnsã«ã¤ã³ããã¯ã¹åãæå®ãã¦ã®æ¤ç´¢ã«ã¤ãã¦ã触ããã ã¤ã³ããã¯ã¹ã®éã¿ ------------------ å·çä¸ã§ãã .. TODO: match_columnsã®éã¿æå®æ©è½ã«ã¤ãã¦ã触ããã