Просмотр исходного кода

Added simplified range syntax to query string docs

Clinton Gormley 12 лет назад
Родитель
Сommit
356de95840
1 измененных файлов с 25 добавлено и 0 удалено
  1. 25 0
      docs/reference/query-dsl/queries/query-string-syntax.asciidoc

+ 25 - 0
docs/reference/query-dsl/queries/query-string-syntax.asciidoc

@@ -151,9 +151,34 @@ curly brackets `{min TO max}`.
 
     date:{* TO 2012/01/01}
 
+Curly and square brackets can be combined:
+
+* Numbers from 1 up to but not including 5
+
+    count:[1..5}
+
+
+Ranges with one side unbounded can use the following syntax:
+
+    age:>10
+    age:>=10
+    age:<10
+    age:<=10
+
+[NOTE]
+===================================================================
+To combine an upper and lower bound with the simplified syntax, you
+would need to join two clauses with an `AND` operator:
+
+    age:(>=10 AND < 20)
+    age:(+>=10 +<20)
+
+===================================================================
+
 The parsing of ranges in query strings can be complex and error prone. It is
 much more reliable to use an explicit <<query-dsl-range-filter,`range` filter>>.
 
+
 ===== Boosting
 
 Use the _boost_ operator `^` to make one term more relevant than another.