I'm Getting The Wrong Results When I Search

Sean Horn -

Chef Search has a bug.

No, it's trying to be helpful and make searching more immediately useful.


Please pay special attention to this paragraph "A nested field appears deeper in the JSON data structure. For example, information about a network interface might be several layers deep: node[:network][:interfaces][:en1]. When nested fields are present in a JSON structure, the chef-client will extract those nested fields to the top-level, flattening them into compound fields that support wildcard search patterns."

This means that if you have "name:something" anywhere in your node data on any node in the same org and environment and you search like this, you will get back every node that has that name, no matter how many levels deep it is in the node data hierarchy. This is a convenience, but can interfere if you are expecting something more simplistic.

`knife search node 'name:something*'`

You can fix this by avoiding keywords found by default in the node data object.
A good choice here would be to add those entries with the key "peer_name" maybe, or any key that would not be picked up by that search.

Have more questions? Submit a request


Powered by Zendesk