Skip to content

Commit af72e46

Browse files
committed
fix: update docs, move solr.d.ts to types.d.ts
1 parent 01839b7 commit af72e46

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,19 @@
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
1818
const { prepareSolrClient } = require("node-solr-lambda");
19-
const solr = prepareSolrClient({ core: "mycore" });
19+
const solr = prepareSolrClient("mycore");
2020

2121
async 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: "*:*",

src/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// @ts-check
22
/**
33
* Support for type checking and intellisense in vscode:
4-
* @typedef {import("./solr").SolrConfig} SolrConfig
5-
* @typedef {import("./solr").ConfigRequest} ConfigRequest
6-
* @typedef {import("./solr").SolrException} SolrException
7-
* @typedef {import("./solr").SolrDocument} SolrDocument
8-
* @typedef {import("./solr").SolrResponse} SolrResponse
9-
* @typedef {import("./solr").DeleteRequest} DeleteRequest
10-
* @typedef {import("./solr").FieldProperties} FieldProperties
11-
* @typedef {import("./solr").FieldTypeProperties} FieldTypeProperties
12-
* @typedef {import("./solr").QueryRequest} QueryRequest
4+
* @typedef {import("./types").SolrConfig} SolrConfig
5+
* @typedef {import("./types").ConfigRequest} ConfigRequest
6+
* @typedef {import("./types").SolrException} SolrException
7+
* @typedef {import("./types").SolrDocument} SolrDocument
8+
* @typedef {import("./types").SolrResponse} SolrResponse
9+
* @typedef {import("./types").DeleteRequest} DeleteRequest
10+
* @typedef {import("./types").FieldProperties} FieldProperties
11+
* @typedef {import("./types").FieldTypeProperties} FieldTypeProperties
12+
* @typedef {import("./types").QueryRequest} QueryRequest
1313
* @typedef {{name:string, type?:string, [key:string]:any}} FieldDef
1414
* @typedef {import("axios").AxiosResponse} AxiosResponse
1515
*/
File renamed without changes.

0 commit comments

Comments
 (0)