diff --git a/lib/searchkick/query.rb b/lib/searchkick/query.rb index fe5a965..f7334bf 100644 --- a/lib/searchkick/query.rb +++ b/lib/searchkick/query.rb @@ -873,6 +873,8 @@ module Searchkick filters << {bool: {must_not: where_filters(value)}} elsif field == :_and filters << {bool: {must: value.map { |or_statement| {bool: {filter: where_filters(or_statement)}} }}} + # elsif field == :_script + # filters << {script: {script: {source: value, lang: "painless"}}} else # expand ranges if value.is_a?(Range) diff --git a/test/where_test.rb b/test/where_test.rb index 317cfb8..8a7e2d5 100644 --- a/test/where_test.rb +++ b/test/where_test.rb @@ -128,6 +128,14 @@ class WhereTest < Minitest::Test assert_search "product", ["Product A"], where: {user_ids: {exists: true}} end + # def test_script + # store [ + # {name: "Product A", store_id: 1}, + # {name: "Product B", store_id: 10} + # ] + # assert_search "product", ["Product A"], where: {_script: "doc['store_id'].value < 10"} + # end + def test_where_string store [ {name: "Product A", color: "RED"} -- libgit2 0.21.0