Lucene Serverless
This project demonstrates a proof-of-concept serverless full-text search solution built with Apache Lucene and Quarkus framework.
Please note that the project is not ready for production since I haven't tested it under a prolonged load and to be honest interfaces need to be nicer.
Read the blog post about it here
Prerequisites
- Serverless framework >= 1.56.1
- AWS account
Run it
-
Replace region, vpc id and subnets in the
serverless.yml
file -
Deploy the stack
sls deploy
-
Don't forget to remove it if you're not planning to use it
sls remove
Index a document
URL: https://<api-id>.execute-api.<region>.amazonaws.com/dev/index
HTTP method: POST
Example request body:
{
"indexName": "books",
"documents": [
{
"name": "The Foundation",
"author": "Isaac Asimov"
}
]
}
Query documents
URL: https://<api-id>.execute-api.<region>.amazonaws.com/dev/query
HTTP method: POST
Example request body:
{
"indexName": "books",
"query": "author:isaac"
}
Example response body:
{
"totalDocuments": "1",
"documents": [
{
"author": "Isaac Asimov",
"name": "The Foundation"
}
]
}
Build native image
./mvnw clean package