Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in chef zero search query involving multiple attributes and attribute presence check #81

Open
nicfarges opened this issue Jul 21, 2014 · 5 comments
Labels
Aspect: Search Type: Bug Does not work as expected.

Comments

@nicfarges
Copy link

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

@kri5
Copy link

kri5 commented Jan 26, 2015

I am encoutering the same issue, is this issue still valid, or did you find out a way around?

@kri5
Copy link

kri5 commented Jan 26, 2015

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?

@kri5
Copy link

kri5 commented Apr 9, 2015

Any ideas?

@TeddyRux
Copy link

I'm running into the same issue. Are there any plans to implement a fix, or does anyone have a good workaround?

@lamont-granquist lamont-granquist added this to the Accepted Minor milestone Dec 14, 2016
@thommay thommay added Type: Bug Does not work as expected. and removed bug labels Jan 24, 2017
@tbe
Copy link

tbe commented Feb 28, 2019

After 5 years, this is still a bug. Ist there any work going on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aspect: Search Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

6 participants