Susumu Yata
null+****@clear*****
Fri Jan 12 12:45:15 JST 2018
Susumu Yata 2018-01-12 12:45:15 +0900 (Fri, 12 Jan 2018) New Revision: 1d99025e5b85bca847162771b758a3902d1d7923 https://github.com/groonga/groonga/commit/1d99025e5b85bca847162771b758a3902d1d7923 Message: doc: use sort_keys and drilldown_sort_keys in tutorial GitHub: #604 Modified files: doc/locale/ja/LC_MESSAGES/tutorial.po doc/source/tutorial/drilldown.rst doc/source/tutorial/index.rst doc/source/tutorial/introduction.rst doc/source/tutorial/search.rst Modified: doc/locale/ja/LC_MESSAGES/tutorial.po (+15 -15) =================================================================== --- doc/locale/ja/LC_MESSAGES/tutorial.po 2018-01-11 15:34:21 +0900 (4ba80c4b6) +++ doc/locale/ja/LC_MESSAGES/tutorial.po 2018-01-12 12:45:15 +0900 (2cb9ec864) @@ -333,6 +333,9 @@ msgstr "" "title を指定しているので、参照先の主キーとタイトルをそれぞれ配列にしたものが" "表示されています。" +msgid "Drilldown by ``domain`` column" +msgstr "``domain`` カラムによるドリルダウン" + msgid "Drilldown" msgstr "ドリルダウン" @@ -409,9 +412,6 @@ msgstr "" msgid "Here is a summary of above query." msgstr "上記のクエリの集計結果です。" -msgid "Drilldown by ``domain`` column" -msgstr "``domain`` カラムによるドリルダウン" - msgid "Group by" msgstr "グループ化するカラムの値" @@ -514,10 +514,10 @@ msgid "Sorting drildown results" msgstr "ドリルダウン結果をソートする" msgid "" -"Use ``--drilldown_sortby`` if you want to sort the result of drilldown. For " -"example, specify ``_nsubrecs`` as ascending order." +"Use ``--drilldown_sort_keys`` if you want to sort the result of drilldown. " +"For example, specify ``_nsubrecs`` as ascending order." msgstr "" -"ドリルダウン結果をソートしたい場合には ``--drilldown_sortby`` を使います。指" +"ドリルダウン結果をソートしたい場合には ``--drilldown_sort_keys`` を使います。指" "定した ``_nsubrecs`` カラムを昇順でソートします。" msgid "limits drildown results" @@ -1213,19 +1213,19 @@ msgstr "検索結果の並べ替え" msgid "" "A :doc:`/reference/commands/select` command sorts its result when used with " -"a ``sortby`` parameter." +"a ``sort_keys`` parameter." msgstr "" -":doc:`/reference/commands/select` コマンドに ``sortby`` 引数を渡すことによ" +":doc:`/reference/commands/select` コマンドに ``sort_keys`` 引数を渡すことによ" "り、検索結果を並べ替えることができます。" msgid "" -"A ``sortby`` parameter specifies a column as a sorting creteria. A search " +"A ``sort_keys`` parameter specifies a column as a sorting creteria. A search " "result is arranged in ascending order of the column values. If you want to " "sort a search result in reverse order, please add a leading hyphen ('-') to " "the column name in a parameter." msgstr "" -"``sortby`` 引数には、整列の基準として用いるカラムを指定します。検索結果は指定" -"したカラムの値が昇順になるように並べ替えられます。 ``sortby`` 引数の中でカラ" +"``sort_keys`` 引数には、整列の基準として用いるカラムを指定します。検索結果は指定" +"したカラムの値が昇順になるように並べ替えられます。 ``sort_keys`` 引数の中でカラ" "ム名の前にハイフン(-)を付けることにより、降順に並べ替えることもできます。" msgid "The following example shows records in the Site table in reverse order." @@ -2361,8 +2361,8 @@ msgstr "" "このケースでは、rand()という乱数を返す関数を用いて、全文検索のスコアを乱数で" "上書きしています。" -msgid "The condition of ``sortby`` parameter is::" -msgstr "``sortby`` パラメータの条件は次のとおりです::" +msgid "The condition of ``sort_keys`` parameter is::" +msgstr "``sort_keys`` パラメータの条件は次のとおりです::" msgid "This means that sorting the search result by ascending order." msgstr "これは、スコア順に検索結果を昇順にソートすることを意味しています。" @@ -2464,9 +2464,9 @@ msgstr "" msgid "" "The return value of geo_distance function is also used for sorting by " -"specifying pseudo ``_score`` column to ``sortby`` parameter." +"specifying pseudo ``_score`` column to ``sort_keys`` parameter." msgstr "" -"``geo_distance`` 関数は、``_score`` に値を設定することで、``sortby`` パラメー" +"``geo_distance`` 関数は、``_score`` に値を設定することで、``sort_keys`` パラメー" "タによるソートでも用いることができます。" msgid "" Modified: doc/source/tutorial/drilldown.rst (+4 -4) =================================================================== --- doc/source/tutorial/drilldown.rst 2018-01-11 15:34:21 +0900 (f65c2bea2) +++ doc/source/tutorial/drilldown.rst 2018-01-12 12:45:15 +0900 (0a4a445a0) @@ -110,11 +110,11 @@ You can get the each result of drilldown at once. Sorting drildown results ------------------------ -Use ``--drilldown_sortby`` if you want to sort the result of drilldown. For example, specify ``_nsubrecs`` as ascending order. +Use ``--drilldown_sort_keys`` if you want to sort the result of drilldown. For example, specify ``_nsubrecs`` as ascending order. .. groonga-command -.. include:: ../example/tutorial/drilldown-sortby.log -.. select --table Site --limit 0 --drilldown country --drilldown_sortby _nsubrecs +.. include:: ../example/tutorial/drilldown-sort_keys.log +.. select --table Site --limit 0 --drilldown country --drilldown_sort_keys _nsubrecs limits drildown results @@ -124,7 +124,7 @@ The number of drilldown results is limited to 10 as a default. Use ``drilldown_l .. groonga-command .. include:: ../example/tutorial/drilldown-limit.log -.. select --table Site --limit 0 --drilldown country --drilldown_sortby _nsubrecs --drilldown_limit 2 --drilldown_offset 2 +.. select --table Site --limit 0 --drilldown country --drilldown_sort_keys _nsubrecs --drilldown_limit 2 --drilldown_offset 2 Note that drilldown to the column which stores string is slower than the columns which stores the other types. If you drilldown to string type of column, create the table that type of primary key is string, then create the column which refers that table. Modified: doc/source/tutorial/index.rst (+1 -1) =================================================================== --- doc/source/tutorial/index.rst 2018-01-11 15:34:21 +0900 (021f76f0c) +++ doc/source/tutorial/index.rst 2018-01-12 12:45:15 +0900 (dfff89c06) @@ -120,4 +120,4 @@ These indexes are also used when sorting the records with geo location search. .. groonga-command .. include:: ../example/tutorial/index-7.log -.. select --table GeoSite --filter 'geo_in_circle(location, "128515259x503187188", 50000)' --output_columns _key,location,_score --sortby '-geo_distance(location, "128515259x503187188")' --scorer '_score = geo_distance(location, "128515259x503187188")' +.. select --table GeoSite --filter 'geo_in_circle(location, "128515259x503187188", 50000)' --output_columns _key,location,_score --sort_keys '-geo_distance(location, "128515259x503187188")' --scorer '_score = geo_distance(location, "128515259x503187188")' Modified: doc/source/tutorial/introduction.rst (+5 -5) =================================================================== --- doc/source/tutorial/introduction.rst 2018-01-11 15:34:21 +0900 (ea77cb40a) +++ doc/source/tutorial/introduction.rst 2018-01-12 12:45:15 +0900 (d1852d88c) @@ -267,27 +267,27 @@ An ``offset`` parameter specifies the starting point and a ``limit`` parameter s Sort a search result -------------------- -A :doc:`/reference/commands/select` command sorts its result when used with a ``sortby`` parameter. +A :doc:`/reference/commands/select` command sorts its result when used with a ``sort_keys`` parameter. -A ``sortby`` parameter specifies a column as a sorting creteria. A search result is arranged in ascending order of the column values. If you want to sort a search result in reverse order, please add a leading hyphen ('-') to the column name in a parameter. +A ``sort_keys`` parameter specifies a column as a sorting creteria. A search result is arranged in ascending order of the column values. If you want to sort a search result in reverse order, please add a leading hyphen ('-') to the column name in a parameter. The following example shows records in the Site table in reverse order. .. groonga-command .. include:: ../example/tutorial/introduction-16.log -.. select --table Site --sortby -_id +.. select --table Site --sort_keys -_id The next example uses the _score column as the sorting criteria for ranking the search result. The result is sorted in relevance order. .. groonga-command .. include:: ../example/tutorial/introduction-17.log -.. select --table Site --query title:@test --output_columns _id,_score,title --sortby -_score +.. select --table Site --query title:@test --output_columns _id,_score,title --sort_keys -_score If you want to specify more than one columns, please separate column names by commas (','). In such a case, a search result is sorted in order of the values in the first column, and then records having the same values in the first column are sorted in order of the second column values. .. groonga-command .. include:: ../example/tutorial/introduction-18.log -.. select --table Site --query title:@test --output_columns _id,_score,title --sortby -_score,_id +.. select --table Site --query title:@test --output_columns _id,_score,title --sort_keys -_score,_id .. rubric:: footnote Modified: doc/source/tutorial/search.rst (+5 -5) =================================================================== --- doc/source/tutorial/search.rst 2018-01-11 15:34:21 +0900 (eb6d1778b) +++ doc/source/tutorial/search.rst 2018-01-12 12:45:15 +0900 (be506e5dd) @@ -46,8 +46,8 @@ This parameter accepts the conditions which is specified by syntax like JavaScri .. groonga-command .. include:: ../example/tutorial/search-3.log -.. select --table Site --filter "true" --scorer "_score = rand()" --output_columns _id,_key,_score --sortby _score -.. select --table Site --filter "true" --scorer "_score = rand()" --output_columns _id,_key,_score --sortby _score +.. select --table Site --filter "true" --scorer "_score = rand()" --output_columns _id,_key,_score --sort_keys _score +.. select --table Site --filter "true" --scorer "_score = rand()" --output_columns _id,_key,_score --sort_keys _score '_score' is one of a pseudo column. The score of full-text search is assigned to it. See :doc:`/reference/columns/pseudo` about '_score' column. @@ -58,7 +58,7 @@ In the above query, the condition of ``scorer`` parameter is:: In this case, the score of full-text search is overwritten by the value of rand() function. -The condition of ``sortby`` parameter is:: +The condition of ``sort_keys`` parameter is:: _score @@ -104,11 +104,11 @@ Let's show geo distance from Akihabara station in Japan. In world geodetic syste As you can see, the geo distance between Tokyo station and Akihabara station is 2054 meters, the geo distance between Akihabara station and Shinjyuku station is 6720 meters. -The return value of geo_distance function is also used for sorting by specifying pseudo ``_score`` column to ``sortby`` parameter. +The return value of geo_distance function is also used for sorting by specifying pseudo ``_score`` column to ``sort_keys`` parameter. .. groonga-command .. include:: ../example/tutorial/search-6.log -.. select --table Site --query "_id:1 OR _id:2" --output_columns _key,location,_score --scorer '_score = geo_distance(location, "128515259x503187188")' --sortby -_score +.. select --table Site --query "_id:1 OR _id:2" --output_columns _key,location,_score --scorer '_score = geo_distance(location, "128515259x503187188")' --sort_keys -_score Groonga also supports to narrow down by "a certain point within specified meters". -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180112/067b06af/attachment-0001.htm