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
6
votes
5 answers

Bad Request Error When attempting to add documents to server through Solrj

I'm trying to do a simple SolrDocument submission with Java like the one detailed in the Solrj Wiki. However, the submission always fails and returns this: org.apache.solr.common.SolrException: Bad Request Bad Request request:…
BiCen
  • 61
  • 1
  • 1
  • 2
6
votes
1 answer

How to insert Nested document in solr using spring data solr?

I need to insert this kind data to solr server. { "id":"09123" "firstName": "Harshana651175279", "lastName": "Samaranayake332146645", "department": { "id":"001", "depName":"dep01" } } These…
6
votes
3 answers

Solrj with Solr Suggester

What is the correct way of getting results from solrj using Solr Suggester? This is my request: SolrQuery query = new SolrQuery(); query.setRequestHandler("/suggest"); query.setParam("suggest", "true"); query.setParam("suggest.build",…
Ammar
  • 5,070
  • 8
  • 28
  • 27
6
votes
1 answer

Handling Solr read and write timeout exception

I am new to solr. I have developed a an website which uses solr for indexing. I want to handle the timeouts that can occur during solr read and write index.Please guide me on how can i handle these exceptions. I am using solrj as solr client and my…
azhar_salati
  • 1,554
  • 5
  • 28
  • 54
6
votes
2 answers

How to forcefully abort data import in SOLR DIH HTTP API

Follow the steps to generate the error: 1. Configure the large amount of data (around 4 GB or more than 50 millions of records) 2. Give proper data-config.xml file for indexing the data from remote database server. 3. During indexing the data into…
Sanket Thakkar
  • 725
  • 8
  • 18
6
votes
1 answer

What's the difference: ConcurrentUpdateSolrServer vs HttpSolrServer vs CommonsHttpSolrServer?

What are the differences between the following implementations of SolrServer: ConcurrentUpdateSolrServer HttpSolrServer CommonsHttpSolrServer (Note: Is this now deprecated?) As mentioned in the documentation: It is only recommended to use…
GoldenJam
  • 1,459
  • 1
  • 11
  • 17
6
votes
2 answers

Files locked after indexing

I have the following workflow in my (web)application: download a pdf file from an archive index the file delete the file My problem is that after indexing the file, it remains locked and the delete-part throws an exception. Here is my code-snippet…
Francesco
  • 2,350
  • 11
  • 36
  • 59
6
votes
4 answers

Add multiValued field to a SolrInputDocument

We are using a solr embeded instance for Java SolrJ. I want to add a multivalued field to a document. The multivalued field is a coma separated String. In Java I want to do: solrInputDocument.addField(Field1, "value1,value2,value3"); The…
Sal81
  • 101
  • 1
  • 1
  • 7
6
votes
1 answer

Exception in thread "main" java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET

Hello I try to index a row in my database in solr from my java application. I have added the necessary jars, but I keep on getting this error. My solr schema is right and I make request just add new row to my database and I want it also to be…
Tania Marinova
  • 1,788
  • 8
  • 39
  • 67
6
votes
2 answers

Faceting using SolrJ and Solr4

I've gone through the related questions on this site but haven't found a relevant solution. When querying my Solr4 index using an HTTP request of the form &facet=true&facet.field=country The response contains all the different countries along with…
Girish Rao
  • 2,609
  • 1
  • 20
  • 24
6
votes
4 answers

Solr Change CommonsHttpSolrServer To HttpSolrServer

For Basic Authentication in solr 3.5 I am using the following code, String url = "http://192.168.192.11:8080/solr/FormResponses"; CommonsHttpSolrServer server = new CommonsHttpSolrServer( url ); String username = "user"; String password =…
Jayamurugan
  • 1,757
  • 2
  • 14
  • 34
6
votes
2 answers

Querying Solr via Solrj: Basics

I am trying to query solr via solrj in Eclipse. I have tried the latest solrj wiki example: import org.apache.solr.client.solrj.SolrServer; import org.apache.solr.client.solrj.SolrServerException; import…
Chris
  • 18,075
  • 15
  • 59
  • 77
5
votes
1 answer

Solr running on Https - SolrJ Connection issue

Am running Solr in Https(8443) port on top of tomcat, How can i access that solr using solrj client, I can see only CommonsHttpSolrServer is availble, Please suggest is there any way to access the https port enabled solr using SolrJ?.
Kalidoss.M
  • 479
  • 5
  • 6
5
votes
2 answers

Solr - highlight query phrase

Is it possible to highlight whole query terms? f.e. when I ask for "United States" I want to get: United States and not: United States I've searched the whole Internet for an answer, used all combinations of…
Tom_LK
  • 113
  • 1
  • 2
  • 7
5
votes
1 answer

Solr: Determine if a document exists

I am a SolrJ beginner and want to find out whats the fastest way to determine if an document with an unique ID exists? I don't need the document, I just want to find out if it is already in the index. Now I try something like this in SolrJ: private…
Sonson
  • 1,129
  • 1
  • 11
  • 14