Skip to content

log-test/simple-rest-file-search-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Search Services

This is a simple RESTful services for searching File.

Dependencies:

Setup:

  1. Import the project into an IDE as "Existing Maven Project"

  2. Create an application.properties file in the config folder with your Lucene index location and port number. Refer to application.properties

###Example #Path to Lucene index directory lucene.index.location=D:\files\
And copy the example files Test1.txt and Test2.txt to the above filder for testing. In production it will be the real files.

  1. Run -> mvn clean package

  2. 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"

Using Services

The services may be accessed via HTTP requests. They return data in JSON format.

Search query for Index records

  • Type: GET

  • Path: /search?query=<Lucene_Query>&count=<150|all> - Query string is a lucene format.

https://lucene.apache.org/core/2_9_4/queryparsersyntax.html

  • Example Tests:

Single word:

http://localhost:9090/search?query=contents:bloganathan

Multiple Word:

http://localhost:9090/search?query=contents:"Test23" contents:"Test1"

About

Simple REST File Search API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages