{"id":25452347,"url":"https://github.com/raphaelsenn/prefix-search-engine","last_synced_at":"2025-09-03T06:36:35.014Z","repository":{"id":199121507,"uuid":"702180442","full_name":"raphaelsenn/prefix-search-engine","owner":"raphaelsenn","description":"Simple Prefix Binary Tree-based string search engine written in Rust.","archived":false,"fork":false,"pushed_at":"2023-10-09T11:28:22.000Z","size":8105,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-16T12:13:44.647Z","etag":null,"topics":["algorithms-and-data-structures","binary-search","binary-search-tree","binary-tree","fltk","prefix","prefix-search","rust","rust-lang","search-algorithm","search-engine","searchengine","searching-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raphaelsenn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-08T18:16:56.000Z","updated_at":"2023-10-10T05:40:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"6eb56842-85b4-43ad-b8e9-ee83de798959","html_url":"https://github.com/raphaelsenn/prefix-search-engine","commit_stats":null,"previous_names":["raphsenn/prefix-search-engine","raphaelsenn/prefix-search-engine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/raphaelsenn/prefix-search-engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fprefix-search-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fprefix-search-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fprefix-search-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fprefix-search-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphaelsenn","download_url":"https://codeload.github.com/raphaelsenn/prefix-search-engine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fprefix-search-engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273403950,"owners_count":25099299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms-and-data-structures","binary-search","binary-search-tree","binary-tree","fltk","prefix","prefix-search","rust","rust-lang","search-algorithm","search-engine","searchengine","searching-algorithms"],"created_at":"2025-02-17T23:05:33.387Z","updated_at":"2025-09-03T06:36:34.957Z","avatar_url":"https://github.com/raphaelsenn.png","language":"Rust","readme":"# prefix-search-engine\n\nThis project contains a BinaryTree struct that represents the prefix binary tree data structure used for efficient string searching. The BinaryTree struct is responsible for organizing and managing the dataset of strings, enabling quick prefix-based searches.\n\n\u003cdiv align=\"left\"\u003e\n  \u003cimg src=\"./res/example.gif\" alt=\"gif\"\u003e\n\u003c/div\u003e\nFor testing purposes, i included a sample file named \"top-1m.csv\" that contains the top 1 million web URLs. This allows you to demonstrate the speed and efficiency of this search engine when performing prefix searches on a large dataset.\n\nPlease note that in a real-world scenario, you would typically obtain such data from a web source or another relevant data provider..\n\n### Features\n- Fast and efficient string searching using a prefix binary tree.\n- Supports searching in text files with one string per line.\n- Simple and easy-to-use interface.\n\n### Binary-Search-Tree\nThe binary tree implemented in this project uses lexicographical order (lexikographische Ordnung) for organizing and searching strings. This means that strings are arranged in the tree according to their lexicographical (dictionary) order, where \"smaller\" strings come before \"larger\" strings based on their character sequences.\n\n#### Example Tree\n\u003cp float=\"left\"\u003e\n   \u003cimg src=\"./res/binarysearchtreenames.png\" width=500 height=500\u003e\n\u003c/p\u003e\nFor simplicity, we translate this binary tree with strings into one with integers, ensuring that the trees are isomorphic.\n\n#### Translated Tree\n\u003cp float=\"left\"\u003e\n   \u003cimg src=\"./res/binarysearchtreeint.png\" width=500 height=500\u003e\n\u003c/p\u003e\n\n##### How the lookup and lookup_recursive method works\nFirst create the translated tree, for simplicity we work here with integers, not with strings..\n```js\nlet mut tree = SearchTree::new();\ntree.push(4);\ntree.push(2);\ntree.push(6);\ntree.push(1);\ntree.push(3);\ntree.push(5);\ntree.push(7);\n```\nCall the lookup method:\n```js\ntree.lookup(2, 5));\n```\nThe result of lookup(2,5) would look visual like that:\n\u003cp float=\"left\"\u003e\n   \u003cimg src=\"./res/lookup.png\" width=500 height=500\u003e\n\u003c/p\u003e\n\n### Dependencies\nThis project uses the FLTK library for creating the user interface. You can add it to your Cargo.toml file:\n\n#### Install FLTK-libary\nRun the following Cargo command in your project directory:\n```js\nCargo add fltk\nCargo add fltk-theme\n```\n#### About FLTK\n```js\nhttps://crates.io/crates/fltk\n```\n### Usage\n1. Clone the Repository to your local machine:\n```js\ngit clone https://github.com/raphsenn/prefix-search-engine.git\n```\n2. Navigate to the directory:\n```js\ncd prefix-search-engine\n```\n3. Check if your Cargo.toml has the fltk flag under [dependencies]:\n```js\n[dependencies]\nfltk = \"1.4.13\"\nfltk-theme = \"0.7.1\"\n\n[[bin]]\nname = \"searchengine\"\npath = \"searchengine.rs\"\n```\n4. You can specify the input dataset file by modifying top-1m.csv file, to a file of your own:\n```js\nsearch_engine.read(\"top-1m.csv\")?;\n```\n\n5. Compile and run the project using Cargo:\n```js\ncargo run\n```\n\n### License\nThis project is licensed under the MIT License. See the LICENSE file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fprefix-search-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaelsenn%2Fprefix-search-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fprefix-search-engine/lists"}