chef-zero
chef-zero copied to clipboard
bug in chef zero search query involving multiple attributes and attribute presence check
Hi,
there seem to be some inconsistency between chef server and chef zero on queries involving multiple nested attributes and attribute presence check...
on enterprise chef server:
- knife search node "languages_ruby:*" -i -> return all nodes that have "ruby" attribute under "languages"
on chef zero (included in chef client 11.12.8, as test-kitchen provisioner):
- knife search node "languages_ruby:*" -i -z -> return 0 node
- however, this following query works on chef-zero: knife search node "languages_ruby_version:*" -i -z -> return 1 node
It seems does this bug apply only in node attributes (opposite to "leaf" attributes) in chef zero ? or maybe I miss something on query semantic ...
nicolas farges GE Capital
I am encoutering the same issue, is this issue still valid, or did you find out a way around?
After diving into the code, it seems that search uses a matches_doc? method here https://github.com/chef/chef-zero/blob/master/lib/chef_zero/endpoints/search_endpoint.rb#L117
Which one comes from the result of a SolrParser.parse, and it seems to return a BinaryOperator, and when you look at the way it handles the attributes lookup here https://github.com/chef/chef-zero/blob/master/lib/chef_zero/solr/query/binary_operator.rb#L29 , you notice that there is no job looking up for nested attribute form, it just look at the json at the corresponding key.
I'm quite new to chef-zero, does anyone has an idea on how it should be handled?
Any ideas?
I'm running into the same issue. Are there any plans to implement a fix, or does anyone have a good workaround?
After 5 years, this is still a bug. Ist there any work going on?