[chef] Chef search and nested attributes


Chronological Thread 
  • From: Ranjib Dey < >
  • To:
  • Subject: [chef] Chef search and nested attributes
  • Date: Thu, 23 Jan 2014 12:48:28 -0800

ohai,
is there a way to specify chef search against top level attributes only?, i.e. currently

search(:node, 'foo:bar') will return nodes that has node.foo as well as node.baz.foo attribute. This is problematic, as we use many community cookbooks, which infuses their attributes, and if by chance they specify an attribute with same name, but under the cookbook's name space, chef search will still return those. Its difficult to predict the outcome of such search queries,
afaik attributes are stored as flat docs in solr where nesting is replaces with _. So, `foo.bar.baz` becomes `foo_bar_baz`, similarly borked.foo.baz will become `borkd_foo_baz` . if this is true, is there a way to specify the beginning of a document like ^ in regex? So that i can only get the top level attributes, not those which are nested .

something like:
search(:node, '^foo:*') 



regards
ranjib
 



Archive powered by MHonArc 2.6.16.

§