Questions tagged [solrj]

Solrj is a java client to access solr. It offers a java interface to add, update, and query the solr index. SolrJ hides a lot of the details of connecting to Solr and allows your application to interact with Solr with simple high-level methods.

Solrj is also the name of the Java client used to access the Solr server. It offers a Java interface to add, update, and query the Solr index. This way you get everything in a neat little package, and can avoid parsing and working with XML directly.The SolrJ API is included with Solr, so you do not have to download or install anything else. However, in order to build and run applications that use SolrJ, you have to add some libraries to the classpath.

Solr is a standalone enterprise search server with a REST-like API. You put documents in it (called "indexing") via XML, JSON or binary over HTTP. You query it via HTTP GET and receive XML, JSON, or binary results.

Solr is the popular, blazing fast open source enterprise search platform from the Apache Lucene project. Its major features include powerful full-text search, hit highlighting, faceted search, dynamic clustering, database integration, rich document (e.g., Word, PDF) handling, and geospatial search. Solr is highly scalable, providing distributed search and index replication, and it powers the search and navigation features of many of the world's largest internet sites.

Solr is written in Java and runs as a standalone full-text search server within a servlet container such as Tomcat. Solr uses the Lucene Java search library at its core for full-text indexing and search, and has REST-like HTTP/XML and JSON APIs that make it easy to use from virtually any programming language. Solr's powerful external configuration allows it to be tailored to almost any type of application without Java coding, and it has an extensive plugin architecture when more advanced customization is required.

Related Tags:

1614 questions
5
votes
2 answers

Does Solr have xml alternative to the @Field annotation?

I want to use QueryResponse.getBeans() I have classes defined in another project which does not have solr dependencies, so I can't use @Field on them Is there an xml (or other externalized) alternative to @Field?
Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140
5
votes
2 answers

Solr/SolrJ: how to iterate results without creating a giant ArrayList

Is there a way to iterate over a Solrj response such that the results are fetched incrementally during iteration, rather than returning a giant in-memory ArrayList? Or do we have to resort to this: SolrQuery query = new SolrQuery(); …
George Armhold
  • 30,824
  • 50
  • 153
  • 232
5
votes
3 answers

How to get Lucene explanation for a SolrDocument with Solrj?

I'm searching an Solr index with SolrJ and trying to get the Lucene explanation for logging it for further use. The code goes like this: SolrServer server = new CommonsHttpSolrServer("solr_url"); SolrQuery solrquery = new SolrQuery(); …
Timo Albert
  • 645
  • 1
  • 6
  • 17
5
votes
2 answers

SOLRJ-6.0.0: Insertion of a bean object which associate list of bean object is giving null pointer exception

Employee Bean Class: public class Employee2 { private String id; private String name; private String designation; private double salary; private double totalExperience; // private Address2 address2; private…
Sanjay Madnani
  • 803
  • 7
  • 16
5
votes
1 answer

Difference between "Num Docs" and "Max Doc" in Solr

Can someone let me know what is the difference between Num Docs and Max Doc reported in Solr Admin? I am seeing this difference in value after executing deleteByQuery from SolrJ. I am using Solr 5.2.1
tuk
  • 5,941
  • 14
  • 79
  • 162
5
votes
0 answers

Writing / Updating external field file for Solr via Solr API

Is there a way to write external file (containing external file field) for Solr via some API? I tried to find into Solr docs but unable to find anything that help!! Here is more details as requested. I am working on a project where I have few…
Krunal
  • 2,967
  • 8
  • 45
  • 101
5
votes
0 answers

SolrException: maxNumThreadStates must be >= 1 but was: 0

SolrException: maxNumThreadStates must be >= 1 but was: 0 I get following response while trying to create core. Can anyone help on how to deal with maxNumThreadStates?
Anupam
  • 869
  • 7
  • 13
5
votes
1 answer

Solrcloud Zookeper Setup : No registered leader was found after waiting for 4000ms , collection: c1 slice: shard2

Am using solr 4.10.3, I start solr via embedded jetty server in java. Am trying to configure solrcloud with 2 shards(Leaders). I have an external zookeeper setup, I point to zookeeper instance while starting solr like this. …
Vijay
  • 415
  • 5
  • 18
5
votes
2 answers

How to make Multiple word search in SOLRJQuery

I am currently working with SolrJ API for our webapplication. We need to have multiple word search in the application. But I do not know how to do it. Here is the code we have developed so far by searching on the web. HttpSolrClient solr = new…
Joju
  • 107
  • 8
5
votes
1 answer

Why do I get "KeeperErrorCode = NoNode for /clusterstate.json" when I use SolrJ and SolrCloud?

I've downloaded Solr 4.10.3, running the server with the provided setup, and I can insert documents into it using SolrJ (v. 4.0.0) by using HttpSolrServer without any problems. But I cannot insert any documents when I try to use CloudSolrServer.…
Emre Sevinç
  • 8,211
  • 14
  • 64
  • 105
5
votes
1 answer

CloudSolrServer : Could not find collection : gettingstarted

I'm getting following exception while trying to upload document on SolrCloud using CloudSolrServer. Exception in thread "main" org.apache.solr.common.SolrException: Could not find collection : gettingstarted at…
Adnan
  • 276
  • 4
  • 11
5
votes
1 answer

Spring data solr - Bean with Highlight

I'm writing a Web Application that communicates with Solr and I am using Spring Data Solr + SolrJ to get the information in Java. For the Solr query, I am using (e)DisMax with some options (for now, and maybe later I need to add other…
Mistre83
  • 2,677
  • 6
  • 40
  • 77
5
votes
1 answer

Solr throwing SocketException: Connection reset

I have 8 node solr cloud cluster connected with external zookeeper. Each node : 30 Gb, 4 core. I have created around 100 collections, each collection is having approx. 30 shards. (Why I need it, let be a different story, business isolation, business…
nxG
  • 61
  • 4
5
votes
1 answer

how to extract stats component with solrj 4.9.0

I have a solr query like this q=categories:cat1 OR categories:cat2&stats=true&stats.field=count&stats.facet=block_num Basically, I want to get the sum(count) group by block num. This query works on a browser. But with solrj, I could not access…
E.A.
  • 321
  • 1
  • 4
  • 13
5
votes
1 answer

SolrJ and Auto Commit

I am adding documents to a Solr 4.3 core using SolrJ API , I noticed that I have the autocommit set to 15 seconds in the stock solrconfig that I am using as below. ${solr.autoCommit.maxTime:15000}
user1965449
  • 2,849
  • 6
  • 34
  • 51