diff --git a/src/clj_druid/schemas/filter.clj b/src/clj_druid/schemas/filter.clj index 07a097c..3bf4f27 100644 --- a/src/clj_druid/schemas/filter.clj +++ b/src/clj_druid/schemas/filter.clj @@ -23,12 +23,27 @@ Selector filters can be used as the base filters for more complex Boolean expres :dimension s/Str :function s/Str}) + ;Experimental + +(s/defschema spatialFilter + {:type (s/enum :spatial) + :dimension s/Str + :bound (s/either + {:type (s/enum :rectangular) + :minCoords [Float] + :maxCoords [Float]} + + {:type (s/enum :radius) + :coords [Float] + :radius Float})}) + (s/defschema Filter "A filter is a JSON object indicating which rows of data should be included in the computation for a query. It’s essentially the equivalent of the WHERE clause in SQL. Druid supports the following types of filters." (s/either selectorFilter regexFilter javascriptFilter + spatialFilter {:type (s/enum :not) :field (s/recursive #'Filter)} {:type (s/enum :or :and)