Tutorial by Examples

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: /dist/apache-solr-solrj-.jar /dist/solrj-lib/ Once we're done,...
If we have a schema looking like: <field name="id" type="string" indexed="true" stored="true" required="true" /> <field name="name" type="string" indexed="true" stored="true" /> the solrj co...
If you added successfully documents to Solr using the previous example, you'll be now able to retrieve them in this way: package com.stackoverflow.solrj.example; import java.io.IOException; import java.util.Iterator; import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.cli...
Handy method to initialise SolrJ client based on configuration properties; private void initSolrClient() { if (conf.kerberos().isEnabled()) { System.setProperty("java.security.auth.login.config", conf.kerberos().confPath()); HttpClientUtil.addConfigurer(new Krb5Http...

Page 1 of 1