This repository demonstrates how to integrate MongoDB Atlas Search with the Kotlin Sync driver using a Spring Boot REST application. The goal is to create a solution for exploring and discovering properties similar to Airbnb, leveraging the advanced search capabilities of MongoDB Atlas.
You can read more on:
Before you start, make sure you have the following:
-
MongoDB Atlas Account
- Get started with MongoDB Atlas for free! If you don’t already have an account, MongoDB offers a free-forever Atlas cluster. You can sign up here.
-
Java 21+
- Ensure that you have Java 21 or higher installed. You can download the latest version from the Oracle website
-
Gradle 8.8+
- This project uses Gradle for build automation. Make sure you have Gradle version 8.8 or later. You can download Gradle from the official website.
-
IDE of Your Choice
- Use any Java IDE that you prefer. Popular options include IntelliJ IDEA, Eclipse, and Visual Studio Code. Ensure that your IDE is set up to support Java 21 and integrate with MongoDB.
-
Clone the Repository
git clone https://github.com/mongodb-developer/kotlin-driver-atlas-search.git cd kotlin-driver-atlas-search -
Build the Project
./gradlew build
-
Run the Application
./gradlew bootRun
-
Access the Endpoint
-
Once the application is running, you can access the search endpoint at http://localhost:8080/airbnb/search.
-
Endpoint Parameters:
- query: A text string to perform a full-text search with fuzzy matching on the summary field.
- minNumberReviews: The minimum number of reviews required for each Airbnb listing to be included in the results.
curl --location 'http://localhost:8080/airbnb/search?query=Istambun&minNumberReviews=50' -
