[Groonga-commit] droonga/droonga.org at 0d43e51 [gh-pages] Use query_flags=NONE instead of --sanitize of drnbench-extract-searchterms

Back to archive index

SHIMODA Piro Hiroshi null+****@clear*****
Mon Oct 6 11:50:14 JST 2014


SHIMODA "Piro" Hiroshi	2014-10-06 11:50:14 +0900 (Mon, 06 Oct 2014)

  New Revision: 0d43e5120cf263105ca223822973ade540936d50
  https://github.com/droonga/droonga.org/commit/0d43e5120cf263105ca223822973ade540936d50

  Message:
    Use query_flags=NONE instead of --sanitize of drnbench-extract-searchterms

  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 (+18 -12)
===================================================================
--- _po/ja/tutorial/1.0.7/benchmark/index.po    2014-10-04 20:50:51 +0900 (d98eba2)
+++ _po/ja/tutorial/1.0.7/benchmark/index.po    2014-10-06 11:50:14 +0900 (aec4226)
@@ -795,9 +795,10 @@ 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 --sanitize --escape | \\\n"
+"    drnbench-extract-searchterms --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"
+"output_columns=snippet_html(title),snippet_html(text),categories,_key\\&query_f"
+"lags=NONE\\&query=;\" \\\n"
 "    > ./patterns.txt\n"
 "~~~"
 msgstr ""
@@ -807,16 +808,21 @@ msgstr "注意:"
 
 msgid ""
 " * 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."
+" * You should specify the `--escape` option for `drnbench-extract-searchterms`"
+".\n"
+"   It escapes characters unsafe for URI strings.\n"
+" * You should specify `query_flags=NONE` as a part of parameters, if you use s"
+"earch terms by the `query` parameter.\n"
+"   It forces ignoring of special characters in the `query` parameter, to Groon"
+"ga.\n"
+"   Otherwise you may see some errors from invalid queries."
 msgstr ""
 " * sedスクリプトの中の`&`は、前にバックスラッシュを置いて`\\&`のようにエスケープする必要があることに注意して下さい。\n"
-" * `drnbench-extract-searchterms`コマンドには、`--sanitize`と`--escape`の2つのオプションを指定すると"
-"良いでしょう。\n"
-"   `--sanitize`は、クエリ構文において特殊文字として解釈される文字を単語から取り除きます。\n"
-"   `--escape`は、URIに含められない文字をエスケープします。"
+" * `drnbench-extract-searchterms`コマンドには、`--escape`オプションを指定すると良いでしょう。\n"
+"   この指定により、URIに含められない文字がエスケープされます。\n"
+" * 得られた検索語句を`query`パラメータに使用する場合、`query_flags=NONE`も同時に指定すると良いでしょう。\n"
+"   この指定により、Groongaは`query`パラメータの中に含まれる特殊文字を無視するようになります。\n"
+"   この指定を忘れると、不正なクエリのエラーに遭遇することになるかもしれません。"
 
 msgid "The generated file `patterns.txt` becomes like following:"
 msgstr "生成されたファイル `patterns.txt` は以下のような内容になります:"
@@ -824,9 +830,9 @@ msgstr "生成されたファイル `patterns.txt` は以下のような内容
 msgid ""
 "~~~\n"
 "/d/select?table=Pages&limit=10&match_columns=title,text&output_columns=snippet"
-"_html(title),snippet_html(text),categories,_key&query=AAA\n"
+"_html(title),snippet_html(text),categories,_key&query_flags=NONE&query=AAA\n"
 "/d/select?table=Pages&limit=10&match_columns=title,text&output_columns=snippet"
-"_html(title),snippet_html(text),categories,_key&query=BBB\n"
+"_html(title),snippet_html(text),categories,_key&query_flags=NONE&query=BBB\n"
 "...\n"
 "~~~"
 msgstr ""

  Modified: ja/tutorial/1.0.7/benchmark/index.md (+9 -7)
