{"id":377028,"date":"2023-04-25T10:21:14","date_gmt":"2023-04-25T10:21:14","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=377028"},"modified":"2023-04-29T04:08:47","modified_gmt":"2023-04-29T04:08:47","slug":"get-collections-with-searchcriteriabuilder-in-magento-2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/","title":{"rendered":"Get Collections with SearchCriteriaBuilder in Magento 2"},"content":{"rendered":"\n<p>In this post, we will explore how to get collections with SearchCriteriaBuilder in Magento 2. Although this is widely utilized in Magento 2&#8217;s core code, it remains unfamiliar to many developers.<\/p>\n\n\n\n<p>Magento 2 strongly insists developers use Repositories to perform CRUD operations and the repository uses <strong>SearchCriteriaBuilder<\/strong> to fetch records.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">What are the Search Criteria?<\/h4>\n\n\n\n<p>\u201cSearch Criteria\u201d to search\/filter the desired result from a repository.<\/p>\n\n\n\n<p><strong>What is Search Criteria Builder?<\/strong><\/p>\n\n\n\n<p>Search Criteria Builder helps us to build our <a href=\"https:\/\/devdocs.magento.com\/guides\/v2.3\/extension-dev-guide\/searching-with-repositories.html\">search criteria<\/a>.&nbsp;Basically, Search Criteria Builder is a class instance of what we need to search for. In order to use it, we need Search Criteria Interface. For that add its dependency to our class.<\/p>\n\n\n\n<p><strong>Filter<\/strong>:<\/p>\n\n\n\n<p>Filters help to create search criteria filters we can set the field, its condition, and its value on the basis of which we want to filter\/search the repository.<\/p>\n\n\n\n<p><strong>To get collections with SearchCriteriaBuilder in Magento 2, you can follow these steps:<\/strong><\/p>\n\n\n\n<p>1. Inject the <code><strong>Magento\\Framework\\Api\\SearchCriteriaBuilder<\/strong><\/code> class in your constructor.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">protected $searchCriteriaBuilder;\n\npublic function __construct(\n    \\Magento\\Framework\\Api\\SearchCriteriaBuilder $searchCriteriaBuilder\n) {\n    $this-&gt;searchCriteriaBuilder = $searchCriteriaBuilder;\n}<\/pre>\n\n\n\n<p>2. Set the search criteria using the <code><strong>addFilter()<\/strong><\/code> method of <code><strong>SearchCriteriaBuilder<\/strong><\/code> class:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">$this-&gt;searchCriteriaBuilder-&gt;addFilter(&#039;field_name&#039;, &#039;field_value&#039;);<\/pre>\n\n\n\n<p><strong>Note<\/strong>: You can add multiple filters to the search criteria by calling <code>addFilter()<\/code> multiple times.<\/p>\n\n\n\n<p>3. Build the search criteria using the <code><strong>create()<\/strong><\/code> method of <code><strong>SearchCriteriaBuilder<\/strong><\/code> class:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">$searchCriteria = $this-&gt;searchCriteriaBuilder-&gt;create();<\/pre>\n\n\n\n<p>4. Retrieve the collection using the <code><strong>get()<\/strong><\/code> method of the repository interface:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">$collection = $this-&gt;repository-&gt;getList($searchCriteria);<\/pre>\n\n\n\n<p><strong>Note:<\/strong> Where <code>$repository<\/code> is the instance of the repository interface for the entity you want to retrieve.<\/p>\n\n\n\n<p><strong>Let&#8217;s see an example of complete code:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\nuse Magento\\Framework\\Api\\SearchCriteriaBuilder;\nuse Magento\\Catalog\\Api\\ProductRepositoryInterface;\n\nclass testClass\n{\n    protected $searchCriteriaBuilder;\n    protected $productRepository;\n\n    public function __construct(\n        SearchCriteriaBuilder $searchCriteriaBuilder,\n        ProductRepositoryInterface $productRepository\n    ) {\n        $this-&gt;searchCriteriaBuilder = $searchCriteriaBuilder;\n        $this-&gt;productRepository = $productRepository;\n    }\n\n    public function getProductCollection()\n    {\n        $this-&gt;searchCriteriaBuilder-&gt;addFilter(&#039;status&#039;, 1);\n        $this-&gt;searchCriteriaBuilder-&gt;addFilter(&#039;visibility&#039;, &#091;2, 3], &#039;in&#039;);\n        $searchCriteria = $this-&gt;searchCriteriaBuilder-&gt;create();\n        $products = $this-&gt;productRepository-&gt;getList($searchCriteria)-&gt;getItems();\n\n        return $products;\n    }\n}<\/pre>\n\n\n\n<p>In the above example, we are using them <code><strong>ProductRepositoryInterface<\/strong><\/code> to retrieve a collection of products. <\/p>\n\n\n\n<p>We are adding two filters to the search criteria using the <strong><code>addFilter()<\/code> <\/strong>method of the <code><strong>SearchCriteriaBuilder<\/strong><\/code> class. The first filter filters products by their status, and the second filter filters products by their visibility.<\/p>\n\n\n\n<p>The <strong>create() <\/strong>method is called on the <code><strong>SearchCriteriaBuilder<\/strong><\/code> object to create the search criteria object.<\/p>\n\n\n\n<p>Then finally, we call the <code><strong>getList<\/strong>()<\/code> method of  <code><strong>ProductRepositoryInterface<\/strong><\/code> to retrieve the product collection that matches the search criteria.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">To perform a multiple filter search in Magento 2 using the AND operator, you can use the following code:<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\">$searchCriteria = $this-&gt;searchCriteriaBuilder\n                -&gt;addFilter(&#039;attribute_code1&#039;, &#039;value1&#039;)\n                -&gt;addFilter(&#039;attribute_code2&#039;, &#039;value2&#039;)\n                -&gt;create();<\/pre>\n\n\n\n<p>In this code, <code>attribute_code1<\/code> and <code>attribute_code2<\/code> are the attribute codes we want to filter by, and <code>value1<\/code> and <code>value2<\/code> are the values we want to filter for those attributes. We can add as many filters as you need by calling <code>addFilter()<\/code> multiple times.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">To perform a multiple filter search in Magento 2 using the OR operator:<\/h4>\n\n\n\n<p>We need to add a class dependency to our constructor.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\\Magento\\Framework\\Api\\FilterBuilder $filterBuilder<\/pre>\n\n\n\n<p>Using <strong>FilterBuilder<\/strong>, we can add our filters to perform OR operations.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">$searchCriteria = $this-&gt;searchCriteriaBuilder-&gt;addFilters(&#091;\n    $this-&gt;filterBuilder\n        -&gt;setField(&#039;attribute_code1&#039;)\n        -&gt;setValue(&#039;value1&#039;)\n        -&gt;create(),\n    $this-&gt;filterBuilder\n        -&gt;setField(&#039;attribute_code2&#039;)\n        -&gt;setValue(&#039;value2&#039;)\n        -&gt;create()\n])-&gt;create();<\/pre>\n\n\n\n<p> If we want to set filters AND\/OR combinations then we will add another class<strong> FilterGroupBuilder<\/strong>. which combines the different filters into a single array.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\\Magento\\Framework\\Api\\Search\\FilterGroupBuilder $filterGroupBuilder<\/pre>\n\n\n\n<p><strong>Let&#8217;s check the example<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\/\/ AND\n$this-&gt;searchCriteriaBuilder-&gt;addFilter(&#039;attribute1&#039;,&#039;value2&#039;);\n$this-&gt;searchCriteriaBuilder-&gt;addFilter(&#039;attribute2&#039;,&#039;value2&#039;);\n\n\/\/ OR\n$attr3 = $this-&gt;filterBuilder-&gt;setField(&#039;attribute3&#039;)\n            -&gt;setValue(&#039;value3&#039;)\n            -&gt;setConditionType(&#039;eq&#039;)\n            -&gt;create();\n\n$attr4 = $this-&gt;filterBuilder-&gt;setField(&#039;attribute4&#039;)\n            -&gt;setValue(&#039;value4&#039;)\n            -&gt;setConditionType(&#039;eq&#039;)\n            -&gt;create();\n\n$filterOr = $this-&gt;filterGroupBuilder\n            -&gt;addFilter($attr3)\n            -&gt;addFilter($attr4)\n            -&gt;create();\n\n $this-&gt;searchCriteriaBuilder-&gt;setFilterGroups(&#091;$filterOr]);\n $searchCriteria = $this-&gt;searchCriteriaBuilder-&gt;create();\n $this-&gt;productRepository-&gt;getList($searchCriteria);<\/pre>\n\n\n\n<p>By the above code, the following query will generate.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">attribute1 = &#039;value1&#039; AND attribute2 = &#039;value2&#039; AND (attribute3=&#039;value3&#039; OR attribute4 = &#039;value4&#039;)<\/pre>\n\n\n\n<p>That&#8217;s it. These are the simple steps to get collections with SearchCriteriaBuilder in Magento 2 and how we can get collections using multiple filters in SearchCriteria.<\/p>\n\n\n\n<p><strong><strong>You may like other posts:<\/strong><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/webkul.com\/blog\/advanced-pricing-in-magento2\/\">Advanced Pricing in Magento2<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/webkul.com\/blog\/customize-magento2-theme\/\">Understanding Magento Theme: Customize Theme (Child-Theme-Concept)<\/a><\/p>\n\n\n\n<p>Thanks &amp; Happy Coding !!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we will explore how to get collections with SearchCriteriaBuilder in Magento 2. Although this is widely utilized in Magento 2&#8217;s core code, it remains unfamiliar to many developers. Magento 2 strongly insists developers use Repositories to perform CRUD operations and the repository uses SearchCriteriaBuilder to fetch records. What are the Search Criteria? <a href=\"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":378,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9121],"tags":[2070,14003,14002],"class_list":["post-377028","post","type-post","status-publish","format-standard","hentry","category-magento-2","tag-magento2","tag-searchcriteria","tag-searchcriteriabuilder"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Get Collections with SearchCriteriaBuilder in Magento 2<\/title>\n<meta name=\"description\" content=\"how to get collections with SearchCriteriaBuilder in Magento 2. Although this tool is widely utilized in Magento 2&#039;s core code\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get Collections with SearchCriteriaBuilder in Magento 2\" \/>\n<meta property=\"og:description\" content=\"how to get collections with SearchCriteriaBuilder in Magento 2. Although this tool is widely utilized in Magento 2&#039;s core code\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-25T10:21:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-29T04:08:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ashish Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ashish Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/\"},\"author\":{\"name\":\"Ashish Kumar\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/57d23646a58691882a6bd0baf5dadc21\"},\"headline\":\"Get Collections with SearchCriteriaBuilder in Magento 2\",\"datePublished\":\"2023-04-25T10:21:14+00:00\",\"dateModified\":\"2023-04-29T04:08:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/\"},\"wordCount\":480,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"keywords\":[\"Magento2\",\"SearchCriteria\",\"SearchCriteriaBuilder\"],\"articleSection\":[\"Magento 2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/\",\"url\":\"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/\",\"name\":\"Get Collections with SearchCriteriaBuilder in Magento 2\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2023-04-25T10:21:14+00:00\",\"dateModified\":\"2023-04-29T04:08:47+00:00\",\"description\":\"how to get collections with SearchCriteriaBuilder in Magento 2. Although this tool is widely utilized in Magento 2's core code\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get Collections with SearchCriteriaBuilder in Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/57d23646a58691882a6bd0baf5dadc21\",\"name\":\"Ashish Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3ade0803c37d8f9fe88d8255d0db5361c67b2bc36a6bafa1b3e8804285115c9b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3ade0803c37d8f9fe88d8255d0db5361c67b2bc36a6bafa1b3e8804285115c9b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Ashish Kumar\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/ashishkumar-mg770\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Get Collections with SearchCriteriaBuilder in Magento 2","description":"how to get collections with SearchCriteriaBuilder in Magento 2. Although this tool is widely utilized in Magento 2's core code","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/","og_locale":"en_US","og_type":"article","og_title":"Get Collections with SearchCriteriaBuilder in Magento 2","og_description":"how to get collections with SearchCriteriaBuilder in Magento 2. Although this tool is widely utilized in Magento 2's core code","og_url":"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-04-25T10:21:14+00:00","article_modified_time":"2023-04-29T04:08:47+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Ashish Kumar","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Ashish Kumar","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/"},"author":{"name":"Ashish Kumar","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/57d23646a58691882a6bd0baf5dadc21"},"headline":"Get Collections with SearchCriteriaBuilder in Magento 2","datePublished":"2023-04-25T10:21:14+00:00","dateModified":"2023-04-29T04:08:47+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/"},"wordCount":480,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"keywords":["Magento2","SearchCriteria","SearchCriteriaBuilder"],"articleSection":["Magento 2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/","url":"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/","name":"Get Collections with SearchCriteriaBuilder in Magento 2","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2023-04-25T10:21:14+00:00","dateModified":"2023-04-29T04:08:47+00:00","description":"how to get collections with SearchCriteriaBuilder in Magento 2. Although this tool is widely utilized in Magento 2's core code","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/get-collections-with-searchcriteriabuilder-in-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Get Collections with SearchCriteriaBuilder in Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/57d23646a58691882a6bd0baf5dadc21","name":"Ashish Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3ade0803c37d8f9fe88d8255d0db5361c67b2bc36a6bafa1b3e8804285115c9b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3ade0803c37d8f9fe88d8255d0db5361c67b2bc36a6bafa1b3e8804285115c9b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Ashish Kumar"},"url":"https:\/\/webkul.com\/blog\/author\/ashishkumar-mg770\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/377028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/378"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=377028"}],"version-history":[{"count":9,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/377028\/revisions"}],"predecessor-version":[{"id":378940,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/377028\/revisions\/378940"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=377028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=377028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=377028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}