Skip to content

πŸ”Ž A command line application to search different types of data and return the results in a human readable format.

Notifications You must be signed in to change notification settings

ooanishoo/search-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Welcome to search-engine πŸ”

Version License: MIT

A command line application to search different types of data and return the results in a human-readable format.

Application Instructions

Using the provided data (tickets.json and users.json and organization.json) write a simple command line application to search the data and return the results in a human-readable format.

  • Feel free to use libraries or roll your own code as you see fit. However, please do not use a database or full-text search product as we are interested to see how you write the solution.
  • Where the data exists, values from any related entities should be included in the results,i.e. searching organization by id should return it's tickets and users.
  • The user should be able to search on any field, full value matching is fine (e.g. "mar" won't return "mary").
  • The user should also be able to search for empty values,e.g. where the description is empty. Search can get pretty complicated pretty easily, we just want to see that you can code a basic but efficient search application. Ideally, search response times should not increase linearly as the number of documents grows. You can assume all data can fit into memory on a single machine.

Getting started

Prerequisites

  • node, Run node --version in terminal to verify
  • npm comes with node

Installation

Clone the repository

$ git clone https://github.com/ooanishoo/search-engine
$ cd search-engine

This is the directory/file structure once you clone the repository from the git.

β”œβ”€β”€ README.md
β”œβ”€β”€ data
β”‚   β”œβ”€β”€ organizations.json
β”‚   β”œβ”€β”€ tickets.json
β”‚   └── users.json
β”œβ”€β”€ jest
β”‚   └── setup.js
β”œβ”€β”€ jest.config.js
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ package.json
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ ask
β”‚   β”‚   β”œβ”€β”€ ask.spec.ts
β”‚   β”‚   └── ask.ts
β”‚   β”œβ”€β”€ index.ts
β”‚   β”œβ”€β”€ search
β”‚   β”‚   β”œβ”€β”€ searchEntity.spec.ts
β”‚   β”‚   └── searchEntity.ts
β”‚   β”œβ”€β”€ types
β”‚   β”‚   └── index.ts
β”‚   └── utils
β”‚       β”œβ”€β”€ index.spec.ts
β”‚       └── index.ts
└── tsconfig.json

Install dependencies

npm install

Run application

npm start

Run in dev mode

npm run dev

Run tests

npm test

Packages used:

  • inquirer: A collection of common interactive command line user interfaces.
  • jsonfile: Easily read/write JSON files in Node.js

Author

πŸ‘€ Anish Maharjan

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❀️ by readme-md-generator

About

πŸ”Ž A command line application to search different types of data and return the results in a human readable format.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published