diff options
author | John Keiser <jkeiser@opscode.com> | 2013-06-26 18:03:06 -0600 |
---|---|---|
committer | John Keiser <jkeiser@opscode.com> | 2013-06-26 18:03:06 -0600 |
commit | a9f0654dabb6aa0f3c59e66abc1a36bfd7767947 (patch) | |
tree | 6ffd2c61f4169204e997d7829c7f4dd86361042e /lib/chef_zero/solr | |
parent | 12c03cf782feecc9f1020cf3922b182403c2d4a0 (diff) | |
download | chef-zero-a9f0654dabb6aa0f3c59e66abc1a36bfd7767947.tar.gz |
Fix issue with "NOT a:b" (bind : tighter than NOT)
Diffstat (limited to 'lib/chef_zero/solr')
-rw-r--r-- | lib/chef_zero/solr/solr_parser.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/chef_zero/solr/solr_parser.rb b/lib/chef_zero/solr/solr_parser.rb index 5795d1f..6cf955e 100644 --- a/lib/chef_zero/solr/solr_parser.rb +++ b/lib/chef_zero/solr/solr_parser.rb @@ -108,8 +108,7 @@ module ChefZero end def parse_error(token, str) - error = "Error on token '#{token}' at #{@index} of '#{@query_string}': #{str}" - raise error + raise "Error on token '#{token}' at #{@index} of '#{@query_string}': #{str}" end def read_single_expression @@ -162,7 +161,12 @@ module ChefZero # Otherwise it's a term. else - Query::Term.new(token) + term = Query::Term.new(token) + if peek_token == ':' + Query::BinaryOperator.new(term, next_token, read_single_expression) + else + term + end end end |