Giter VIP home page Giter VIP logo

tinysearch-1's Introduction

tinysearch

The challenge

Change this search engine to recognize exact phrases and boost them up to the top of the search results.

Explanation: If you run this search engine and search for hot chicken, you'll get this:

picture of search results

And if you search for batman building, you'll get this:

picture of search results

We want to see Nashville%2C-Tennessee.txt at the top of both queries.

The information you need to do this is already in the index.

How to run this search engine

You'll need python 3.

  1. clone this repository

  2. download either sample.tar.bz2 or sample.zip and untar/unzip it in your tinysearch directory.

  3. python tiny.py small-sample to create a search index!

  4. pip install flask

  5. FLASK_DEBUG=1 FLASK_APP=web.py flask run to start the web server!

Then you can go to http://localhost:5000/ to see the toy search engine.

How to switch to the large sample

The instructions above only search 50 files. To search all 8,000+ files, make these two changes:

  1. python tiny.py large-sample to create the index. This takes ~5 minutes.

  2. In web.py, just change the string "small-sample" to "large-sample". (When you save that file, Flask will notice and automatically restart your web server.)

tinysearch-1's People

Contributors

blbradley avatar jorendorff 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.