DEV Community

Cover image for Spring Data Search 2.0.0 released
Nicolas Dos Santos
Nicolas Dos Santos

Posted on

Spring Data Search 2.0.0 released

I'm happy to share with you the release 2.0.0 of Spring Data Search.

This library allows to automatically expose endpoints in order to search for data related to Entities.

It provides an advanced search engine that can search on any Entity field, combine multiple criteria to refine the search, and even search on nested Entity fields.

GitHub logo Kobee1203 / spring-data-search

Automatically exposes Entity endpoints to search for data using a powerful query language

There are some new features, and some fixed bugs.
But above all there was a core refactoring to support different data access layers (JPA, MongoDB, ...).
Currently, there is only JPA supported (which was already supported by previous versions). But the next step is to add support to MongoDB.

This refactoring required some modifications in the APIs.
There is a page describing how to migrate from 1.x to 2.x.

Query GIF

Whats's new:

  • Allow special keywords to be used as query values:
    • CURRENT_DATE: keyword representing the current date. Similar to the current_date() function in SQL.
    • CURRENT_TIME: keyword representing the current time. Similar to the current_time() function in SQL
    • CURRENT_DATE_TIME: keyword representing the current date time. Similar to the current_timestamp() function in SQL
  • Application property Comma-separated list of field suffixes to be removed in order to create a field's alias from the Default value is Entity,Entities
  • Improved search on fields of Map type: You can use the special keys key or value to query the keys or values respectively. And now, you can query on the nested fields of the Objects representing by key or value
    • /search/person?
    • /search/person?

If you are interested and want to know more, please go to the project page where you will find all the details.

Top comments (0)