1.2.0 • Published 3 years ago

oni-indexer v1.2.0

Weekly downloads
2
License
GPL-3.0-or-later
Repository
github
Last release
3 years ago

JSON LD Solr Indexer


NOTES:

  • Currently spec'd to work only with Datacrate JSON-LD.

    TODO:

  • build schema of solr with config file

  • Generalise to use any json-ld
  • Make createROCrateIndexer as part of the library
  • Test with other types of json-ld's

Example implementation:

Generate JSON-LDs

node generate-datacrates.js -d ./test-data/generated/ -n 100

or

npm run generate

Commit to SOLR

Modify config.json to suit your needs.

Use

node ./commit-to-solr.js --config ./config.json

or

npm run commit

Detail

const fieldConfig = require('./fields.json');
let indexer = new ROCrateIndexer();
indexer.setConfig(fieldConfig);

const entryPath = path.join('test-data','CATALOG.json');
let entryJson = fs.readFileSync(entryPath).toString();
entryJson = JSON.parse(entryJson);

const solrObject = await indexer.createSolrObject(entryJson, '@graph');
1.2.0

3 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.0

4 years ago