Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tahmid-saj/search-service
Typeahead search service using a Trie data structure approach. Developed using Go / Gin and AWS DynamoDB.
https://github.com/tahmid-saj/search-service
dynamodb gin go trie typeahead-search
Last synced: 15 days ago
JSON representation
Typeahead search service using a Trie data structure approach. Developed using Go / Gin and AWS DynamoDB.
- Host: GitHub
- URL: https://github.com/tahmid-saj/search-service
- Owner: tahmid-saj
- Created: 2024-09-27T04:02:58.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-10-18T01:00:52.000Z (19 days ago)
- Last Synced: 2024-10-20T12:33:35.915Z (16 days ago)
- Topics: dynamodb, gin, go, trie, typeahead-search
- Language: Go
- Homepage:
- Size: 36.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# search-service
Typeahead search service using a Trie data structure approach. Developed using Go / Gin and AWS DynamoDB.
## Directory structure
The directory structure is as follows:
- **dynamodb/**: Contains DynamoDB-specific configurations and utilities for managing the trie structure in the database.
- **models/**: Defines the data models used in the application, including Trie-related entities.
- **routes/**: Manages the API routes for handling search requests.
- **trie/**: Implements the Trie data structure logic for the typeahead search.
- **utils/**: General utility functions used across the application.
- **.gitignore**: Specifies files and directories to ignore in Git.
- **README.md**: Documentation for the project setup and usage.
- **go.mod**: Go module dependencies.
- **go.sum**: Checksum of Go module dependencies.
- **main.go**: Entry point of the application, where the server is initialized.
## Overview
### Design
The search operation of the service uses the trie nodes (stored in DynamoDB) to efficiently find the top frequent searches for a prefix. Similar services can be found here and below:
#### Similar services
### Examples
#### Sample trie table in AWS DynamoDB
#### API input and output when searching
```
// Input
{
"searchQuery": "alg",
"tableName": "search-service-trie"
}
``````
// Output
{"ok": true,
"response": [
{
"Result": "algorithms",
"ResultFrequency": 2
},
{
"Result": "alg",
"ResultFrequency": 3
},
{
"Result": "algorit",
"ResultFrequency": 1
},
{
"Result": "algo",
"ResultFrequency": 2
}
]
}
```