Code Monkey home page Code Monkey logo

chiraag-kakar / research Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 27 KB

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.

JavaScript 56.18% EJS 43.82%
research inverted-index elasticsearch nodejs nodemon expressjs mongodb mongodbclusters ejs

research's Introduction

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

  • Tokenizes documents to words by splitting at whitespace.
  • Converts all words to lowercase.
  • Indexes these words against the documents they are from.
  • Indexes these words against the documents they are from.
  • 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
}

research's People

Contributors

chiraag-kakar avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.