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

create new core directories in SOLR on the fly

i am using solr 1.4.1 for building a distributed search engine, but i dont want to use only one index file - i want to create new core "index"-directories on the fly in my java code. i found following rest api to create new cores using an EXISTING…
ndiks
  • 103
  • 1
  • 4
10
votes
2 answers

How to get last indexed record in Solr?

I want to know how to get/search last indexed record in Apache Solr..? When the existing record is updated then it goes to end of all the records...so I want to get that last indexed record. thanks..
milind_db
  • 1,274
  • 5
  • 34
  • 56
9
votes
3 answers

Solr, how to define Nested Documents in the schema.xml

I have a document with a nested document and I want to define the schema to Solr. I have been reading the documentation but I don't know how to define the schema.xml with nested documents. When I try to index a document with addBean I get an error…
Guille
  • 2,248
  • 3
  • 24
  • 42
9
votes
4 answers

Indexing documents using Solr results in Expected mime type application/octet-stream but got text/html

What I am trying to do is to index document using Solr. I have installed and started Solr server on a Windows environment and I am trying to index using SolrJ. However when I try to add the solr document to the server as shown below it results in…
Abdelrahman Shoman
  • 2,882
  • 7
  • 36
  • 61
9
votes
1 answer

Searching for nested Documents in Solr(J)

I implemented a simple adding tool for PDF documents. I first create a master document (SolrInputDocument) of all documents. It gets fields like author, filehash, keywords, 'content_type=document' and so on. After that I generate a…
Smoki
  • 551
  • 2
  • 9
  • 28
9
votes
1 answer

Prevent from solr query injections, when using solrj

Query to HttpSolrServer. SolrQuery solrQuery = new SolrQuery(); solrQuery.setQuery(q); QueryResponse queryResponse = solrServer.query(solrQuery); I need to build a solr query, something like "author:*user_inputed_text* title:*user_inputed_text*" I…
John
  • 91
  • 1
  • 4
9
votes
4 answers

Deleting index from Solr using solrj as a client

I am using solrj as client for indexing documents on the solr server. I am having problem while deleting the indexes by 'id' from the solr server. I am using following code to delete the…
azhar_salati
  • 1,554
  • 5
  • 28
  • 54
8
votes
2 answers

Writing unit tests for Solr plugin using JUnit4, including creating collections

I wrote a plugin for Solr which contains new stream expressions. Now, I'm trying to understand what is the best way to write them unit tests: Unit tests which need to include creation of collections in Solr, so I will be able to check if my new…
Nuriel Zrubavely
  • 463
  • 3
  • 13
8
votes
2 answers

Is there a SolrJ query builder?

Using solr 5.2.0 was wondering is there a query builder API/Jar/Ckient similar to Elasticsearch query builder API or do we have to bassically do String Kungfu to build queries in Solr?
user432024
  • 4,392
  • 8
  • 49
  • 85
8
votes
2 answers

Solr: Scoring exact matches higher than partial matches

In a very simple case, I have three documents with filenames "Lark", "Larker", and "Larking" (no file extension). In solr, I index these three documents mapping the filename to a "title" field. When I do a search for "Lark" all three documents are…
Mike Nitchie
  • 1,166
  • 2
  • 13
  • 29
8
votes
2 answers

What is the default address of Solr Server (Solr 4.0) for use from a SolrJ client

I'm trying to connect with Solr Server from a SolrJ client, but it gives an HTTPResponse Exception. Here's my code: SolrServer server = new HttpSolrServer("http://"localhost":8983/solr/"); Here's the exception: java.lang.NoClassDefFoundError:…
EternallyCurious
  • 2,345
  • 7
  • 47
  • 78
8
votes
2 answers

How can I transform SolrQuery(SOLRJ) to URL?

While using SOLRJ I would like to know how can I convert SolrQuery object to its URL representation with SOLR query syntax. I tried to use .toString() method but it doesnt return proper query representation. Is there some other way how to do it?
David Marko
  • 2,477
  • 3
  • 27
  • 58
8
votes
2 answers

Is there a way to dynamically update a synonym file without restarting Solr server?

As we know there is a synonym.txt file in conf directory, which I wanted to update whenever I found some new synonym words... So is there any way to update that file dynamically without restarting the Solr server and will my search result consider…
milind_db
  • 1,274
  • 5
  • 34
  • 56
7
votes
1 answer

Solrj and Dynamic Fields

I'm have a solr schema with dynamic field of different types in. Eg in the schema.xml there are:
Tim P
  • 948
  • 1
  • 12
  • 19
7
votes
1 answer

Limiting terms in Solr's TermsComponent to terms originating from certain documents

I am using Solrs TermsComponent to implement an autocomplete feature. My documents contain tags which I have indexed in a "tags" field. Now I can use TermsComponent to find out which tags are used in all the stored documents. This works pretty well…
Jan Thomä
  • 13,296
  • 6
  • 55
  • 83