This section provides an overview of what solrj is, and why a developer might want to use it.
It should also mention any large subjects within solrj, and link out to the related topics. Since the Documentation for solrj is new, you may need to create initial versions of those related topics.
Add documents to Solr using SolrJ
If we have a schema looking like:
the solrj code to add content to Solr will look like:
Init SolrJ client for local STANDALONE cluster vs remote CLOUD with Kerberos
Handy method to initialise SolrJ client based on configuration properties;
REMOTE with Kerberos:
Installation or Setup
SolrJ comes as part of the Solr distribution since Solr 1.x. The latest Solr version can be downloaded here.
From Solr-6.3.0 that is the latest version available, we need to get the following libraries and add them to our build path:
Once we're done, SolrJ is ready to communicate with our Solr instance. In the following example we'll see how to use SolrJ to query or add content to Solr.
Query Solr with SolrJ
If you added successfully documents to Solr using the previous example, you'll be now able to retrieve them in this way:
This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0