Skip to content

This service provides a solution for performing full-text searches in English book texts. It allows users to search for phrases or specific words, returning accurate results.

Notifications You must be signed in to change notification settings

wyrdsister/Fulltext_Search_Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Full-text Search Engine

This service provides a solution for performing full-text searches in English book texts. It allows users to search for phrases or specific words, returning accurate results.

Table of Contents

Installation

  1. Clone the repository:
 git clone https://github.com/yourusername/yourproject.git
  1. Install dependencies:
  ./gradlew build 
  1. Run the service:
  ./gradlew bootRun

Usage

  1. Create a new index:
curl --location 'http://localhost:8080/api/v1/index' \
--header 'Content-Type: application/json' \
--data '{
    "language" : "EN",
    "libraryInfo" : {
        "name" : "test"
    }
}'

The service returns the JSON with index ID:

{
  "id": "test"
}
  1. Add new documents to index:
curl --location 'http://localhost:8080/api/v1/index/test' \
--header 'Content-Type: application/json' \
--data '{
    "id": "5",
    "name": "The Science of Stress Management",
    "author": "Dr. Robert T. Keller",
    "content": "Stress is a natural response to perceived threats, but chronic stress can lead to physical and mental health issues. Psychology provides tools to manage stress effectively, such as cognitive-behavioral techniques, relaxation exercises, and time management strategies. Identifying stressors is the first step in addressing them. Whether through mindfulness meditation, physical activity, or seeking social support, reducing stress is essential for overall well-being. Understanding the psychology behind stress empowers individuals to develop healthier coping mechanisms and build resilience against life’s inevitable pressures.",
    "page": 5
}'

The fields "id" and "page" are not required. The service returns new document ID or ID from JSON.

  1. Search for phrases or specific words in a index.

The service can search for

  • words without or with 1-2 mistakes.
curl --location --request GET 'http://localhost:8080/api/v1/index/test' \
--header 'Content-Type: application/json' \
--data '{
"text" : "strateies"
}'
  • phrase without mistakes in words.
curl --location --request GET 'http://localhost:8080/api/v1/index/test' \
--header 'Content-Type: application/json' \
--data '{
"text" : "Stress is a natural response"
}'
  • parts of a phrase.
curl --location --request GET 'http://localhost:8080/api/v1/index/test' \
--header 'Content-Type: application/json' \
--data '{
"text" : "Stress is response"
}'

The service returns the list of results:

{
  "documents": [
    {
      "id": "5",
      "name": "The Science of Stress Management",
      "author": "Dr. Robert T. Keller",
      "page": 5
    }
  ],
  "size": 1
}

License

This project is licensed under the MIT License.

About

This service provides a solution for performing full-text searches in English book texts. It allows users to search for phrases or specific words, returning accurate results.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages