[Groonga-commit] droonga/droonga.org at d5db7c0 [gh-pages] Add note for sanitize and escape

Back to archive index

SHIMODA Piro Hiroshi null+****@clear*****
Sat Oct 4 20:39:18 JST 2014


SHIMODA "Piro" Hiroshi	2014-10-04 20:39:18 +0900 (Sat, 04 Oct 2014)

  New Revision: d5db7c0ce7df59d1e2aaecb69767d99c568a981e
  https://github.com/droonga/droonga.org/commit/d5db7c0ce7df59d1e2aaecb69767d99c568a981e

  Message:
    Add note for sanitize and escape

  Modified files:
    _po/ja/tutorial/1.0.7/benchmark/index.po
    ja/tutorial/1.0.7/benchmark/index.md
    tutorial/1.0.7/benchmark/index.md

  Modified: _po/ja/tutorial/1.0.7/benchmark/index.po (+15 -4)
===================================================================
--- _po/ja/tutorial/1.0.7/benchmark/index.po    2014-10-04 20:19:31 +0900 (4200a83)
+++ _po/ja/tutorial/1.0.7/benchmark/index.po    2014-10-04 20:39:18 +0900 (069708d)
@@ -775,17 +775,28 @@ msgid ""
 "% n_unique_requests=200\n"
 "% curl \"http://192.168.100.50:10041/d/select?table=Pages&limit=$n_unique_reque"
 "sts&output_columns=title\" | \\\n"
-"    drnbench-extract-searchterms | \\\n"
+"    drnbench-extract-searchterms --sanitize --escape | \\\n"
 "    sed -r -e \"s;^;/d/select?table=Pages\\&limit=10\\&match_columns=title,text\\&"
 "output_columns=snippet_html(title),snippet_html(text),categories,_key\\&;\" \\\n"
 "    > ./patterns.txt\n"
 "~~~"
 msgstr ""
 
+msgid "Note:"
+msgstr "注意:"
+
 msgid ""
-"Note that you must escape `&` in the sed script with prefixed backslash, like "
-"`\\&`."
-msgstr "sedスクリプトの中の`&`は、前にバックスラッシュを置いて`\\&`のようにエスケープする必要があることに注意して下さい。"
+" * You must escape `&` in the sed script with prefixed backslash, like `\\&`.\n"
+" * You should specify both `--sanitize` and `--escape` options for `drnbench-e"
+"xtract-searchterms`.\n"
+"   `--sanitize` removes some special characters for the `query` parameter.\n"
+"   `--escape` escapes characters unsafe for URI strings."
+msgstr ""
+" * sedスクリプトの中の`&`は、前にバックスラッシュを置いて`\\&`のようにエスケープする必要があることに注意して下さい。\n"
+" * `drnbench-extract-searchterms`コマンドには、`--sanitize`と`--escape`の2つのオプションを指定すると"
+"良いでしょう。\n"
+"   `--sanitize`は、クエリ構文において特殊文字として解釈される文字を単語から取り除きます。\n"
+"   `--escape`は、URIに含められない文字をエスケープします。"
 
 msgid "The generated file `patterns.txt` becomes like following:"
 msgstr "生成されたファイル `patterns.txt` は以下のような内容になります:"

  Modified: ja/tutorial/1.0.7/benchmark/index.md (+7 -2)
===================================================================
--- ja/tutorial/1.0.7/benchmark/index.md    2014-10-04 20:19:31 +0900 (9800cf8)
+++ ja/tutorial/1.0.7/benchmark/index.md    2014-10-04 20:39:18 +0900 (74a7925)
@@ -406,12 +406,17 @@ title10
 ~~~
 % n_unique_requests=200
 % curl "http://192.168.100.50:10041/d/select?table=Pages&limit=$n_unique_requests&output_columns=title" | \
-    drnbench-extract-searchterms | \
+    drnbench-extract-searchterms --sanitize --escape | \
     sed -r -e "s;^;/d/select?table=Pages\&limit=10\&match_columns=title,text\&output_columns=snippet_html(title),snippet_html(text),categories,_key\&;" \
     > ./patterns.txt
 ~~~
 
-sedスクリプトの中の`&`は、前にバックスラッシュを置いて`\&`のようにエスケープする必要があることに注意して下さい。
+注意:
+
+ * sedスクリプトの中の`&`は、前にバックスラッシュを置いて`\&`のようにエスケープする必要があることに注意して下さい。
+ * `drnbench-extract-searchterms`コマンドには、`--sanitize`と`--escape`の2つのオプションを指定すると良いでしょう。
+   `--sanitize`は、クエリ構文において特殊文字として解釈される文字を単語から取り除きます。
+   `--escape`は、URIに含められない文字をエスケープします。
 
 生成されたファイル `patterns.txt` は以下のような内容になります:
 

  Modified: tutorial/1.0.7/benchmark/index.md (+7 -2)
===================================================================
--- tutorial/1.0.7/benchmark/index.md    2014-10-04 20:19:31 +0900 (2e1895e)
+++ tutorial/1.0.7/benchmark/index.md    2014-10-04 20:39:18 +0900 (2e2dcd9)
@@ -397,12 +397,17 @@ OK, let's generate request patterns by `drnbench-extract-searchterms`, from a se
 ~~~
 % n_unique_requests=200
 % curl "http://192.168.100.50:10041/d/select?table=Pages&limit=$n_unique_requests&output_columns=title" | \
-    drnbench-extract-searchterms | \
+    drnbench-extract-searchterms --sanitize --escape | \
     sed -r -e "s;^;/d/select?table=Pages\&limit=10\&match_columns=title,text\&output_columns=snippet_html(title),snippet_html(text),categories,_key\&;" \
     > ./patterns.txt
 ~~~
 
-Note that you must escape `&` in the sed script with prefixed backslash, like `\&`.
+Note:
+
+ * You must escape `&` in the sed script with prefixed backslash, like `\&`.
+ * You should specify both `--sanitize` and `--escape` options for `drnbench-extract-searchterms`.
+   `--sanitize` removes some special characters for the `query` parameter.
+   `--escape` escapes characters unsafe for URI strings.
 
 The generated file `patterns.txt` becomes like following:
 
-------------- next part --------------
HTML����������������������������...
下载 



More information about the Groonga-commit mailing list
Back to archive index