简体   繁体   中英

running _search commands in the php

now there is another problem that I am facing: When I run

$ curl -X GET 'http://localhost:9200/sample/new/_search?pretty=true' -d '{ fields:"price_incl_tax","product_id"],query:{range:{price_incl_tax:{gte:1000,lte:1500}}} }'

in the cygwin , it works and gives the right result. But when I open the link "http://localhost:9200/sample/new/_search?pretty=true -d ' { fields:["price_incl_tax","product_id"],query:{range:{price_incl_tax:{gte:1000,lte:1500}}} }'" in the browser, I am getting the wrong answer. I am getting 20(everything) results whereas I should get only 2 . What to do? Thanks in advance.

I got the answer....instead of the second function I should be using this: function nice_format($type, $q){ return $this->call($type . '/_search?pretty=true', array('method' => 'GET', 'content' => $q));; } function nice_format($type, $q){ return $this->call($type . '/_search?pretty=true', array('method' => 'GET', 'content' => $q));; }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM