{"id":51031830,"url":"https://github.com/tomaytotomato/spring-data-solr","last_synced_at":"2026-06-22T01:01:56.918Z","repository":{"id":357605532,"uuid":"1237505682","full_name":"tomaytotomato/spring-data-solr","owner":"tomaytotomato","description":"Spring Data Solr is back from the attic. ","archived":false,"fork":false,"pushed_at":"2026-06-10T11:04:53.000Z","size":10974,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-10T13:04:46.728Z","etag":null,"topics":["apache-solr","lucene","solr","solrj","spring","spring-boot","spring-boot-starter","spring-data"],"latest_commit_sha":null,"homepage":"https://spring-data-solr-sample-book-production.up.railway.app/docs","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomaytotomato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-13T08:42:59.000Z","updated_at":"2026-06-10T11:05:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tomaytotomato/spring-data-solr","commit_stats":null,"previous_names":["tomaytotomato/spring-data-solr-lazarus","tomaytotomato/spring-data-solr"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tomaytotomato/spring-data-solr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaytotomato%2Fspring-data-solr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaytotomato%2Fspring-data-solr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaytotomato%2Fspring-data-solr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaytotomato%2Fspring-data-solr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomaytotomato","download_url":"https://codeload.github.com/tomaytotomato/spring-data-solr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaytotomato%2Fspring-data-solr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34630753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache-solr","lucene","solr","solrj","spring","spring-boot","spring-boot-starter","spring-data"],"created_at":"2026-06-22T01:01:55.942Z","updated_at":"2026-06-22T01:01:56.907Z","avatar_url":"https://github.com/tomaytotomato.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![title.png](assets/title.png)\n\n# Spring Data Solr - Lazarus\n\n[![CI](https://github.com/tomaytotomato/spring-data-solr/actions/workflows/build.yml/badge.svg)](https://github.com/tomaytotomato/spring-data-solr/actions/workflows/build.yml)\n![Java](https://img.shields.io/badge/Java-21%2B-orange)\n![Spring Boot](https://img.shields.io/badge/Spring%20Boot-4.0.6-brightgreen)\n![Solr](https://img.shields.io/badge/Solr-9%20%7C%2010-blue)\n![License](https://img.shields.io/badge/License-Apache%202.0-blue)\n[![Live Demo](https://img.shields.io/badge/Live%20Demo-Railway-7B2CF2)](https://spring-data-solr-sample-book-production.up.railway.app/docs)\n\nSometimes you wonder if a project is really dead or if it's just taking a break in the attic.\n\nLike Lazarus, the [Spring Data Solr](https://github.com/spring-attic/spring-data-solr) project has been resurrected from the cold dark bit void.\n\nThis revival was driven by a few motivations:\n\n- **Activity**; Solr remains a highly active and popular search database. Solr is also a technology I enjoyed using.\n- **LLM maintenance and development**; creating a library is \"easy\", maintaining and growing it is the hard part.\n- **Specified requirements over instinct**: rather than vibe code the library, lets specify what we want and then verify it with tests.\n\n## Features\n\n| Feature                      | Description            | Key Capabilities                                                                                       |\n|:-----------------------------|:-----------------------|:-------------------------------------------------------------------------------------------------------|\n| **Auto-configuration**       | Drop-in Bean Support   | Automatically configures `SolrClient` (Standalone or SolrCloud) and `SolrTemplate`.                    |\n| **Spring Data Repositories** | `SolrRepository`       | Full **CRUD** support, including built-in pagination and sorting.                                      |\n| **Derived Query Methods**    | Keyword-based queries  | Supports **18 keywords** (e.g., `Is`, `Containing`, `Between`, `GreaterThan`, `In`, `IsNull`, `True`). |\n| **@Field Name Mapping**      | Annotation respect     | Derived queries respect SolrJ `@Field` annotations; fixes original mapping pain points.                |\n| **@Query Annotation**        | Manual Query Strings   | Supports raw Solr queries with `?0`, `?1` parameter substitution.                                      |\n| **Highlighting**             | `HighlightPage`        | Configurable pre/post tags, snippets, and fragment size.                                               |\n| **Faceting**                 | `FacetPage`            | Includes field facets, query facets, min count, and limit control.                                     |\n| **Deep Paging**              | Cursor-based iteration | `CursorResult` wraps Solr's `cursorMark` for efficient deep iteration.                                 |\n| **Partial Updates**          | Atomic Operations      | Supports `set`, `add`, and `increment` operations via `PartialUpdate`.                                 |\n| **Health Indicator**         | Spring Boot Actuator   | Integration that pings collections or falls back to admin info.                                        |\n| **Criteria API**             | Fluent Query Builder   | Programmatic builder: `Criteria.where(\"title\").contains(\"spring\").and(\"price\").greaterThan(10)`.       |\n\n\n## Why?\n\n![ytho.png](assets/ytho.png)\n\nProjects often go stale or die because of developer burnout, lack of time/resources or changing\npriorities from the community.\n\nWhat if we could prevent this from happening by using LLMs to take on the maintenance burden?\n\nThe gaps in API drift would be managed, old dependencies and security issues would be resolved, and\nthe\nproject would stay alive and useful for the community.\n\nThe original Spring Data Solr\nwas [discontinued in April 2020](https://spring.io/blog/2020/04/07/spring-data-for-apache-solr-discontinued/)\nand [archived in September 2023](https://github.com/spring-attic/spring-data-solr).\n\nAfter this the world moved on; Solr got updated, SolrJ was updated and Spring Boot went to version 3.\n\nHowever there was no pathway for anyone to continue to use Spring boot with Solr in a project.\n\nLazarus is a clean re-implementation with a baseline in the latest versions of all these libraries.\n\nThis is not a fork of the original library.\n\nSee [LIMITATIONS.md](docs/LIMITATIONS.md) for a detailed comparison of the original spring-data-solr\nproject.\n\n## Module Structure\n\n```\nsolr-spring-boot-autoconfigure  : all the real code: auto-configuration, template, queries, repos\nsolr-spring-boot-data-curator   : a utility tool for building data for the sample app (not important)\nsolr-spring-boot-starter        : thin POM that consumers depend on\nsolr-spring-boot-sample         : demo Spring Boot app with Docker Compose support\n```\n\n## Quick Start\n\n### Prerequisites\n\n![jean-luc-java.png](assets/jean-luc-java.png)\n\n- JDK 21+\n- Docker (for integration tests and the sample app)\n- No Maven installation needed : the project includes the Maven Wrapper\n\nNote: I would recommend jenv for managing your JDK per project https://www.jenv.be/\n\n### Build\n\n```bash\n./mvnw clean verify                    # full build + tests + coverage\n./mvnw test                            # unit tests only\n./mvnw test -pl solr-spring-boot-autoconfigure  # tests in autoconfigure module only\n```\n\n### Run the Sample App\n\n```bash\n./mvnw spring-boot:run -pl solr-spring-boot-sample\n```\n\nThis auto-starts a Solr 10 container with a pre-created `books` collection.\n\nThe app exposes book REST endpoints `/api/books`\n\nThere is also the usual Actuator health endpoints at `/actuator/health`.\n\n### Live Demo\n\nThe bookstore sample app is deployed and running on Railway:\n\n**[https://spring-data-solr-sample-book-production.up.railway.app](https://spring-data-solr-sample-book-production.up.railway.app)**\n\n- Swagger UI: `/docs`\n- OpenAPI spec: `/api-docs`\n- Health: `/actuator/health`\n\nWant your own instance? One click gets you a Railway project with both Solr and the app wired together:\n\n[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/spring-data-solr?referralCode=_GAcKG\u0026utm_medium=integration\u0026utm_source=template\u0026utm_campaign=generic)\n\nSet `SPRING_SOLR_STANDALONE_HOST` to the internal Railway URL of your Solr service once deployed.\n\n### Use in Your Project\n\nAdd the starter dependency (once published to Maven Central):\n\n```xml\n\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.tomaytotomato\u003c/groupId\u003e\n  \u003cartifactId\u003esolr-spring-boot-starter\u003c/artifactId\u003e\n  \u003cversion\u003e0.1.0-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nConfigure in `application.yml`:\n\n```yaml\n# Standalone Solr (uses HttpJdkSolrClient, zero extra dependencies)\nspring:\n  solr:\n    standalone:\n      host: http://localhost:8983/solr\n      default-collection: myCollection\n    connection-timeout: 10s\n    request-timeout: 60s\n    commit-mode: none          # or 'immediate' to hard-commit after each write\n```\n\n```yaml\n# SolrCloud (uses CloudSolrClient with ZooKeeper)\nspring:\n  solr:\n    cloud:\n      zk-host: zk1:2181,zk2:2181,zk3:2181\n      default-collection: myCollection\n```\n\nConfiguring both `standalone` and `cloud` will cause a startup error.\n\nIf you need full control (custom TLS, `HttpJettySolrClient`, etc.), define your own `SolrClient`\nbean and the auto-configuration backs off entirely.\n\nDefine a repository:\n\n```java\n\n@SolrEntity(collection = \"books\")\npublic class Book {\n\n  @Field\n  String id;\n  @Field\n  String title;\n  @Field\n  String author;\n}\n\npublic interface BookRepository extends SolrRepository\u003cBook, String\u003e {\n\n  List\u003cBook\u003e findByAuthor(String author);\n\n  List\u003cBook\u003e findByTitleContaining(String keyword);\n\n  long countByAuthor(String author);\n\n  @Query(\"title:?0 AND author:?1\")\n  List\u003cBook\u003e findByTitleAndAuthorCustom(String title, String author);\n}\n```\n\n## Links and References\n\n- [A picture of Josh Long](https://joshlong.com/img/josh-hero-image.2ac6dba0.png)\n- [Architecture](docs/ARCHITECTURE.md)\n- [Common Questions](docs/COMMON-QUESTIONS.md)\n- [Dev Log](docs/DEVLOG.md)\n- [Limitations of the Original](docs/LIMITATIONS.md)\n- [Original Project (Spring Attic)](https://github.com/spring-attic/spring-data-solr)\n- [Spring Boot Starter Template](https://github.com/ericus20/spring-boot-starter)\n- [Apache SolrJ Reference](https://solr.apache.org/guide/solr/latest/deployment-guide/solrj.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomaytotomato%2Fspring-data-solr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomaytotomato%2Fspring-data-solr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomaytotomato%2Fspring-data-solr/lists"}