Skip to content

quarkiverse/quarkus-solr

Repository files navigation

Quarkus Solr

Build Maven Central License

Integrates Apache Solr into Quarkus for JDK and native builds.

Features

  • Solr as a dev-service for local development
  • Provide SolrJ beans for interacting with Solr
  • Native compilation support
  • Integration with Quarkus observability stack (health, metrics, logging)

Getting Started

Add the following dependency to your project:

<dependency>
    <groupId>io.quarkiverse.solr</groupId>
    <artifactId>quarkus-solr</artifactId>
    <version>${latest.version}</version>
</dependency>

Then you can use SolrJ beans in your application to interact with Solr. For example:

import org.apache.solr.client.solrj.SolrClient;

@ApplicationScoped
public class SolrService {
    @Inject
    SolrClient solrClient;

    public SolrDocumentList query(String query) throws SolrServerException, IOException {
        SolrQuery solrQuery = new SolrQuery();
        solrQuery.setQuery(query);
        return solrClient.query("collectionName", solrQuery).getResults();
    }
}

For dev-mode, a Solr instance will be automatically started and configured with a default collection called dummy. For non-dev-mode, you have to configure the Solr client using the following property:

quarkus.solr.url=http://localhost:8983/solr

Documentation

Check the documentation for detailed information and usage guidelines.

Compatibility

Quarkus Solr has only been tested with Solr 10.0.0 and Quarkus 3.34.0, but other versions of Solr and Quarkus should work as well. If you encounter any issues, please report them in the issue tracker.

Contributing

Feel free to contribute to this project by submitting issues or pull requests.

Changelog

Changelog is available in GitHub

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

About

Apache Solr is the blazing-fast, open source, multi-modal search platform built on the full-text, vector, and geospatial search capabilities of Apache Lucene. This extension provides integration with Solr, allowing you to easily add search capabilities to your Quarkus applications.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages