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:
And if you search for batman building
, you'll get this:
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.
You'll need python 3.
-
clone this repository
-
download either sample.tar.bz2 or sample.zip and untar/unzip it in your
tinysearch
directory. -
python tiny.py small-sample
to create a search index! -
pip install flask
-
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.
The instructions above only search 50 files. To search all 8,000+ files, make these two changes:
-
python tiny.py large-sample
to create the index. This takes ~5 minutes. -
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.)