Not getting any value while searching the products using REST APIFiltering data in magento REST APIHow to use V1/search to get the names and SKU's of the magento productsSort Products REST API : Magento 2GET products for my cart with customer tokenHow to load another language variables by REST APIMagento2 : Getting error while updating the data using APIAdd Configurable products using REST APIgetting “Consumer is not authorized to access %resources” when using rest API in magento2Getting error while set shipping estimation using REST APIhow to add js in custom form in backend magento 2
Should I report a leak of confidential HR information?
How hard is it to sell a home which is currently mortgaged?
How exactly is a normal force exerted, at the molecular level?
Why do I need two parameters in an HTTP parameter pollution attack?
Can I travel from Germany to England alone as an unaccompanied minor?
How can I write a panicked scene without it feeling like it was written in haste?
How did installing this RPM create a file?
Can a function nowhere continuous have a connected graph?
What could a reptilian race tell by candling their eggs?
Security Patch SUPEE-11155 - Possible issues?
Why do we use a cylinder as a Gaussian surface for infinitely long charged wire?
How can I deal with extreme temperatures in a hotel room?
One folder having two different locations on Ubuntu 18.04
How to securely dispose of a smartphone?
Should I share with a new service provider a bill from its competitor?
Is it bad to describe a character long after their introduction?
Lifting a probability measure to the power set
Balanced parentheses using STL C++
Why do changes to /etc/hosts take effect immediately?
Perl 6 multi methods never match expected signature
Who voices the character "Finger" in The Fifth Element?
Why was Mal so quick to drop Bester in favour of Kaylee?
Handling a player (unintentionally) stealing the spotlight
Is it legal to call shared_future::get() multiple times on the same instance in the same thread?
Not getting any value while searching the products using REST API
Filtering data in magento REST APIHow to use V1/search to get the names and SKU's of the magento productsSort Products REST API : Magento 2GET products for my cart with customer tokenHow to load another language variables by REST APIMagento2 : Getting error while updating the data using APIAdd Configurable products using REST APIgetting “Consumer is not authorized to access %resources” when using rest API in magento2Getting error while set shipping estimation using REST APIhow to add js in custom form in backend magento 2
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am searching product as per product sku and name
using the end point API of magento2 but for some search text no value is coming. I am explaining my code below.
There is one product present which is given below.
"id":124,
"sku":"Birthday Cake",
"name":"Birthday Cakes",
When I am searching this product using the following code its returning null as output.
$stext='Cake';
$searchText='%'.$stext.'%';
$ch = curl_init('http://abcd.com/index.php/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=name&searchCriteria[filterGroups][0][filters][0][value]='.$searchText.'&searchCriteria[filterGroups][0][filters][0][conditionType]=like&searchCriteria[filterGroups][0][filters][1][field]=sku&searchCriteria[filterGroups][0][filters][1][value]='.$searchText.'&searchCriteria[filterGroups][0][filters][1][conditionType]=like');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer " . json_decode($token)));
$res = curl_exec($ch);
$resu = json_decode($res, 1);
echo json_encode($resu);
Here I need to check the similar keyword. For this $stext='Cake'
the output is coming null but for $stext='Birthday'
the proper output is coming. Again when I am searching $stext='Birthday Cake'
no output is coming.
Here I need to do the text search as per name and sku
.
magento2 php rest-api
add a comment |
I am searching product as per product sku and name
using the end point API of magento2 but for some search text no value is coming. I am explaining my code below.
There is one product present which is given below.
"id":124,
"sku":"Birthday Cake",
"name":"Birthday Cakes",
When I am searching this product using the following code its returning null as output.
$stext='Cake';
$searchText='%'.$stext.'%';
$ch = curl_init('http://abcd.com/index.php/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=name&searchCriteria[filterGroups][0][filters][0][value]='.$searchText.'&searchCriteria[filterGroups][0][filters][0][conditionType]=like&searchCriteria[filterGroups][0][filters][1][field]=sku&searchCriteria[filterGroups][0][filters][1][value]='.$searchText.'&searchCriteria[filterGroups][0][filters][1][conditionType]=like');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer " . json_decode($token)));
$res = curl_exec($ch);
$resu = json_decode($res, 1);
echo json_encode($resu);
Here I need to check the similar keyword. For this $stext='Cake'
the output is coming null but for $stext='Birthday'
the proper output is coming. Again when I am searching $stext='Birthday Cake'
no output is coming.
Here I need to do the text search as per name and sku
.
magento2 php rest-api
add a comment |
I am searching product as per product sku and name
using the end point API of magento2 but for some search text no value is coming. I am explaining my code below.
There is one product present which is given below.
"id":124,
"sku":"Birthday Cake",
"name":"Birthday Cakes",
When I am searching this product using the following code its returning null as output.
$stext='Cake';
$searchText='%'.$stext.'%';
$ch = curl_init('http://abcd.com/index.php/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=name&searchCriteria[filterGroups][0][filters][0][value]='.$searchText.'&searchCriteria[filterGroups][0][filters][0][conditionType]=like&searchCriteria[filterGroups][0][filters][1][field]=sku&searchCriteria[filterGroups][0][filters][1][value]='.$searchText.'&searchCriteria[filterGroups][0][filters][1][conditionType]=like');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer " . json_decode($token)));
$res = curl_exec($ch);
$resu = json_decode($res, 1);
echo json_encode($resu);
Here I need to check the similar keyword. For this $stext='Cake'
the output is coming null but for $stext='Birthday'
the proper output is coming. Again when I am searching $stext='Birthday Cake'
no output is coming.
Here I need to do the text search as per name and sku
.
magento2 php rest-api
I am searching product as per product sku and name
using the end point API of magento2 but for some search text no value is coming. I am explaining my code below.
There is one product present which is given below.
"id":124,
"sku":"Birthday Cake",
"name":"Birthday Cakes",
When I am searching this product using the following code its returning null as output.
$stext='Cake';
$searchText='%'.$stext.'%';
$ch = curl_init('http://abcd.com/index.php/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=name&searchCriteria[filterGroups][0][filters][0][value]='.$searchText.'&searchCriteria[filterGroups][0][filters][0][conditionType]=like&searchCriteria[filterGroups][0][filters][1][field]=sku&searchCriteria[filterGroups][0][filters][1][value]='.$searchText.'&searchCriteria[filterGroups][0][filters][1][conditionType]=like');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer " . json_decode($token)));
$res = curl_exec($ch);
$resu = json_decode($res, 1);
echo json_encode($resu);
Here I need to check the similar keyword. For this $stext='Cake'
the output is coming null but for $stext='Birthday'
the proper output is coming. Again when I am searching $stext='Birthday Cake'
no output is coming.
Here I need to do the text search as per name and sku
.
magento2 php rest-api
magento2 php rest-api
asked Jun 19 at 11:15
satyasatya
1587 bronze badges
1587 bronze badges
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f278857%2fnot-getting-any-value-while-searching-the-products-using-rest-api%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f278857%2fnot-getting-any-value-while-searching-the-products-using-rest-api%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown