RESTful services for searching Apache Lucene indexes.
- JDK 1.8.x
- Maven 3.x
- Lucene 5.5.x for Lucene Index
- Java IDE, Spring Tool Suite is heavily recommended for best Spring integration
-
Import the project into an IDE as "Existing Maven Project"
-
Create an application.properties file in the config folder with your Lucene index location and port number. Refer to application.properties.template
-
Run -> mvn clean package
-
The build should run successfully and generate a runnable jar in the target folder. This can be run via terminal, or in Spring Tool Suite click Run As "Spring Boot App"
The services may be accessed via HTTP requests. They return data in JSON format. Sample nodejs application for twitter dataset is available here.
- Type: GET
- Path: /search?query=<Lucene_Query>&count=<150|all>
- Lucene Terms: username,text
- Example Lucene Query: username:jackie AND text:"i am" AND NOT text:RT
- Details on Lucene Query syntax can be found here and here
- Lucene services uses the StandardAnalyzer for its QueryParser
- Make sure you use the index the fields appropriately