table_create Comments TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] column_create Comments content COLUMN_SCALAR ShortText [[0,0.0,0.0],true] table_create Articles TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] column_create Articles content COLUMN_SCALAR Text [[0,0.0,0.0],true] column_create Articles comment COLUMN_SCALAR Comments [[0,0.0,0.0],true] table_create Lexicon TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram [[0,0.0,0.0],true] column_create Lexicon articles_content COLUMN_INDEX|WITH_POSITION Articles content [[0,0.0,0.0],true] column_create Lexicon comments_content COLUMN_INDEX|WITH_POSITION Comments content [[0,0.0,0.0],true] column_create Comments article COLUMN_INDEX Articles comment [[0,0.0,0.0],true] load --table Comments [ {"_key": "1-1", "content": "I'm using groonga too!"}, {"_key": "2-1", "content": "I'm using groonga and mroonga!"}, {"_key": "3-1", "content": "I'm using mroonga too!"}, {"_key": "4-1", "content": "I'm using groonga and rroonga too!"} ] [[0,0.0,0.0],4] load --table Articles [ ["_key", "content", "comment"], ["groonga-is-fast", "Groonga is fast!", "1-1"], ["groonga-is-useful", "Groonga is useful!", "2-1"], ["mroonga-is-fast", "Mroonga is fast!", "3-1"], ["rroonga-is-fast", "Rroonga is fast!", "4-1"] ] [[0,0.0,0.0],4] select Articles --match_columns comment.content --query groonga --output_columns "_id, _score, *" [ [ 0, 0.0, 0.0 ], [ [ [ 3 ], [ [ "_id", "UInt32" ], [ "_score", "Int32" ], [ "comment", "Comments" ], [ "content", "Text" ] ], [ 1, 1, "1-1", "Groonga is fast!" ], [ 2, 1, "2-1", "Groonga is useful!" ], [ 4, 1, "4-1", "Rroonga is fast!" ] ] ] ]