Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chiraag-kakar/research
reSearch is a simple application that takes in multiple paragraphs(documents) of text, assigns a unique ID to each paragraph and stores the words to paragraph mappings on an inverted index.Given a word to search for, it lists out the top 10 paragraphs in which the word is present.
https://github.com/chiraag-kakar/research
ejs elasticsearch expressjs inverted-index mongodb mongodbclusters nodejs nodemon research
Last synced: about 21 hours ago
JSON representation
reSearch is a simple application that takes in multiple paragraphs(documents) of text, assigns a unique ID to each paragraph and stores the words to paragraph mappings on an inverted index.Given a word to search for, it lists out the top 10 paragraphs in which the word is present.
- Host: GitHub
- URL: https://github.com/chiraag-kakar/research
- Owner: chiraag-kakar
- Created: 2021-06-19T19:28:03.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-06-24T10:57:16.000Z (over 3 years ago)
- Last Synced: 2023-08-07T19:28:05.796Z (over 1 year ago)
- Topics: ejs, elasticsearch, expressjs, inverted-index, mongodb, mongodbclusters, nodejs, nodemon, research
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# reSearch
reSearch is a simple application that takes in multiple paragraphs(documents) of text, assigns a unique ID to each paragraph and stores the words to paragraph mappings on an inverted index.Given a word to search for, it lists out the top 10 paragraphs in which the word is present.Note 1 : It is assumed that the user has **Postman** installed to test the api by sending HTTP requests and **MongoDB Cluster** to be used as Database.
Note 2 : It is also assumed that the user has **Node** (LTS version) , **npm** & **nodemon** installed globally.
# API Specifications at a Glance
- [x] Tokenizes documents to words by splitting at whitespace.
- [x] Converts all words to lowercase.
- [x] Indexes these words against the documents they are from.
- [x] Indexes these words against the documents they are from.
- [x] Generates a unique ID for every document that is indexed.## API Documentation :
---```
# API Endpoint Locally : http://localhost:3000/
``````
Headers
Content-Type : application/json
```### /research/index
* `POST`: Index a given document (After having split the input into paragraphs a.k.a document)
* Query :
```
{
"documents" : string
}
```
* Response :
```
{
"message": string
}
```### /research/search
* `POST`: Given a word, search for it and retrieve the top 10 paragraphs (Documents) that contain it.
* Query :
```
{
"query" : string
}
```
* Response :
```
{
"paragraphs": {
"tags" : array,
"_id" : string,
"text" : string,
}
}
```### /research/clear
* `GET`: Clear the index and all indexed documents.
* Response :
```
{
"message": string
}
```