HAYASHI Kentaro
null+****@clear*****
Wed Feb 18 10:02:29 JST 2015
HAYASHI Kentaro 2015-02-18 10:02:29 +0900 (Wed, 18 Feb 2015) New Revision: cbd460f9474cbfa24e29b909bb5498d11f3b52f3 https://github.com/groonga/groonga/commit/cbd460f9474cbfa24e29b909bb5498d11f3b52f3 Message: doc: add usage section about in_values Modified files: doc/source/reference/functions/in_values.rst Modified: doc/source/reference/functions/in_values.rst (+32 -0) =================================================================== --- doc/source/reference/functions/in_values.rst 2015-02-18 09:33:36 +0900 (90d8bd6) +++ doc/source/reference/functions/in_values.rst 2015-02-18 10:02:29 +0900 (dedea23) @@ -27,6 +27,38 @@ Syntax Usage ----- +Here is a schema definition and sample data. + +Sample schema: + +.. groonga-command +.. include:: ../../example/reference/functions/in_values/usage_setup_schema.log +.. table_create Tags TABLE_PAT_KEY ShortText +.. table_create Memos TABLE_HASH_KEY ShortText +.. column_create Memos tag COLUMN_SCALAR ShortText +.. column_create Tags memos_tag COLUMN_INDEX Memos tag + +Sample data: + +.. groonga-command +.. include:: ../../example/reference/functions/in_values/usage_setup_data.log +.. load --table Memos +.. [ +.. {"_key": "Groonga is fast", "tag": "groonga"}, +.. {"_key": "Mroonga is fast", "tag": "mroonga"}, +.. {"_key": "Rroonga is fast", "tag": "rroonga"}, +.. {"_key": "Droonga is fast", "tag": "droonga"}, +.. {"_key": "Groonga is a HTTP server", "tag": "groonga"} +.. ] + +Here is the simple usage of ``in_values`` function which selects the records - the value of ``tag`` column is "groonga" or "mroonga" or "droonga". + +.. groonga-command +.. include:: ../../example/reference/functions/in_values/usage_only.log +.. select Memos --output_columns _key,tag --filter 'in_values(tag, "groonga", "mroonga", "droonga")' --sortby _id + +When executing the above query, you can get the records except "rroonga" because "rroonga" is not specified as value in ``in_values``. + Parameters ---------- -------------- next part -------------- HTML����������������������������...Download