This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Data Meilisearch 0.10.0!

Core Concepts

Spring Data Meilisearch supports the core Spring Data repository programming model, but its repository surface is intentionally narrower than stores such as JPA, MongoDB, Elasticsearch, or Redis.

The important distinction is that this module currently provides:

  • repository bootstrap through @EnableMeilisearchRepositories and the XML namespace,

  • a store-specific MeilisearchRepository<T, ID> base interface,

  • CRUD and paging/sorting methods implemented by SimpleMeilisearchRepository,

  • direct access to advanced search features through MeilisearchOperations.

It does not currently document or promise full Spring Data query derivation support, custom @Query methods, or named-query execution.

Repository Interface

MeilisearchRepository<T, ID> extends Spring Data CrudRepository and PagingAndSortingRepository. That means the stable repository contract is the built-in CRUD plus sorting/paging methods defined by those interfaces.

public interface MeilisearchRepository<T, ID>
        extends CrudRepository<T, ID>, PagingAndSortingRepository<T, ID> {
}

Execution Model

The default repository implementation delegates to MeilisearchOperations, but not every repository method uses the same underlying Meilisearch API:

  • findById(…​) and findAllById(…​) use document APIs.

  • findAll(), findAll(Sort), and findAll(Pageable) use search APIs.

  • count() is derived from the search-oriented operations layer.

That difference matters because Meilisearch search settings can affect search-backed repository methods without affecting document lookups.

When to Use Repositories vs. Operations

Use repositories when you want Spring Data’s familiar persistence model for:

  • saving and deleting entities,

  • id-based reads,

  • simple collection reads,

  • sorting and pageable access.

Use MeilisearchOperations when you need store-specific behavior such as:

  • BasicQuery, IndexQuery, FacetQuery, or SimilarQuery,

  • federated multi-search,

  • facet metadata,

  • index lifecycle management,

  • runtime settings updates.

For the concrete store-specific rules and current limitations, see Meilisearch Repositories and Repository Methods and Limitations.