- From: Christine Draper <
>
- To:
- Subject: [chef] Using unary NOT in knife search
- Date: Tue, 17 Mar 2015 16:26:57 -0500
I am looking for some clarification on the knife search syntax, particularly related to unary NOT.
I understand that knife search uses a modified Lucene query. In Lucene, unary NOT is invalid. With knife it seems to sometimes work.
For example, this works with both hosted Chef and knife localmode 12.0.3 (and something like it is in the docs):
knife search node "NOT name:appserver" -i
However, the following works with knife localmode 12.0.3 but does not work with hosted Chef:
knife search node "(NOT name:appserver) AND name:dbserver" -i
so, is unary NOT actually valid in either of these cases?
I realize I can turn the second example into a valid Lucene query by reversing it:
knife search node "name:dbserver (NOT name:appserver)" -i
But currently there's a bug that means this isnt working in knife local mode:
https://github.com/chef/chef/issues/3073
and it would be great to know more about what "modified" actually means.
Thanks!
Christine
- [chef] Using unary NOT in knife search, Christine Draper, 03/17/2015
Archive powered by MHonArc 2.6.16.