@e2y/solr-client
v1.0.3
Published
Solr client for SAP Commerce using native fetch from NodeJS.
Downloads
9,325
Keywords
Readme
Solr Client
Table of contents
Installation
Execute this command in your terminal:
yarn add @e2y/solr-client
Usage
Create a client
import {SolrClient} from "@e2y/solr-client";
const solrClient = await new SolrClient(
'https://localhost:8983/solr/'
);
Query for documents
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',
// ...