Solr client for SAP Commerce using native fetch from NodeJS.
npm install @e2y/solr-client* Installation
* Usage
* Create a client
* Query for documents
---
Execute this command in your terminal:
``bash`
yarn add @e2y/solr-client
`typescript
import {SolrClient} from "@e2y/solr-client";
const solrClient = await new SolrClient(
'https://localhost:8983/solr/'
);
`
`typescript
const products = await solrClient.getIndexedItems(
'master_apparel-de_Product_default',
{
code_string: '35099'
}
);
console.log(products);
// {
// numFound: 2,
// start: 0,
// numFoundExact: true,
// docs: [
// {
// indexOperationId: 110822996999537399,
// id: 'apparelProductCatalog/Staged/35099',
// pk: 8796093186049,
// code_string: '35099',
// catalogId: 'apparelProductCatalog',
// ...
``