{"id":24813538,"url":"https://github.com/spring-data-search/spring-boot-starter-data-search","last_synced_at":"2025-10-13T16:31:10.366Z","repository":{"id":39990001,"uuid":"409730312","full_name":"spring-data-search/spring-boot-starter-data-search","owner":"spring-data-search","description":"Spring-Data search API augmented with Natural Language support.","archived":false,"fork":false,"pushed_at":"2023-03-07T20:10:04.000Z","size":491,"stargazers_count":7,"open_issues_count":6,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-13T15:56:58.509Z","etag":null,"topics":["antlr4","java","jpa","mongodb","spring","spring-boot","spring-boot-starter-data-search","spring-data","spring-data-jpa","spring-data-mongodb"],"latest_commit_sha":null,"homepage":"https://github.com/spring-data-search","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/spring-data-search.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-23T20:09:23.000Z","updated_at":"2024-11-07T21:38:17.000Z","dependencies_parsed_at":"2024-11-13T21:01:58.705Z","dependency_job_id":null,"html_url":"https://github.com/spring-data-search/spring-boot-starter-data-search","commit_stats":null,"previous_names":["commerce-io/spring-boot-starter-data-search"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spring-data-search%2Fspring-boot-starter-data-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spring-data-search%2Fspring-boot-starter-data-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spring-data-search%2Fspring-boot-starter-data-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spring-data-search%2Fspring-boot-starter-data-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spring-data-search","download_url":"https://codeload.github.com/spring-data-search/spring-boot-starter-data-search/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236370882,"owners_count":19138381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["antlr4","java","jpa","mongodb","spring","spring-boot","spring-boot-starter-data-search","spring-data","spring-data-jpa","spring-data-mongodb"],"created_at":"2025-01-30T15:26:50.981Z","updated_at":"2025-10-13T16:31:05.007Z","avatar_url":"https://github.com/spring-data-search.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build](https://github.com/commerce-io/spring-boot-starter-data-search/actions/workflows/build.yml/badge.svg)](https://github.com/commerce-io/spring-boot-starter-data-search/actions/workflows/build.yml)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=commerce-io_spring-boot-starter-data-search\u0026metric=security_rating)](https://sonarcloud.io/summary/new_code?id=commerce-io_spring-boot-starter-data-search)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=commerce-io_spring-boot-starter-data-search\u0026metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=commerce-io_spring-boot-starter-data-search)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=commerce-io_spring-boot-starter-data-search\u0026metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=commerce-io_spring-boot-starter-data-search)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=commerce-io_spring-boot-starter-data-search\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=commerce-io_spring-boot-starter-data-search)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=commerce-io_spring-boot-starter-data-search\u0026metric=bugs)](https://sonarcloud.io/summary/new_code?id=commerce-io_spring-boot-starter-data-search)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=commerce-io_spring-boot-starter-data-search\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=commerce-io_spring-boot-starter-data-search)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/commerce-io/spring-boot-starter-data-search/main/docs/spring-boot-starter-data-search-logo.png\"\u003e\n  \u003ch3 align=\"center\"\u003espring-boot-starter-data-search\u003c/h3\u003e\n  \u003cp align=\"center\"\u003e\n    Spring Data Search API augmented with Natural Language support.\n  \u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    \u003clabel\u003e\u003ci\u003eAlready supported:\u003c/i\u003e \u003c/label\u003e\u003cbr\u003e\n    \u003cimg src=\"https://img.shields.io/badge/SpringBoot-_2.1.0_to_2.6.x-%236DB33F.svg?logo=spring-boot\u0026logoColor=white\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/jdk-_11_to_17-%236DB33F.svg?logo=java\u0026logoColor=white\"\u003e\u003cbr/\u003e\n    \u003cimg src=\"https://img.shields.io/badge/MongoDB-%236DB330.svg?logo=mongodb\u0026logoColor=white\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Mysql-%236DB33F.svg?logo=mysql\u0026logoColor=white\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/MariaDB-%236DB33F.svg?logo=mariadb\u0026logoColor=white\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Oracle-%236DB33F.svg?logo=oracle\u0026logoColor=white\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PostgreSQL-%236DB33F.svg?logo=postgresql\u0026logoColor=white\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/DB2-%236DB33F.svg?logo=ibm\u0026logoColor=white\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/MSSQL-%236DB33F.svg?logo=microsoft\u0026logoColor=white\"\u003e\n  \u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    Data Search is compatible with \n    \u003ca href=\"https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/\" target=\"_blank\" rel=\"noreferrer noopener\"\u003e\n      Spring Native\n    \u003c/a\u003e\n    (\u003ca href=\"https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#support\" target=\"_blank\" rel=\"noreferrer noopener\"\u003esee the list of supported drivers and limitations\u003c/a\u003e)\n  \u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    \u003clabel\u003e\u003ci\u003eComing soon:\u003c/i\u003e \u003c/label\u003e\u003cbr\u003e\n    \u003cimg src=\"https://img.shields.io/badge/SpringBoot-_2.0.x-B1361E.svg?logo=spring-boot\u0026logoColor=white\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/jdk-_8-B1361E.svg?logo=java\u0026logoColor=white\"\u003e\n  \u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003clabel\u003e\u003ci\u003eDemo:\u003c/i\u003e \u003c/label\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://github.com/commerce-io/spring-boot-starter-data-search-mongodb-demo\" target=\"_blank\" rel=\"noreferrer noopener\"\u003espring-boot-starter-data-search-mongodb-demo\u003c/a\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://github.com/commerce-io/spring-boot-starter-data-search-jpa-demo\" target=\"_blank\" rel=\"noreferrer noopener\"\u003espring-boot-starter-data-search-jpa-demo\u003c/a\u003e\n\u003c/p\u003e\n\n# Table of Contents\n- [Data Search](#data-search)\n- [Features](#features)\n  - [Comparison operators](#comparison-operators)\n  - [Supported values](#supported-values)\n- [Detailed use case](#detailed-use-case)\n- [Getting Started](#getting-started)\n  - [Requirements](#requirements)\n  - [Demo](#demo)\n    - [Mongodb demo](#mongodb-demo)\n    - [JPA demo](#jpa-demo)\n  - [Installation](#installation)\n    - [Data Search Mongodb starter](#data-search-mongodb-starter)\n    - [Data Search JPA Starter](#data-search-jpa-starter)\n  - [Configuration](#configuration)\n    - [Mongodb Repository](#mongodb-repository)\n    - [JPA Repository](#jpa-repository)\n  - [Usage](#usage)\n  - [Field Mapping](#field-mapping)\n    - [Flat Mapper](#flat-mapper)\n    - [Advanced Mapper](#advanced-mapper)\n  - [Value Mapping](#value-mapping)\n- [Contributors](#Contributors)\n- [License](#license)\n\n# Data Search\nData Search provides an enterprise \u0026 production ready API, prowered by Spring Boot and Antlr, to query your data, and perform advanced search with Natural Language.\n\n**Search example**: users born after 1988-01-01, with an gmail or protonmail email address, having completed the email verification, and having an address in one of the following countries: France, Switzerland or China\n\n`birthDate \u003e: '1988-01-01' and (emailAddress : *gmail.com or emailAddress: *protonmail.com) and emailAddressVerified: true and addresses.countryCode: 'FR,CH,CN'`\n\n# Features\n- Logical operators (or/ and)\n- Parenthesis/ criteria prioritization\n- Mongodb and all JPA compatible db engines\n- Fields mapping/ DTO to Entities\n- Filter by subentity fields/ deep search\n- Advanced RegEx for Mongodb and like operator for JPA\n- All comparison operators\n\n## Comparison operators\n#### Equal :\n`emailAddressVerified : true`\n#### Not equal !:\n`emailAddressVerified !: true`\n#### In :\n`countryCode : 'FR,CH,CN'`\n#### Not in :\n`countryCode !: 'FR,CH,CN'`\n#### Starts with :\n`firstName: S*`\n#### Ends with :\n`firstName: *S`\n#### Contains :\n`firstName: *S*`\n#### Less than \u003c\n`birthDate \u003c '1988-01-01'`\n#### Less than or equal \u003c:\n`birthDate \u003c: '1988-01-01'`\n#### Greater than \u003e\n`birthDate \u003e '1988-01-01'`\n#### Greater than or equal \u003e:\n`birthDate \u003e: '1988-01-01'`\n#### Exists (is not null)\n`birthDate`\n#### Doesn't exist (is null) !\n`!birthDate`\n\n## Supported values\n#### String\n`firstName : Stan`\n#### Enum\n`title : MR`\n#### Boolean\n`emailAddressVerified : true`\n#### Number (Integer, Double, Long, BigDecimal)\n`ref \u003e: 100 or coins \u003e 6.76453`\n#### LocalTime\n`time \u003e: '18:58:24' and time \u003c: '18:58:24.999'`\n#### OffsetTime\n`time \u003e: '18:58:24Z' and time \u003c: '20:58:24.999+02:00'`\n#### LocalDate\n`birthDate \u003e: '1988-01-01'`\n#### LocalDateTime\n`createdDate \u003e: '2021-08-23T18:58:24' and createdDate \u003c: '2021-10-12T18:58:24.000'`\n#### OffsetDateTime\n`createdDate \u003e: \"2021-08-23T18:58:24Z\" and createdDate \u003c: '2021-10-12T18:58:24.000+02:00'`\n#### Array\n`countryCode : 'FR,CH,CN'`\n#### RegEx\n`emailAddress : '/.*gmail.com/'`\nRegular expression, supported only for mongodb ([see documentation](https://docs.mongodb.com/manual/reference/operator/query/regex/)) |\n\n# Detailed use case\n\nSee detailed search use case [here](./docs/use-cases.md)\n\n# Getting Started\n\n## Requirements\n\n**Java version** 11 or higher (_If java 8 support is needed, please vote\nfor [this issue](https://github.com/commerce-io/spring-boot-starter-data-search/issues/3)_)\n\n**SpringBoot version** 2.1.0 or higher\n## Demo\n### Mongodb demo\nhttps://github.com/commerce-io/spring-boot-starter-data-search-mongodb-demo\n\n### JPA demo\nhttps://github.com/commerce-io/spring-boot-starter-data-search-jpa-demo\n\n## Installation\n:arrow_right: [Get the latest releases here](https://github.com/commerce-io/spring-boot-starter-data-search/releases) :arrow_left:\n#### Data Search Mongodb starter\n**Maven**\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eapp.commerce-io\u003c/groupId\u003e\n    \u003cartifactId\u003espring-boot-starter-data-search-mongodb\u003c/artifactId\u003e\n    \u003cversion\u003e1.3.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n**Gradle**\n`implementation 'app.commerce-io:spring-boot-starter-data-search-mongodb:1.3.0'`\n\n#### Data Search JPA Starter\n**Maven**\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eapp.commerce-io\u003c/groupId\u003e\n    \u003cartifactId\u003espring-boot-starter-data-search-jpa\u003c/artifactId\u003e\n    \u003cversion\u003e1.3.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n**Gradle**\n`implementation 'app.commerce-io:spring-boot-starter-data-search-jpa:1.3.0'`\n\n## Configuration\nData Search provides a custom repository. In order to use the provided repository, add the following annotation to the main class or any other\nconfiguration class.\n\n### Mongodb Repository\n```java\n@Configuration\n@EnableMongoRepositories(repositoryBaseClass = SearchRepositoryImpl.class)\npublic class DemoConfiguration {\n}\n```\n### JPA Repository\n```java\n@Configuration\n@EnableJpaRepositories(repositoryBaseClass = SearchRepositoryImpl.class)\npublic class DemoConfiguration {\n}\n```\n\n## Usage\nMake your repositories extend `SearchRepository`\n\n```java\n@Repository\npublic interface CustomerRepository extends SearchRepository\u003cCustomer, String\u003e {\n}\n```\nAnd use in a controller or from anywhere else\n\n```java\n@RestController\n@RequiredArgsConstructor\npublic class DemoController {\n\n    private final CustomerRepository customerRepository;\n\n    @Transactional(readOnly = true)\n    @RequestMapping(\n            method = RequestMethod.GET,\n            value = \"/customers\",\n            produces = {\"application/json\"}\n    )\n    public ResponseEntity\u003cPage\u003cCustomer\u003e\u003e searchCustomers(\n            @RequestParam(value = \"search\", required = false) String search,\n            Pageable pageable) {\n\n        Page\u003cCustomer\u003e customerPage = customerRepository.findAll(\n                search,\n                pageable);\n\n        return ok(customerPage);\n    }\n}\n```\n\n## Field Mapping\nUsers will tend to filter by the search result fields, and sometimes, your DTO structure differs from your entity/ collection.\nData search provides a mapper, to define your custom mappings rules in two different ways:\n\n### Flat Mapper\nThe flat mapper is a basic String to String mapping, which could be useful for simple use cases.\n```java\nString search = \"addressName: test\";\nMapper addressMapper = Mapper.flatMapper()\n            .mapping(\"addressName\", \"address.firstName\")\n            .build();\n\nPage\u003cCustomerEntity\u003e page = customerRepository.findAll(search, pageable, addressMapper);\n```\n### Advanced Mapper\nThe advanced mapper is used for complex structure mapping, and enable the reuse of mappers. Advanced mappers can be combined with flat mappers.\n```java\nString search = \"name: test OR address.addressName: test\";\nMapper addressMapper = Mapper.flatMapper()\n            .mapping(\"addressName\", \"firstName\")\n            .build();\n\nMapper mapper = Mapper.mapper()\n                .mapping(\"name\", \"firstName\")\n                .mapping(\"address\", \"addressEntity\", addressMapper)\n                .build();\n\nPage\u003cCustomerEntity\u003e page = customerRepository.findAll(search, pageable, mapper);\n```\n\n## Value Mapping\n\nIn addition to the fields mapping, some values could be converted before returning the search result.\nData Search supports values mapping:\n\n```java\npublic class LowerCaseValueMapping implements ValueMapping {\n\n  @Override\n  public String map(String from) {\n    return from == null ? null : from.toLowerCase();\n  }\n}\n```\n\n```java\nString search = \"addressName: TeSt\";\nMapper addressMapper = Mapper.flatMapper()\n        .mapping(\"addressName\", \"address.firstName\", new LowerCaseValueMapping())\n        .build();\n\nPage\u003cCustomerEntity\u003e page = customerRepository.findAll(search, pageable, addressMapper);\n```\n\n# Contributors\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-3-blue.svg?style=flat-square)](#contributors)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\nThanks to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/adlmez\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/28732941?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e@adlmez\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/commerce-io/spring-boot-starter-data-search/commits?author=adlmez\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-adlmez\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/commerce-io/spring-boot-starter-data-search/pulls?q=is%3Apr+reviewed-by%3Aadlmez\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"#example-adlmez\" title=\"Examples\"\u003e💡\u003c/a\u003e \u003ca href=\"https://github.com/commerce-io/spring-boot-starter-data-search/commits?author=adlmez\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/features/security\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/27347476?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDependabot\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#infra-dependabot\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://allcontributors.org\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/46410174?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAll Contributors\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#infra-all-contributors\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n# License\n[![license](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/commerce-io/spring-boot-starter-data-search/blob/main/LICENSE.txt)\n\nThis software is released under the Apache license. See `LICENSE` for more information.\n\n\n[license-shield]: https://img.shields.io/badge/License-Apache_2.0-blue.svg\n\n[license-url]: https://github.com/commerce-io/spring-boot-starter-data-search/blob/main/LICENSE.txt\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspring-data-search%2Fspring-boot-starter-data-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspring-data-search%2Fspring-boot-starter-data-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspring-data-search%2Fspring-boot-starter-data-search/lists"}