{"id":23050830,"url":"https://github.com/geta/epi.find.extensions","last_synced_at":"2025-04-03T03:43:01.649Z","repository":{"id":24668754,"uuid":"28079201","full_name":"Geta/EPi.Find.Extensions","owner":"Geta","description":"Extension methods for EPiServer Find.","archived":false,"fork":false,"pushed_at":"2022-12-07T20:29:47.000Z","size":46262,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-02-08T17:44:46.760Z","etag":null,"topics":["search"],"latest_commit_sha":null,"homepage":null,"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/Geta.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-16T09:11:49.000Z","updated_at":"2021-02-21T09:36:04.000Z","dependencies_parsed_at":"2023-01-14T07:00:19.458Z","dependency_job_id":null,"html_url":"https://github.com/Geta/EPi.Find.Extensions","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geta%2FEPi.Find.Extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geta%2FEPi.Find.Extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geta%2FEPi.Find.Extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geta%2FEPi.Find.Extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Geta","download_url":"https://codeload.github.com/Geta/EPi.Find.Extensions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246933354,"owners_count":20857052,"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":["search"],"created_at":"2024-12-15T23:38:44.655Z","updated_at":"2025-04-03T03:43:01.609Z","avatar_url":"https://github.com/Geta.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Geta.EPi.Find.Extensions\n\n* Master\u003cbr\u003e\n![](http://tc.geta.no/app/rest/builds/buildType:(id:GetaPackages_EPiFindExtensions_00ci),branch:master/statusIcon)\n* Develop\u003cbr\u003e\n![](http://tc.geta.no/app/rest/builds/buildType:(id:GetaPackages_EPiFindExtensions_00ci),branch:develop/statusIcon)\n[![Platform](https://img.shields.io/badge/Platform-.NET%204.6.1-blue.svg?style=flat)](https://msdn.microsoft.com/en-us/library/w0x726c2%28v=vs.110%29.aspx)\n[![Platform](https://img.shields.io/badge/Episerver-%2011-orange.svg?style=flat)](http://world.episerver.com/cms/)\n\n## Description\n\nExtension methods for EPiServer Find.\n\n## Features\n\n- Conditional filtering: Adds an easy way to add filters based on a condition.\n- Terms Facet: Retrieve TermsFacet for int properties instead of string properties.\n- Wildcards: Allows you to perform queries with wildcards.\n\n## Examples\n\n### Conditional filtering\n\n```csharp\nint? someId = ....;\nvar searchResult = client.Search\u003cany\u003e()\n                .Filter(x =\u003e x.ExampleProp1.Match(true))\n\t\t\t\t// Only apply filter if someId has a value\n                .Conditional(someId.HasValue, r =\u003e r.Filter(x =\u003e x.ExampleProp2.Match(someId.Value)))\n\t\t\t\t.Filter(x =\u003e x.ExampleProp3);\n```\n\n### TermsFacetFor on int / number properties\n\nUseful if you want to have the termfacet for a given id property (where the id is an int obviously).\n\n```csharp\npublic class Test {\n\tpublic virtual string StringProp { get; set; }\n\tpublic virtual int IntProp { get; set; }\n}\n\nvar searchResult = client.Search\u003cTest\u003e()\n                .Take(0)\n                .TermsFacetFor(x =\u003e x.StringProp)\n\t\t\t\t// TermsFacetFor only exists for string properties\n\t\t\t\t// The actual api works with ints (numbers) as well\n\t\t\t\t.TermsFacetFor(x =\u003e x.IntProp);\n```\n\n### TermsFacetFor result size (take)\n\nBeing able to set result size for termfacet, easily discoverable by IntelliSense.\n\n```csharp\n\nvar resultSize = 1000;\nvar searchResult = client.Search\u003cTest\u003e()\n                .Take(0)\n\t\t\t\t// Easily add resultSize to TermsFacetFor\n                .TermsFacetFor(x =\u003e x.IntProp, resultSize)\n\n\t\t\t\t// Resharper/IntelliSense does not like this notation too much\n\t\t\t\t// And you obviously want to use it on int properties as well right!?\n\t\t\t\t.TermsFacetFor(x =\u003e x.StringProp, r =\u003e r.Size = resultSize);\n```\n\n### Wildcards\n\n```csharp\nreturn typeSearch.For(query, stringQuery =\u003e\n            {\n                stringQuery.Query = AddWildcards(stringQuery.Query.ToString());\n                stringQuery.AllowLeadingWildcard = allowLeadingWildcard;\n                stringQuery.AnalyzeWildcard = analyzeWildCard;\n                stringQuery.FuzzyMinSim = fuzzyMinSim;\n            });\n```\n\n### Wildcards with best bets applied\n\n```csharp\nvar searchResult = SearchClient.Instance.Search\u003cArticlePage\u003e()\n                .ForWithWildcards(searchQuery, (x =\u003e x.Title, 1.5), (x =\u003e x.Name, 0.5))\n                .GetContentResultSafe();\n\n```\n\n### Handle Client and Service exceptions\n\nMakes it easy to return an empty results instead of an error, useful in case find is unstable/down. See [this](https://world.episerver.com/blogs/Jonas-Bergqvist/Dates/2016/12/exceptions-in-find/) and [this](https://www.brianweet.com/2017/03/17/handling-find-serviceexception.html)\n\n```csharp\n// Throws exception\n var contentResult = search\n        .GetContentResult(cacheForSeconds, cacheForEditorsAndAdmins);\n// Returns empty result in case of ClientException or ServiceException\n var contentResult = search\n        .GetContentResultSafe(cacheForSeconds, cacheForEditorsAndAdmins);\n\n```\n\n## Local development setup\n\nSee description in [shared repository](https://github.com/Geta/package-shared/blob/master/README.md#local-development-set-up) regarding how to setup local development environment.\n\n### Docker hostnames\n\nInstead of using the static IP addresses the following hostnames can be used out-of-the-box.\n\n- http://find-extensions.getalocaltest.me\n\n## Package Maintainer\n\nhttps://github.com/DigIntSys\n\n## Changelog\n\n[Changelog](CHANGELOG.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeta%2Fepi.find.extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeta%2Fepi.find.extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeta%2Fepi.find.extensions/lists"}