Skip to content

A Spring Boot application that transforms an Obsidian vault into a fully searchable knowledge base using MongoDB Atlas Search. Features full-text search, autocomplete, fuzzy matching, and custom boosting, all exposed through a REST API.

License

Notifications You must be signed in to change notification settings

mongodb-developer/SpringSearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpringSearch – Obsidian Vault Search API

SpringSearch turns your Obsidian vault into a fully searchable knowledge base, powered by Spring Boot and MongoDB Atlas Search.
It supports full-text queries, autocomplete, fuzzy matching, and custom boosting for prioritizing your most relevant notes — all exposed via a simple REST API.

Features

  • Full-text search: Query across title, tags, and content fields.
  • Autocomplete: Type-ahead search for instant suggestions.
  • Fuzzy matching: Tolerates typos and misspellings in queries.
  • Custom boosting: Prioritize matches in specific fields like title or tags.
  • Obsidian integration: Automatically parses Markdown files (with frontmatter) into MongoDB documents.
  • REST API: Simple endpoints for searching notes.

Prerequisites

  • Java 24+ (or update pom.xml to your installed version)
  • Maven 3.9+
  • MongoDB Atlas (free M0 cluster is sufficient)
  • An existing Obsidian Vault containing Markdown notes with optional frontmatter.

Getting Started

1. Clone the repository

git clone https://github.com/mongodb-developer/SpringSearch.git
cd SpringSearch

2. Configure MongoDB

Edit the src/main/resources/application.properties file:

spring.data.mongodb.uri=${MONGODB_URI}
spring.data.mongodb.database=obsidian
notes.folder.path=/path/to/your/vault

Make sure your MongoDB Atlas cluster has a Search Index with this configuration:

{
  "mappings": {
    "dynamic": false,
    "fields": {
      "title": [
        { "type": "string" },
        { "type": "autocomplete" }
      ],
      "tags": { "type": "string" },
      "content": { "type": "string" }
    }
  }
}

3. Run the app

MONGODB_URI="your-mongodb-uri" mvn spring-boot:run

API Endpoints

Basic search:

GET /api/notes/search?q=<query>

Boosted by title:

GET /api/notes/search/boost-title?q=<query>

Autocomplete + fuzzy matching:

GET /api/notes/search/autocomplete-fuzzy?q=<query>

All-in-one (boosting + autocomplete + fuzzy):

GET /api/notes/search/autocomplete-fuzzy-boosted?q=<query>

Example Query

curl "http://localhost:8080/api/notes/search?q=Spring%20Boot"

About

A Spring Boot application that transforms an Obsidian vault into a fully searchable knowledge base using MongoDB Atlas Search. Features full-text search, autocomplete, fuzzy matching, and custom boosting, all exposed through a REST API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages