Skip to content

alireza-haeri/Searchify

Repository files navigation

Searchify

A modern, high-performance Book Search API powered by .NET 9, Elasticsearch 9, and Docker.
Built to demonstrate real-world search scenarios, optimized queries, and a production-ready backend setup.


.NET Elastic Docker Status

2 Searchfy

✨ Features

  • Full-text search across title, author, description, categories, and publisher fields.
  • Smart suggestions powered by Elastic's completion suggesters.
  • Advanced filtering & sorting for precise search results.
  • Top books & analytics endpoints for curated insights.
  • Containerized setup with docker-compose for Elasticsearch + API.

🚀 Quick Start

1. Clone the repository

git clone https://github.com/alireza-haeri/Searchify.git
cd Searchify

2. Start Elasticsearch & Kibana

You need Elasticsearch 9.x.
Pull it from Docker Hub:

docker compose up -d

3. Run the API

dotnet build
dotnet run --project src/Searchify.Api

📡 API Highlights

Method Endpoint Description
GET /api/books/search Advanced multi-field search with filters, pagination, and sorting
GET /api/books/suggestion Smart type-ahead suggestions
GET /api/books/topbooks Get top-rated books, with optional category filtering
GET /api/books/categories Aggregated stats on all categories
GET /api/books/publishers Insights on publishers and their average ratings
GET /api/book/{isbn} Get a specific book by ISBN
POST /api/book Add a new book
PUT /api/book/{isbn} Update book info
DELETE /api/book/{isbn} Delete a book

🔍 Search Example

GET /api/books/search
?title=elastic
&categories=Database
&page=1
&pageSize=10
&sortBy=rating
&sortOrder=desc

💡 Suggestion Example

GET /api/books/suggestion?q=learn

Response

    [
      { "title": "Learning Elasticsearch", "author": "John Doe", "rating": 4.7 },
      { "title": "Learning .NET 9", "author": "Jane Smith", "rating": 4.5 }
    ]

🛠 Built With

  • .NET 9 Minimal APIs — clean, lightweight endpoints
  • Elasticsearch 9 — advanced search, aggregations, and suggestions
  • Docker & Docker Compose — seamless local setup for API + Elastic stack
  • FluentValidation — clean input validation

📫 Let's Connect

LinkedIn Telegram Email

About

A powerful book search API with advanced filtering, full-text search, and analytics-ready endpoints.

Resources

Stars

Watchers

Forks

Contributors