Skip to content

Fix search query command#19

Open
seawatts wants to merge 3 commits into
normanjoyner:masterfrom
seawatts:feature/fix-search-query-command
Open

Fix search query command#19
seawatts wants to merge 3 commits into
normanjoyner:masterfrom
seawatts:feature/fix-search-query-command

Conversation

@seawatts

@seawatts seawatts commented Dec 8, 2014

Copy link
Copy Markdown

Referencing issue #18

@shan916

shan916 commented Jun 30, 2016

Copy link
Copy Markdown

Is there a reason this pull request is still open? I am having the exact same issue as #18. Currently, I am having to use my own modified version of chef-api.

@normanjoyner any update on this?

@wjozefssrf

wjozefssrf commented Sep 22, 2016

Copy link
Copy Markdown

i wana get only the ip address of node " server 1 "

im sending a request like this

Code :

chef.partialSearch("node", "name:server1",{"ip":"ipaddress"} ,function(err, res){

if (err){console.log(error);}

else{console.log(res);}

});
Or
chef.partialSearch("node", { q: "name:server1"} ,{"ip":"ipaddress"} ,function(err, res){
....
});

=> Response :

received status code 400 invalid value 'ipaddress' for no_key

function in code source : partialSearch: function(index, qs, data, fn) { ... }


Can you please give a valid syntax with example .
Thanks

@wjozefssrf wjozefssrf left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct Syntax For Search Methods

Simple Search : Exemple

chef.search("node", {q: "name:server1" }, function(err, res){
   if (err){console.log(error);}
   else{console.log(res);}
   });

Partial Search : Exemple

chef.partialSearch("node", {q: "role:web"}, { name: ['name'] , 'ipaddress': ['ipaddress'] }, function(err, res){
  if (err){console.log(error);}
  else{console.log(res);}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants