88- plain javascipt in commonjs format - no additional build step required
99- ES6+ including async/await, lambdas, spread operator...
1010- typechecking support in vscode (without compiling typescript code)
11- - no dependencies other than ` axios `
11+ - no runtime dependencies other than ` axios `
1212- as close as possible to the Solr Json-based REST API
13- - functions for working with document , fields and field types
13+ - functions for working with documents , fields, field types, cores
1414
1515# Example
1616
1717``` js
1818const { prepareSolrClient } = require (" node-solr-lambda" );
19- const solr = prepareSolrClient ({ core : " mycore" } );
19+ const solr = prepareSolrClient (" mycore" );
2020
2121async function myfun () {
22- const mycoreExists = await solr .ping (); // -> true if "mycore" exists
2322 const result = await solr .query ({ query: " label:something" });
24- console .log (result . data );
23+ console .log (result);
2524
2625 await solr .addField ({ name: " price" , type: " plong" , multiValued: false });
2726 await solr .addField ({
@@ -35,6 +34,7 @@ async function myfun() {
3534 const item2 = { id: " item2" , price: 456 , category: [" cpu" , " usb" ] };
3635 await solr .add (item1); // works with single object
3736 await solr .add ([item1, item2]); // works with object[]
37+ await solr .commit ()
3838
3939 await solr .query ({
4040 query: " *:*" ,
0 commit comments