{"id":15036311,"url":"https://github.com/sgrottel/everythingsearchclient","last_synced_at":"2025-09-04T05:08:40.860Z","repository":{"id":64117899,"uuid":"571092816","full_name":"sgrottel/EverythingSearchClient","owner":"sgrottel","description":"🔎 A .NET client library for Voidtools' Everything search engine, without the native Everything SDK dll.","archived":false,"fork":false,"pushed_at":"2025-08-27T04:28:54.000Z","size":197,"stargazers_count":45,"open_issues_count":6,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-27T12:37:40.207Z","etag":null,"topics":["csharp","csharp-library","dotnet","everything","everything-search","search","voidtools"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sgrottel.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,"zenodo":null}},"created_at":"2022-11-27T05:59:06.000Z","updated_at":"2025-08-27T04:28:50.000Z","dependencies_parsed_at":"2023-11-12T16:11:48.732Z","dependency_job_id":"0c059869-37ac-468e-8ef9-32a96e892b30","html_url":"https://github.com/sgrottel/EverythingSearchClient","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/sgrottel/EverythingSearchClient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgrottel%2FEverythingSearchClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgrottel%2FEverythingSearchClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgrottel%2FEverythingSearchClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgrottel%2FEverythingSearchClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgrottel","download_url":"https://codeload.github.com/sgrottel/EverythingSearchClient/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgrottel%2FEverythingSearchClient/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273555460,"owners_count":25126316,"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-04T02:00:08.968Z","response_time":61,"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":["csharp","csharp-library","dotnet","everything","everything-search","search","voidtools"],"created_at":"2024-09-24T20:30:46.086Z","updated_at":"2025-09-04T05:08:40.831Z","avatar_url":"https://github.com/sgrottel.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔎 EverythingSearchClient\nA .NET client library for [Voidtools' Everything](https://www.voidtools.com/) search engine, without the native Everything SDK dll.\n\n[![Build \u0026 Test](https://github.com/sgrottel/EverythingSearchClient/actions/workflows/dotnet-desktop.yml/badge.svg)](https://github.com/sgrottel/EverythingSearchClient/actions/workflows/dotnet-desktop.yml)\n[![Nuget](https://img.shields.io/nuget/v/EverythingSearchClient)](https://www.nuget.org/packages/EverythingSearchClient)\n[![GitHub](https://img.shields.io/github/license/sgrottel/EverythingSearchClient)](./LICENSE)\n\nI wrote this library, because I wanted a managed .NET solution with a simple interface, which would not depend on the [native code SDK by Voidtools](https://www.voidtools.com/support/everything/sdk/).\nI wanted to have _**one AnyCpu Dll**_ to do the job.\n\nSo, this library uses a message-only window and the [IPC mechanism](https://www.voidtools.com/support/everything/sdk/ipc/) to communicate between your application and the Everything service.\nThis way, the dependencies and P/Invoke class are limited to functions of the Windows OS and the official .NET runtime.\n\nEverything service must be running on your machine.\n\n## Usage\nThe primary interface is:\n```csharp\nSearchClient everything = new();\n\nResult res = everything.Search(\".txt\");\n// search all files/folders with '.txt' in their name (not just as extension)\n\nConsole.WriteLine(\"Found {0} items:\", res.NumItems);\nforeach (Result.Item item in res.Items)\n{\n\tConsole.WriteLine(item.Name);\n}\n```\n\nThere are multiple additional, optional parameters and overload variants of that function.\nThe full signature reads:\n```csharp\nResult Search(\n\tstring query,\n\tSearchFlags flags = SearchFlags.None,\n\tuint maxResults = AllItems,\n\tuint offset = 0,\n\tBehaviorWhenBusy whenBusy = BehaviorWhenBusy.WaitOrError,\n\tuint timeoutMs = 0)\n```\n\nThe program [`ExampleApp/Program.cs`](./ExampleApp/Program.cs) offers a simple *playground*, to try out the function.\n\nThis interface does not provide the full feature set of Everything on purpose.\nThe idea is to focus on the most importantly functionality only.\nMore features might be added to the interface in the future, when needed.\n\n### Results\nThe `Result` type provides information about the number of found items, and the array containing the items:\n```csharp\nclass Result\n{\n\t[Flags]\tenum ItemFlags\n\t{\n\t\tNone, // aka normal file\n\t\tFolder,\n\t\tDrive,\n\t\tUnknown // Something strange was reported by Everything\n\t}\n\n\tclass Item\n\t{\n\t\tItemFlags Flags;\n\t\tstring Name;\n\t\tstring Path;\n\t}\n\n\tUInt32 TotalItems;\n\tUInt32 NumItems;\n\tUInt32 Offset;\n\tItem[] Items;\n}\n```\n\n### Search Flags\nSearch flags allow to enable some optional features:\n```csharp\n[Flags] enum SearchFlags\n{\n\tNone,\n\tMatchCase,\n\tMatchWholeWord, // match whole word\n\tMatchPath, // include paths in search\n\tRegEx // enable regex\n}\n```\n\nFor example, you can use a more precise RegEx to find all `.git` directories (and files):\n```csharp\nResult res = everything.Search(\"^\\\\.git$\", SearchClient.SearchFlags.RegEx);\n```\nConsult the [Everything documenntation](https://www.voidtools.com/support/everything/sdk/) for more info.\n\n\n### Limit Results\nKeep in mind, that your whole result set is first collected in memory by Everything, and then copied into this library.\nThis is by design of the Everything IPC API.\n\nSo, if you expect a very large number of results, it might be a good idea to limit the number of files in each result set.\nUse `maxResults` and `offset` for that.\nFor example:\n```csharp\nResult res = search.Search(\"draft\", SearchClient.SearchFlags.MatchWholeWord, 100, 0);\nConsole.WriteLine(\"Found {0} items:\", res.TotalItems);\nConsole.WriteLine(\"Items {0}-{1}:\", res.Offset, res.Offset + res.NumItems - 1);\nforeach (Result.Item item in res.Items)\n{\n\tConsole.WriteLine(\"{0}\", item.Name);\n}\n```\nThis example fetches the first 100 result entries of the search for items with the word 'draft' in their name.\n\n`res.TotalItems` will be the total number of entries which were found and which could have been returned.\n\n`res.NumItems` on the other hand will have a maximum value of 100 here.\n\nIf you want to receive the more results, just repeat the search with adjusted `offset`:\n```csharp\n// ...\nres = search.Search(\"draft\", SearchClient.SearchFlags.MatchWholeWord, 100, 100);\n/// ...\nres = search.Search(\"draft\", SearchClient.SearchFlags.MatchWholeWord, 100, 200);\n/// ...\n```\nYou will likely want to do that within a loop.\n\n### Wait for Everything to be Ready\nOne particularity of the Everything service is that it can only work on one search query at any time.\nIf one query is running, and a new query is submitted, the first query will be aborted.\n\nThis client library uses `BehaviorWhenBusy` to handle such cases.\nWhen the Everything service is busy working on one query, you can automatically wait until it's ready, to not interfere with queries from other applications.\n\n**A word of warning:** this mechanism is not 100% secure.\nThere is still a chance of race conditions.\nBut, since Everything is usually only used on the local machine, only by processes the current user triggered, the risk should be small.\n\n```csharp\nenum BehaviorWhenBusy\n{\n\tWaitOrError,\n\tWaitOrContinue,\n\tError,\n\tContinue\n}\n```\n\nYou can specify a `timeoutMs` in milliseconds.\nWhen you use `WaitOrError` or `WaitOrContinue` the `Search` function will wait for at most `timeoutMs` milliseconds for the Everything service to become ready, and will the either throw an error `Exception` or will continue and submit it's search query.\nA `timeoutMs = 0` means that the function will wait indefinitely (not recommended).\n\n## Everything Service Information\nThis library requires Everything to be running on your machine.\nYou can use these static functions to query some status information about the Everything process:\n```csharp\nclass SearchClient\n{\n\t// ...\n\tstatic bool IsEverythingAvailable();\n\n\tstatic Version GetEverythingVersion();\n\n\tstatic bool IsEverythingBusy();\n\t// ... \n}\n```\nYour application should first check if Everything is generally `Available`, and should check if it's `Busy` before trying to submit a search query (to avoid unexpected wait times).\n\nIn addition, you can use:\n```csharp\nclass ServiceControl\n{\n\t// ...\n\tstatic bool IsServiceInstalled()\n\n\tstatic bool IsServiceRunning()\n\t// ...\n}\n```\nto check if the system service of Everything is installed and available.\n\n## How to Build\nThere are several projects in this repository.\nAll use Visual Studio solutions.\nI recommend Visual Studio 2022 Community Edition or newer.\n\n* [EverythingSearchClient.sln](EverythingSearchClient.sln) -- Main solution\n  * EverythingSearchClient/[EverythingSearchClient.csproj](EverythingSearchClient/EverythingSearchClient.csproj) -- Main library project;\n    This project also builds the nuget package of the library.\n  * ExampleApp/[ExampleApp.csproj](ExampleApp/ExampleApp.csproj) -- Console application showing a simple way of how to use this library\n  * TestProject/[TestProject.csproj](TestProject/TestProject.csproj) -- The MSTest project to run automated tests of the EverythingSearchClient library\n* TestNugetConsoleApp/[TestNugetConsoleApp.sln](TestNugetConsoleApp/TestNugetConsoleApp.sln) -- Secondary solution to run a simple smoke test console application testing the generated nuget package.\n  See it's dedicated [TestNugetConsoleApp/README.md](TestNugetConsoleApp/README.md) for more details.\n\nThe main library project does not have build dependencies other than the DotNet SDK.\n\nThe test application have additional dependencies on the test runtime environment, which need to be restored using Nuget.\nThis should run automatically during the build process, unless you deactivated this feature.\n\n## Used By\nIf you want to get your application into this list, I am happy to accept pull requests extending this README.md, or send me the info via e-mail.\n\n* [Checkouts Overview (https://github.com/sgrottel/checkouts-overview)](https://github.com/sgrottel/checkouts-overview)\n  \u003e Overview dashboard app for source code repository checkouts.\n* [FolderSummary in Tiny Tools Collection (https://github.com/sgrottel/tiny-tools-collection)](https://github.com/sgrottel/tiny-tools-collection)\n  \u003e Simple C# app to summarize the content of a folder (recursively) into a Json file.\n* 🚧 TODO: List my apps using the lib in alphabetic order\n\n## Alternatives\n### Everything SDK\nhttps://www.voidtools.com/support/everything/sdk/\n\nThe [official Everything SDK](https://www.voidtools.com/support/everything/sdk/) is written in native C.\nThere are several code examples included in the provided archive, including C# examples based on using the native Everything SDK dlls via P/Invoke.\n\n### EverythingNET\nhttps://github.com/ju2pom/EverythingNet\n\n\u003e EverythingNet is a C# library that wraps the great library from voidtools named Everything. \n\nThis managed library wraps around Everything's native C SDK dll.\n\n### Everything (.NET Client)\nhttps://github.com/pardahlman/everything\n\n\u003e .NET Core library for searching through Voidtool's Everything\n\nThis managed library wraps around the x64 bit version of Everything's native C SDK dll.\n\n## How to Contribute\nContributions of any kind are welcome to this project!\n\nFeel free to fork the repository, make your change, and then create a pull request.\nThere is no official style guide.\nJust try to stick to what you see.\n\nIf you are unsure, feel free to create issue tickets with your questions.\nPlease note, the issue tickets are meant to evolve and fix the library, not as a general communication channel.\nIf you want to ask me something, feel free to reach out to me via e-mail.\n\n## License\nThis project is freely available under the terms of the [Apache License v.2.0](./LICENSE):\n\n\u003e Copyright 2022-2024 SGrottel\n\u003e\n\u003e Licensed under the Apache License, Version 2.0 (the \"License\");\n\u003e you may not use this file except in compliance with the License.\n\u003e You may obtain a copy of the License at\n\u003e\n\u003e http://www.apache.org/licenses/LICENSE-2.0\n\u003e\n\u003e Unless required by applicable law or agreed to in writing, software\n\u003e distributed under the License is distributed on an \"AS IS\" BASIS,\n\u003e WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\u003e See the License for the specific language governing permissions and\n\u003e limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgrottel%2Feverythingsearchclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgrottel%2Feverythingsearchclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgrottel%2Feverythingsearchclient/lists"}