Search Engine is a project that implements a basic search engine using C++, Python, and Cython. It builds a reverse index and ranks pages with the PageRank algorithm based on keyword relevance and page importance.
Project description
Search Engine
Search Engine is a simple, efficient engine that builds a reverse index for keyword searching and ranks results using the PageRank algorithm.
⚙️ Installation
Please create a virtual environment using venv, as the project is still in alpha testing and in its initial implementations.
python3 -m venv .env
source .env/bin/activate
pip install search-engine-cpp
🚀 Usage
from search_engine.crawler import Crawler
crawler = Crawler("https://en.wikipedia.org", "/wiki/", "Cat", test_mode=True)
graph = crawler.run(limit=10)
my_dict = graph.compute_page_rank()
top = sorted(my_dict.items(), key=lambda item: item[1], reverse=True)[:3]
print(top)
📋 Requirements for Contributions
Before compiling the project, ensure your environment meets the following requirements:
- CMake 3.10 or higher
- Google Test for unit testing
- A C++11 compatible compiler or higher
📂 Project Structure
The project is organized as follows:
src/: Main implementation of the search engine, including reverse indexing and the PageRank algorithm.tests/: Unit tests to verify the functionality of the system.CMakeLists.txt: Configuration file for building the project with CMake.
🔧 Building the Project
To compile the project, follow these steps:
-
Create a
builddirectory and navigate into it:mkdir build && cd build
-
Run CMake to generate the build files:
cmake .. -
Compile the project using make:
make
🧪 Running Tests for Contributions
Run unit tests to ensure the correctness of the system.
-
After building the project, navigate to the
builddirectory and execute:./tests/unit-tests/LibUnitTests
This will run the tests covering search engine functionality, reverse indexing, and the PageRank algorithm.
🏃 Running Examples for Contributions
The first step is building the project, for this to run:
poetry install
poetry build
After building it, run this command to see the library working:
poetry run python Examples/graph_example.py
⚙️ How It Works
- Reverse Indexing: Maps keywords to the documents where they appear.
- PageRank: An algorithm that assigns a relevance score to each document based on its links and structure.
- Querying: Searches for documents related to a keyword and ranks them according to their PageRank score.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
👥 Contributors
We welcome all contributions to this project! Please make sure to follow the guidelines outlined in the CONTRIBUTING.md file.
Thanks to all contributors
Made with contrib.rocks.
Keep learning,
Pedro;)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file search_engine_cpp-0.1.3.tar.gz.
File metadata
- Download URL: search_engine_cpp-0.1.3.tar.gz
- Upload date:
- Size: 84.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.0 CPython/3.11.11 Linux/6.8.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db814d6749e954e71358547dfdbd070b7ee24cecd83fc81c9c2ec76c71592204
|
|
| MD5 |
c186d29b6457db3a1f41766d0d2bce2a
|
|
| BLAKE2b-256 |
97022f4068e6dfc71e31c9dc7a3bccb05897fc4106c286832ca488335f0e032b
|
File details
Details for the file search_engine_cpp-0.1.3-cp311-cp311-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: search_engine_cpp-0.1.3-cp311-cp311-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 744.4 kB
- Tags: CPython 3.11, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.0 CPython/3.11.11 Linux/6.8.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9888f68a1b7db33a1313e4069120c68aa0f7bc56b1478a9222f021efde1f37a3
|
|
| MD5 |
19f01d4d2c1187e8436855b7f3bb4964
|
|
| BLAKE2b-256 |
fad4513d4e38aa98095dd8dd0bcf3756bc3551ce3757123dd0889026a351c32f
|