XAF module for global full-text search across all business objects.
$ dotnet add package Xeku.FullTextSearchA global full-text search module for DevExpress XAF applications. Search across all business objects from a single entry point.
[GlobalSearchable] to enable types for searchdotnet add package Xeku.FullTextSearch
// In your Module.cs
RequiredModuleTypes.Add(typeof(Xeku.FullTextSearch.FullTextSearchModule));
Then, add the platform-specific module to your Blazor or WinForms project:
Add Xeku.FullTextSearch.Blazor to your Blazor module or application:
// In your BlazorModule.cs
RequiredModuleTypes.Add(typeof(Xeku.FullTextSearch.Blazor.FullTextSearchBlazorModule));
Add Xeku.FullTextSearch.Win to your WinForms module or application:
// In your WinModule.cs
RequiredModuleTypes.Add(typeof(Xeku.FullTextSearch.Win.FullTextSearchWinModule));
GlobalSearchBlazorGlobalSearchWinImportant: Types are NOT searchable by default. You must explicitly mark types with
[GlobalSearchable]to include them in search.
using Xeku.FullTextSearch.Attributes;
// Enable this type for global search
[GlobalSearchable]
public class Customer : BaseObject
{
public string Name { get; set; }
public string Email { get; set; }
}
Use [GlobalSearchableProperty(false)] to exclude specific properties from search:
[GlobalSearchable]
public class Customer : BaseObject
{
public string Name { get; set; }
[GlobalSearchableProperty(false)]
public string InternalNotes { get; set; } // Won't be searched
}
Modify GlobalSearchService properties:
var searchService = new GlobalSearchService(objectSpace, typesInfo)
{
MaxResultsPerType = 50, // Max results per object type
MaxTotalResults = 200 // Total max results
};
| Project | Description |
|---|---|
Xeku.FullTextSearch | Core logic, Service, and Base Controller |
Xeku.FullTextSearch.Blazor | Blazor platform integration and QuickAccess Action |
Xeku.FullTextSearch.Win | WinForms platform integration and Tools Action |
| File | Description |
|---|---|
FullTextSearchModule.cs | Core XAF module definition |
GlobalSearchResult.cs | Non-persistent result object |
GlobalSearchService.cs | Core search logic with optional caching |
GlobalSearchController.cs | Base abstract controller |
GlobalSearchResultNavigationController.cs | Result navigation |
Integrate with Xeku.Cache for improved search performance:
// With caching
var searchService = new GlobalSearchService(objectSpace, typesInfo, cacheService)
{
SearchResultsCacheDuration = TimeSpan.FromMinutes(5),
SearchableTypesCacheDuration = TimeSpan.FromMinutes(10)
};
// Async search for better cache performance
var results = await searchService.SearchAsync("keyword");
| Cache Key | TTL | Description |
|---|---|---|
fts:searchable-types | 10 min | List of searchable type names |
fts:search:{keyword} | 5 min | Search results for keyword |