null+****@clear*****
null+****@clear*****
2012年 6月 14日 (木) 18:09:38 JST
Kouhei Sutou 2012-06-14 18:09:38 +0900 (Thu, 14 Jun 2012)
New Revision: 6a630b6bfb7777e07aa2b256bb19f42cd161b8f0
Log:
doc: add escape section
Modified files:
doc/source/spec/query_syntax.txt
Modified: doc/source/spec/query_syntax.txt (+22 -0)
===================================================================
--- doc/source/spec/query_syntax.txt 2012-06-14 16:43:03 +0900 (0112d11)
+++ doc/source/spec/query_syntax.txt 2012-06-14 18:09:38 +0900 (50d6e08)
@@ -69,6 +69,28 @@ using ``TokenBigram`` tokenizer. So both ``Entries._key`` and
OK. The schema and data for examples are ready.
+Escape
+------
+
+There are special characters in query syntax. To use a special
+character as itself, it should be escaped by prepending ``\``. For
+example, ``"`` is a special character. It is escaped as ``\"``.
+
+Here is a special character list:
+
+ * `` `` (a space) (escaped as ``\ ``)
+ * ``"`` (escaped as ``\"``)
+ * ``'`` (escaped as ``\'``)
+ * ``(`` (escaped as ``\(``)
+ * ``)`` (escaped as ``\)``)
+ * ``\`` (escaped as ``\\``)
+
+You can use quote instead of escape. Quote's syntax is ``"..."`` or
+``'...'``. You need escape ``"`` as ``\"`` in ``"..."`` quote syntax.
+You need escape ``'`` as ``\'`` in ``'...'`` quote syntax. For
+example, ``Alice's brother (Bob)`` can be quoted ``"Alice's brother
+(Bob)"`` or ``'Alice\'s brother (Bob)'``.
+
Conditional expression
----------------------