{"id":19099695,"url":"https://github.com/pilotpirxie/coresearch","last_synced_at":"2025-05-03T23:30:25.949Z","repository":{"id":127271280,"uuid":"220551702","full_name":"pilotpirxie/coresearch","owner":"pilotpirxie","description":"🔎 .NET Core cross-platform, in-memory, full text search library for building search engines. Made to learn C#.","archived":false,"fork":false,"pushed_at":"2019-12-02T23:42:17.000Z","size":136,"stargazers_count":43,"open_issues_count":0,"forks_count":27,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-07T22:41:37.397Z","etag":null,"topics":["algorithm","algorithms","beginner-project","big-data","dotnet","dotnet-core","dotnetcore","full-text-search","inmemory-db","learning","text-search"],"latest_commit_sha":null,"homepage":"","language":"C#","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/pilotpirxie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-11-08T21:39:08.000Z","updated_at":"2025-01-24T10:06:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"73b284e2-7ccd-46e8-9b49-f5bf8101aed4","html_url":"https://github.com/pilotpirxie/coresearch","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotpirxie%2Fcoresearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotpirxie%2Fcoresearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotpirxie%2Fcoresearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotpirxie%2Fcoresearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pilotpirxie","download_url":"https://codeload.github.com/pilotpirxie/coresearch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252269026,"owners_count":21721239,"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","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":["algorithm","algorithms","beginner-project","big-data","dotnet","dotnet-core","dotnetcore","full-text-search","inmemory-db","learning","text-search"],"created_at":"2024-11-09T03:52:12.609Z","updated_at":"2025-05-03T23:30:25.703Z","avatar_url":"https://github.com/pilotpirxie.png","language":"C#","funding_links":[],"categories":["dotnet","algorithm"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n \u003cimg src=\"https://i.imgur.com/EUHKODL.png\" alt=\"Coresearch\"/\u003e\n\u003c/p\u003e\n\n# coresearch\n .NET Core cross-platform, in-memory, full text search library for building search engines\n\n## About\n**Coresearch** uses an inverted index with a boosted trie data structure for indexing atomic search criterion from content to resources. Trie algorithm makes Coresearch more elastic and allows both exact word querying and operations like fuzzy search, wildcards and character matching. Entire trie structure is stored in memory for better performance. The entire project was written as a learning project so be aware of putting in on the production 😉\n\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"https://i.imgur.com/w3BSIkm.gif\" alt=\"Trie\"/\u003e\n\u003c/p\u003e\n\n## Features\n* Efficient **inverted index** algorithm (mapping from content to resources)\n* Uses **Prefix Tree (Trie)** data structure for quick search and horizontal scaling\n* **Exact search** with super fast O(k) worst case time, where k is the key length \n* **Wildcard search** for recursive depth-first search tree traversal  \n* **Character match** search with deep level k+1\n* Simple **command line** tool and **library**\n* **Cross-platform**, runs on Linux, MacOS and Windows\n* Easily handle **large amount of different resources**\n\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/b/be/Trie_example.svg/1024px-Trie_example.svg.png\" alt=\"Trie\"/\u003e\n\u003c/p\u003e\n\n[Trie on Wikipedia](https://en.wikipedia.org/wiki/Trie)\n\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"https://i.imgur.com/KtePNXo.gif\" alt=\"Trie\"/\u003e\n\u003c/p\u003e\n\n## CLI commands\n### Load data from files in specific path and extension (recursive)\n```\nsource \u003cstring path\u003e \u003cstring extension\u003e\nalias: load\n```\nexample:\n```\n\u003e source ./ *.txt\n```\n\n### Get resource names for exact key (word)\n```\nget \u003cstring key\u003e\nalias: search\n```\n\nexample:\n```\n\u003e search cars\noutput:\n\u003cresource names for key cars\u003e\n```\n\n### Search for every resource name which key starts with prefix \n\nQuery modes:\n* Question mark (?) is for select of all resource names belong to children of specific node (if any).\n* Wildcard sign (\\*) is for select of all resource names recursively under specific prefix.\n* Exact matching (without any sign) produces equal output as get/search command.\n```\nquery \u003cstring prefix\u003e \u003cquery mode: . or *\u003e\n```\n\nexample 1: \n```\n\u003e query c ?\noutput: \n\u003cresource names for keys: ca, cb, c5, co, c1, ...\u003e\n```\nexample 2: \n```\n\u003e query c *\noutput: \n\u003cresource names for keys: ca, cabbage, c4a541, cars, cardio, cantaloupe, ...\u003e\n```\nexample 3: \n```\n\u003e query cars\noutput: \n\u003cresource names for key cars\u003e\n```\n\n### Add resource under key (word)\n```\nadd \u003cstring resource name\u003e \u003cstring content\u003e\nalias: insert\n```\nexample:\n```\n\u003e add english-dict.txt house \n```\n\n### Remove specific key (word)\n```\ndelete \u003cstring key\u003e\n```\n\nexample:\n```\n\u003e delete sport\n```\n\n### Echo\n```\necho \u003cstring content\u003e\n```\n\nexample:\n```\n\u003e echo hello\noutput:\nhello\n```\n\n### Turn on/off debug mode\n```\ndebug \u003cbool\u003e\n```\n\nexample:\n```\n\u003e debug true\n```\n\n### Remove every node in structure and collect memory\n```\nflush\n```\n\nexample:\n```\n\u003e flush\n```\n\n### Show information\n```\ninfo\n```\n\nexample:\n```\n\u003e flush\noutput:\nNodes in trie: 4651175\nWords inserted: 15513389\nResource files: 2227\nMemory usage: 1044944640 bytes\n```\n\n### Clear console\n```\nclear\n```\n\nexample:\n```\n\u003e clear\n```\n\n## CLI arguments\nTurn debug mode\n```\n--debug \u003cbool\u003e\n-d\n```\n\nSet max size of memory (in bytes)\n```\n--memory-limit \u003cint\u003e\n-m\n```\n\nPre-process every word before insert\n```\n--normalize \u003cbool\u003e\n-n\n```\n\nPattern for removing unwanted characters, used for each word before insert\n```\n--pattern \u003cregex\u003e\n-p\n```\n\nLoad data from specific path at start\n```\n--source \u003cstring\u003e\n-s\n```\n\nSet extension for loading data at start\n```\n--extension \u003cstring\u003e\n-e\n```\n\n\nLicense\n-----\ncoresearch is licensed under the MIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilotpirxie%2Fcoresearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpilotpirxie%2Fcoresearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilotpirxie%2Fcoresearch/lists"}