-
JavaConfig and XML namespace configuration for the Meilisearch client and repositories.
-
Entity mapping, document and search operations, index management, and index settings.
-
Blocking Spring Data repositories for CRUD, sorting, and paging.
Requires JDK 17 or newer and a reachable Meilisearch instance; individual APIs have server-version requirements (for example, sorted document listing needs Meilisearch 1.16 or later).
The following example assumes the classes are in com.example.movies and the usual Spring Data Meilisearch imports are present:
@Document(indexUid = "movies")
class Movie {
@Id String id;
String title;
}
interface MovieRepository extends MeilisearchRepository<Movie, String> {
}
@Configuration
@EnableMeilisearchRepositories(basePackages = "com.example.movies")
class Config extends MeilisearchConfiguration {
@Override
public ClientConfiguration clientConfiguration() {
return ClientConfiguration.builder()
.connectedToLocalhost()
.withApiKey(System.getenv("MEILISEARCH_API_KEY"))
.build();
}
}Inject MovieRepository into a Spring bean and call repository.save(movie).
For an authenticated instance, use a scoped API key with the required permissions; do not embed the Meilisearch master key in application code. For an unauthenticated local instance, replace the example’s withApiKey(…) argument with "" explicitly.
See the getting-started guide for more setup and repository usage.
Set spring-data-meilisearch.version in your POM to a published version from the Maven Central badge above, then add the dependency:
<dependency>
<groupId>io.vanslog</groupId>
<artifactId>spring-data-meilisearch</artifactId>
<version>${spring-data-meilisearch.version}</version>
</dependency>To use a development snapshot, set the dependency version property to the exact published -SNAPSHOT version and add the Central snapshots repository to your Maven <repositories>:
<repository>
<id>central-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
</repository>-
Check the reference documentation, and Javadoc.
Spring Data uses GitHub as issue tracking system to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below:
-
Before you log a bug, please search the issue tracker to see if someone has already reported the problem.
-
If the issue doesn’t already exist, create a new issue.
-
Please provide as much information as possible with the issue report, we like to know the version of Spring Data Meilisearch that you are using and JVM version.
-
If you need to paste code, or include a stack trace format it as code using triple backtick.
-
If possible try to create a test-case or project that replicates the issue. Attach a link to your code or a compressed file containing your code.
Build with the bundled Maven Wrapper and JDK 17 or newer.
./mvnw clean installIf you use mvn instead, Maven 3.9.6 is the version pinned by this project’s wrapper.
Also see CONTRIBUTING.adoc if you wish to submit pull requests.
Build the authoring/PR preview documentation from the checked-out HEAD with Maven:
./mvnw -Pantora antora:antoraThe generated documentation is available from target/site/index.html.
To build the published aggregate site locally, fetch main and release tags first, then generate the temporary publish playbook after Maven has prepared the Antora CLI dependencies:
git fetch --tags origin main
./mvnw -Pantora antora:antora
rm -rf target/site
node src/main/antora/generate-publish-playbook.mjs
npx --offline antora --to-dir target/site target/antora-publish-playbook.yml
node src/main/antora/copy-latest-stable-version.mjsSpring Data Meilisearch is Open Source software released under the Apache 2.0 license.