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
7
votes
1 answer

Creating Solr client using Solrj Api with Kerberized Solr

I am trying to create a solr client using solrj api for kerberised solr. And as per the documentation of solrj, it is required to set HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer()); in code. But the solrj api jar do not have the…
Amit Kumar
  • 1,544
  • 11
  • 23
7
votes
1 answer

SOLR slave is doing full Copy as it was not able to Delete unused Index dir

When a slave replicates the index it creates a index directory with name format as index.timestamp next time when it replicates it tries to cleanup and create a new folder with new time stamp but in my case its not happening and everytime i see…
Adarsh H D Dev
  • 588
  • 7
  • 29
7
votes
2 answers

Solrj cannot connect to zookeeper from Solr Cloud Example

I started a Solrcloud by running the included example bin/solr -e cloud, and in that case, I managed to start up a three nodes Solr cloud and created a gettingstarted collection:…
B.Mr.W.
  • 18,910
  • 35
  • 114
  • 178
7
votes
1 answer

Solr doesn't overwrite - duplicated uniqueKey entries

I have a problem with Solr 5.3.1 . My Schema is rather simple. I have one uniqueKey which is the "id" as string. indexed, stored and required, non-multivalued. I add documents first with a "content_type:document_unfinished" and then overwrite the…
tom_w
  • 133
  • 1
  • 8
7
votes
1 answer

Solr rule based boost

I am using Solr-5.0.0. I am searching on a field product_name. I need to add some rules to get relevant results. If I search for a word, if exact match exists , it should come first. Ex: if I search for laptop ,it should return exact product_name…
Juhan
  • 1,283
  • 2
  • 11
  • 30
7
votes
0 answers

Solr cloud performance degradation with billions of documents

I am trying to use SolrCloud to index a very large number of simple documents and have run into some performance and scalability limitations and was wondering what can be done about it. Hardware wise, I have a 32-node Hadoop cluster that I use to…
pashgol pashgolian
  • 193
  • 1
  • 2
  • 10
7
votes
2 answers

How to access the admin interface of an EmbeddedSolrServer instance?

In my web app I am running an org.apache.solr.client.solrj.embedded.EmbeddedSolrServer for debugging purposes I would like to access the admin interface. This is how I instantiate the server: new EmbeddedSolrServer(new…
zsawyer
  • 1,824
  • 17
  • 24
7
votes
1 answer

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException

I try Querying Solr via Solrj Here is my code public class ReadFromSolr { public static void main(String[] args) throws MalformedURLException, SolrServerException { String url = "http://localhost:8983/solr"; try{ SolrServer server…
Tania Marinova
  • 1,788
  • 8
  • 39
  • 67
7
votes
2 answers

to get the count of multi valued field in solr

In solr i have a multiValued field called animal and it has the values {cat,dog} is it possible to get the number of values inside the multiValued field in solr(in my example 2)?
ak87
  • 161
  • 2
  • 9
7
votes
2 answers

Proper use of SolrResponse.getStatus()

Looking around at examples on the web, I am guessing that getStatus() returns a zero for success, and that most failures will manifest as an exception, rather than a non-zero error code. Is that true? Is it safe/correct to throw an error when…
Adam Rabung
  • 5,232
  • 2
  • 27
  • 42
6
votes
2 answers

Can solr return function values (not solr score or document fields)?

We are making a solr query where we are giving a custom function (which is pretty complex) and sorting the results by value of that function. The query looks something…
Mushtaq Ahmed
  • 6,382
  • 2
  • 18
  • 14
6
votes
1 answer

solrj: how to store and retrieve List via multivalued field in index

My use case is an index which holds titles of online media. The provider of the data associates a list of categories with each title. I am using SolrJ to populate the index via an annotated POJO class e.g. @Field("title") private String…
David Victor
  • 830
  • 9
  • 29
6
votes
2 answers

Solr and MySQL, How to keep an updated index, and, is a DB even needed if it's simple?

I'm a complete beginner with Solr, so bear with me. :) In my current project I have a very simple DB - just 1 table that contains 4 fields: id, name, subject, msg. The way I understand, every time a new record is added (or removed), I'd need to add…
Val Schuman
  • 1,798
  • 2
  • 18
  • 23
6
votes
2 answers

Using POST HTTP method to read data from Solr using SolrJ

We are using the SolrJ client to query documents from Solr. The query that we are building is large and Solr is rejecting the query (with error response 414 URI Too Long). However, I can directly call Solr's /query endpoint and post the query as the…
Amit
  • 290
  • 2
  • 10
6
votes
1 answer

Difference between getElapsedTime() and getQTime() in solr for java

I'm using Solr for Java and want to know what is the difference between getElapsedTime() and getQTime(), after optimization solr indexes I'm confused which one is for what. SolrServer solrObject =…
Jama A.
  • 15,680
  • 10
  • 55
  • 88