===================================================================
--- ja/tutorial/1.0.7/benchmark/index.md    2014-10-04 20:50:51 +0900 (89dd607)
+++ ja/tutorial/1.0.7/benchmark/index.md    2014-10-06 11:50:14 +0900 (c39bb17)
@@ -411,23 +411,25 @@ 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 --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\&;" \
+    drnbench-extract-searchterms --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\&query_flags=NONE\&query=;" \
     > ./patterns.txt
 ~~~
 
 注意:
 
  * sedスクリプトの中の`&`は、前にバックスラッシュを置いて`\&`のようにエスケープする必要があることに注意して下さい。
- * `drnbench-extract-searchterms`コマンドには、`--sanitize`と`--escape`の2つのオプションを指定すると良いでしょう。
-   `--sanitize`は、クエリ構文において特殊文字として解釈される文字を単語から取り除きます。
-   `--escape`は、URIに含められない文字をエスケープします。
+ * `drnbench-extract-searchterms`コマンドには、`--escape`オプションを指定すると良いでしょう。
+   この指定により、URIに含められない文字がエスケープされます。
+ * 得られた検索語句を`query`パラメータに使用する場合、`query_flags=NONE`も同時に指定すると良いでしょう。
+   この指定により、Groongaは`query`パラメータの中に含まれる特殊文字を無視するようになります。
+   この指定を忘れると、不正なクエリのエラーに遭遇することになるかもしれません。
 
 生成されたファイル `patterns.txt` は以下のような内容になります:
 
 ~~~
-/d/select?table=Pages&limit=10&match_columns=title,text&output_columns=snippet_html(title),snippet_html(text),categories,_key&query=AAA
-/d/select?table=Pages&limit=10&match_columns=title,text&output_columns=snippet_html(title),snippet_html(text),categories,_key&query=BBB
+/d/select?table=Pages&limit=10&match_columns=title,text&output_columns=snippet_html(title),snippet_html(text),categories,_key&query_flags=NONE&query=AAA
+/d/select?table=Pages&limit=10&match_columns=title,text&output_columns=snippet_html(title),snippet_html(text),categories,_key&query_flags=NONE&query=BBB
 ...
 ~~~
 

  Modified: tutorial/1.0.7/benchmark/index.md (+9 -7)
===================================================================
--- tutorial/1.0.7/benchmark/index.md    2014-10-04 20:50:51 +0900 (8aef75a)
+++ tutorial/1.0.7/benchmark/index.md    2014-10-06 11:50:14 +0900 (10e00af)
@@ -402,23 +402,25 @@ 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 --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\&;" \
+    drnbench-extract-searchterms --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\&query_flags=NONE\&query=;" \
     > ./patterns.txt
 ~~~
 
 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.
+ * You should specify the `--escape` option for `drnbench-extract-searchterms`.
+   It escapes characters unsafe for URI strings.
+ * You should specify `query_flags=NONE` as a part of parameters, if you use search terms by the `query` parameter.
+   It forces ignoring of special characters in the `query` parameter, to Groonga.
+   Otherwise you may see some errors from invalid queries.
 
 The generated file `patterns.txt` becomes like following:
 
 ~~~
-/d/select?table=Pages&limit=10&match_columns=title,text&output_columns=snippet_html(title),snippet_html(text),categories,_key&query=AAA
-/d/select?table=Pages&limit=10&match_columns=title,text&output_columns=snippet_html(title),snippet_html(text),categories,_key&query=BBB
+/d/select?table=Pages&limit=10&match_columns=title,text&output_columns=snippet_html(title),snippet_html(text),categories,_key&query_flags=NONE&query=AAA
+/d/select?table=Pages&limit=10&match_columns=title,text&output_columns=snippet_html(title),snippet_html(text),categories,_key&query_flags=NONE&query=BBB
 ...
 ~~~
 
-------------- next part --------------
HTML����������������������������...
Télécharger 



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