Code Monkey home page Code Monkey logo

typeahead-search-engine's Introduction

Typeahead Search Engine

A real-time suggestion service, which enable users to search for known and frequently searched terms. It tries to predict the query based on the characters the user has enteredand gives a list of suggestions to complete the query.

Getting Started

docker build . -t typeaheadsuggestion
docker container run -p 80:80 typeaheadsuggestion

Algorithm

Since we've got to serve a lot of queries with minimum latency, we need to come up with a scheme that can effeciently store our data such that it can be queried quickly. We can't depend upon some database for this, we need to store our index in memory in a highly efficient data structure.

One of the most appropriate data structures that can serve our purpose is the Trie

Trie

Complexity

  • Space : O(n)
  • Search : O(n)
  • Insert : O(n)
  • Delete : O(n)

Compute most relevant elements

To compute the k most relevant elements, we can use a Heap (Priority Queue), to be able to do it during the search in an efficient way O(nlog(k)).

For dev env

For dev env you can use the swagger page accessible using this url : https://localhost/swagger

Swagger

Author

typeahead-search-engine's People

Contributors

zakariamaaraki avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

nasa03

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.