This is a simple search application built with Java Spring Boot and Apache Lucene. The application provides functionality for indexing and searching documents. A TermQuery is used as an example to demonstrate the Search Process.
- Java 17 or higher
- Maven
- Apache Lucene core and analyzers
- Spring Boot
- Spotless Java
git clone https://github.com/swethakann/simple-lucene-search.git
cd simple-lucene-search
mvn clean install
mvn spring-boot:run
This is a GET and not a POST request since we index a static set of files given in this repository for demonstration purposes.
Endpoint: GET /index
curl -X GET "http://localhost:8080/index"
Endpoint: DELETE /delete
curl -X DELETE "http://localhost:8080/delete"
Endpoint: POST /search
curl -X POST http://localhost:8080/search \
-H "Content-Type: application/json" \
-d '{
"type": "TermQuery",
"maxHits": 4,
"fieldName": "fileContent",
"fieldValue": "lucene"
}'