# Knife search queries

**URL:** <https://discourse.chef.io/t/knife-search-queries/6102>\
**Category:** Chef Infra (archive)\
**Created:** [December 22, 2014, 12:57am UTC](https://discourse.chef.io/t/knife-search-queries/6102 "2014-12-22T00:57:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![M\_G](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@M\_G](https://discourse.chef.io/u/M_G)\
**Post date:** [December 22, 2014, 12:57am UTC](https://discourse.chef.io/t/knife-search-queries/6102/1 "2014-12-22T00:57:33Z")

</div>

Hi, I am running the following 2 queries

First query says give me the nested attribute wiring.stackid of all nodes with  
role mq. The output is as expected.

knife search node ‘roles:mq’ -a wiring.stackid  
2 items found

us1-sn1-rmq5:  
wiring.stackid: 97a2205a-87ec-11e4-9440-ae7ba1a65649

us1-sn1-rmq4:  
wiring.stackid: 791d001c-87da-11e4-9560-ae7ba1a65649

The second query is a more surgical query which says give me the node with a  
particular nested attribute wiring.stackid value. If you see the nested  
attribute value is taken from the previous query.

knife search node ‘wiring.stackid:97a2205a-87ec-11e4-9440-ae7ba1a65649’

0 items found

Why des the second query show zero output when the first query shows there is  
clearly a node with nested attribute  
wiring.stackid:97a2205a-87ec-11e4-9440-ae7ba1a65649 ?

Regards

---

<div class="post-metadata">

**Author:** ![Ranjib](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/ranjib/32/1040_2.png) [@Ranjib](https://discourse.chef.io/u/Ranjib)\
**Post date:** [December 22, 2014, 1:34am UTC](https://discourse.chef.io/t/knife-search-queries/6102/2 "2014-12-22T01:34:19Z")

</div>

wiring\_stackid . nesting is denoted by underscore not period, in solr /chef  
search queries  
On Dec 21, 2014 4:59 PM, [meher03@hotmail.com](mailto:meher03@hotmail.com) wrote:

> Hi, I am running the following 2 queries
> 
> First query says give me the nested attribute wiring.stackid of all nodes  
> with  
> role mq. The output is as expected.
> 
> knife search node 'roles:mq' -a wiring.stackid  
> 2 items found
> 
> us1-sn1-rmq5:  
> wiring.stackid: 97a2205a-87ec-11e4-9440-ae7ba1a65649
> 
> us1-sn1-rmq4:  
> wiring.stackid: 791d001c-87da-11e4-9560-ae7ba1a65649
> 
> The second query is a more surgical query which says give me the node with  
> a  
> particular nested attribute wiring.stackid value. If you see the nested  
> attribute value is taken from the previous query.
> 
> knife search node 'wiring.stackid:97a2205a-87ec-11e4-9440-ae7ba1a65649'
> 
> 0 items found
> 
> Why des the second query show zero output when the first query shows there  
> is  
> clearly a node with nested attribute  
> wiring.stackid:97a2205a-87ec-11e4-9440-ae7ba1a65649 ?
> 
> Regards

---

<div class="post-metadata">

**Author:** ![M\_G](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@M\_G](https://discourse.chef.io/u/M_G)\
**Post date:** [December 22, 2014, 4:47pm UTC](https://discourse.chef.io/t/knife-search-queries/6102/3 "2014-12-22T16:47:10Z")

</div>

thanx ranjib.

Date: Sun, 21 Dec 2014 17:34:19 -0800  
From: [dey.ranjib@gmail.com](mailto:dey.ranjib@gmail.com)  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] Re: knife search queries

wiring\_stackid . nesting is denoted by underscore not period, in solr /chef search queries  
On Dec 21, 2014 4:59 PM, [meher03@hotmail.com](mailto:meher03@hotmail.com) wrote:  
Hi, I am running the following 2 queries

First query says give me the nested attribute wiring.stackid of all nodes with

role mq. The output is as expected.

knife search node ‘roles:mq’ -a wiring.stackid

2 items found

us1-sn1-rmq5:

wiring.stackid: 97a2205a-87ec-11e4-9440-ae7ba1a65649

us1-sn1-rmq4:

wiring.stackid: 791d001c-87da-11e4-9560-ae7ba1a65649

The second query is a more surgical query which says give me the node with a

particular nested attribute wiring.stackid value. If you see the nested

attribute value is taken from the previous query.

knife search node ‘wiring.stackid:97a2205a-87ec-11e4-9440-ae7ba1a65649’

0 items found

Why des the second query show zero output when the first query shows there is

clearly a node with nested attribute

wiring.stackid:97a2205a-87ec-11e4-9440-ae7ba1a65649 ?

Regards
