Skip to content

paginagmbh/solr-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7d6ca8d · Jul 3, 2024

History

75 Commits
Mar 10, 2020
Jun 23, 2022
Mar 10, 2020
May 3, 2018
Sep 29, 2017
Jul 12, 2018
May 4, 2018
Jul 12, 2018
Mar 10, 2020
Jul 3, 2024
Jul 3, 2024

Repository files navigation

ECMAScript Client for Apache Solr

API

This library provides two entry points, one for querying and one for loading data into a solr core.

solr-client

const solr = require("solr-client");
const index = solr({url: "URL to the Solr instance that I want to address..."});
const core = index("Name of the core that I want to address");
let results = core.select{ queryOptions }

The queryOptions parameter is expecting a ECMAScript object with keys corresponding to the parameters that your Solr query parser understands, e.g.

let queryOptions = {
    q: "Tübingen",
    df: "full_text",
    start: 0,
    rows: 10
}

The select function returns an object with the keys responseHeader and response.

solr-loader

solr-loader is a tool intended for command line usage. It can be called with the following parameters:

The basic call syntax is

solr-loader URL SOURCEGLOB

A number of optional parameters can be used:

solr-loader --clear --batch 50 --core CORENAME --swap SWAPCORENAME --schema JSONSCHEMA --encoding ENCODING --optimize URL SOURCEGLOB

If a swap parameter is given, data is first loaded into the core and once all data is processed, the core and swapcore are swapped. The default encoding is "utf-8", the default batch size 1.

License

BSD

Author Information

This library was created in 2018 by Pagina GmbH.