diff --git a/LICENSING.md b/LICENSING.md index b2e5705..6f7fb32 100644 --- a/LICENSING.md +++ b/LICENSING.md @@ -99,3 +99,5 @@ The home page adapts the layout and descriptive text of the earlier Redot Docusaurus documentation site. Its reused descriptive content and the imported Getting Started guides and media retain CC BY 3.0 unless otherwise noted. The new Razor implementation is MIT. The imported media retains its original notices. + +Search uses Lucene.NET and Lucene.NET.Analysis.Common (Apache-2.0), J2N (see its bundled notices), and Html Agility Pack (MIT). Their license texts and notices are included under `Redot-Documentation/wwwroot/licenses/` and linked from the site license page. diff --git a/README.md b/README.md index 0700edb..eb52212 100644 --- a/README.md +++ b/README.md @@ -88,3 +88,11 @@ content references valid when changing versions or moving documentation. MudBlazor providers live in `MainLayout`; nested navigation and viewer components inherit the root render mode. Rendered Markdown stays HTML, with CSS styling and small JavaScript helpers for code tabs and syntax highlighting. + +### Documentation search + +Search runs inside ASP.NET using Lucene.NET and BM25, without a crawler or external service. The header search button (Ctrl/Cmd+K) searches the selected version; `/search?q=collision&version=26.2&kind=all` is a shareable results page. Filters accept `all`, `guides`, or `classes`. + +The background service indexes rendered Markdown sections and class-reference snapshots. Local indexes live under `App_Data/search//`; keep this writable directory on persistent storage to reuse indexes after restart. Fingerprints include source bytes, class revision, and a schema version. Class snapshot publication triggers a refresh; Markdown changes are picked up at application restart. Increment the search schema version when changing extraction or analysis. Index failures are logged and retain the previous searchable generation; first-time indexing displays a preparing state. Obsolete fingerprint directories are removed after the replacement reader and manifest are published. Cleanup failures are logged and retried after the next publication; temporary and unrelated directories are left untouched. Search logs section count, build duration, and disk size. + +Results use literal term queries, prefix matching, and a one-edit typo fallback when no stronger matches exist. Queries are limited to 200 characters and 12 terms; results are grouped by source page. Search snippets retain the source content's existing license. diff --git a/Redot-Documentation-Tests/ClassDocumentationComponentTests.cs b/Redot-Documentation-Tests/ClassDocumentationComponentTests.cs index 7e04415..0098f66 100644 --- a/Redot-Documentation-Tests/ClassDocumentationComponentTests.cs +++ b/Redot-Documentation-Tests/ClassDocumentationComponentTests.cs @@ -1,4 +1,6 @@ using System.Text.Json; +using Redot_Documentation.Search; +using Microsoft.AspNetCore.Components.Web; using MudBlazor.Services; using MudBlazor.Extensions; using Microsoft.AspNetCore.Components; @@ -22,6 +24,73 @@ public sealed class ClassDocumentationComponentTests : IDisposable { private readonly string _root = Path.Combine(Path.GetTempPath(), $"redot-component-tests-{Guid.NewGuid():N}"); + [Fact] + public async Task Search_KeepsResultsAndHighlighting_AndRejectsOutOfOrderResponses() + { + var search = new ControlledSearch(); + await using var services = CreateServices(search); + await using var renderer = new TestRenderer(services); + int id = await renderer.Dispatcher.InvokeAsync(() => renderer.RenderAsync(typeof(SearchPanel), + ParameterView.FromDictionary(new Dictionary { ["Query"] = "alpha" }))); + var input = await renderer.Dispatcher.InvokeAsync(() => renderer.FindComponent>(id)); + Assert.NotNull(input); + Task oldRequest = renderer.Dispatcher.InvokeAsync(() => input.ValueChanged.InvokeAsync("slow")); + try + { + await search.Started.Task.WaitAsync(TimeSpan.FromSeconds(5)); + string pendingText = await renderer.Dispatcher.InvokeAsync(() => renderer.Text(id)); + Assert.Contains("alpha result", pendingText); + Assert.Contains("alpha", pendingText); + string before = services.GetRequiredService().Uri; + await renderer.Dispatcher.InvokeAsync(() => input.OnKeyDown.InvokeAsync(new KeyboardEventArgs { Key = "Enter" })); + Assert.Equal(before, services.GetRequiredService().Uri); + await renderer.Dispatcher.InvokeAsync(() => input.ValueChanged.InvokeAsync("beta")); + Assert.Contains("beta result", await renderer.Dispatcher.InvokeAsync(() => renderer.Text(id))); + } + finally { search.Release.Set(); } + await oldRequest; + string finalText = await renderer.Dispatcher.InvokeAsync(() => renderer.Text(id)); + Assert.Contains("beta result", finalText); + Assert.DoesNotContain("slow result", finalText); + Assert.Contains("beta", finalText); + await renderer.Dispatcher.InvokeAsync(() => input.ValueChanged.InvokeAsync("")); + Assert.DoesNotContain("beta result", await renderer.Dispatcher.InvokeAsync(() => renderer.Text(id))); + Assert.Empty(renderer.Errors); + } + + [Fact] + public async Task Search_UrlParameterEchoDoesNotRepeatCompletedQuery() + { + var search = new ControlledSearch(); + await using var services = CreateServices(search); + await using var renderer = new TestRenderer(services); + ParameterView Parameters(string query) => ParameterView.FromDictionary(new Dictionary + { ["Query"] = query, ["Version"] = "26.1", ["Kind"] = "all", ["FullPage"] = true }); + int id = await renderer.Dispatcher.InvokeAsync(() => renderer.RenderAsync(typeof(SearchPanel), Parameters("alpha"))); + await renderer.Dispatcher.InvokeAsync(async () => + { + var input = renderer.FindComponent>(id)!; + await input.ValueChanged.InvokeAsync("beta"); + await renderer.UpdateAsync(id, Parameters("beta")); + }); + Assert.Equal(2, search.Calls); + Assert.Contains("beta result", await renderer.Dispatcher.InvokeAsync(() => renderer.Text(id))); + Assert.Empty(renderer.Errors); + } + + private sealed class ControlledSearch : IDocumentationSearch + { + public int Calls; + public TaskCompletionSource Started { get; } = new(TaskCreationOptions.RunContinuationsAsynchronously); + public ManualResetEventSlim Release { get; } = new(false); + public SearchResponse Search(string version, string query, string kind = "all", int limit = 30) + { + Interlocked.Increment(ref Calls); + if (query == "slow") { Started.TrySetResult(); Release.Wait(TimeSpan.FromSeconds(10)); } + return new(true, [new(query + " result", query, "/en/26.1/" + query, "guides", "alpha beta slow")]); + } + } + [Fact] public async Task NavMenu_SelectsConfiguredVersionThroughMudSelect() { @@ -181,7 +250,7 @@ ClassDocumentationSnapshot Snapshot(DocumentationVersion version, string descrip Assert.Empty(renderer.Errors); } - private ServiceProvider CreateServices() + private ServiceProvider CreateServices(IDocumentationSearch? search = null) { DocumentationVersion[] versions = [ @@ -194,6 +263,7 @@ private ServiceProvider CreateServices() var manager = new VersionManagerService(new TestEnvironment(_root)); manager.LoadContent(); return new ServiceCollection().AddLogging() + .AddSingleton(search ?? new ControlledSearch()) .AddMudServices(options => options.PopoverOptions.CheckForPopoverProvider = false) .AddSingleton(new DocRendererService(new TestEnvironment(_root))) .AddSingleton(manager) @@ -220,6 +290,8 @@ public async Task RenderAsync(Type type, ParameterView parameters) return id; } + public Task UpdateAsync(int id, ParameterView parameters) => RenderRootComponentAsync(id, parameters); + public void Remove(int id) => RemoveRootComponent(id); public IEnumerable Hrefs(int id) @@ -270,6 +342,7 @@ protected override Task UpdateDisplayAsync(in RenderBatch batch) private sealed class TestNavigationManager : NavigationManager { public TestNavigationManager() => Initialize("http://localhost/", "http://localhost/en/26.1/Classes"); + protected override void NavigateToCore(string uri, NavigationOptions options) => NavigateToCore(uri, options.ForceLoad); protected override void NavigateToCore(string uri, bool forceLoad) { Uri = ToAbsoluteUri(uri).AbsoluteUri; diff --git a/Redot-Documentation-Tests/DocumentationSearchTests.cs b/Redot-Documentation-Tests/DocumentationSearchTests.cs new file mode 100644 index 0000000..1764f09 --- /dev/null +++ b/Redot-Documentation-Tests/DocumentationSearchTests.cs @@ -0,0 +1,136 @@ +using System.Text.Json; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.FileProviders; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Logging; +using Redot_Documentation.Search; +using Redot_Documentation.Services; +using Redot_Documentation.Versioning; +using Redot_Documentation.ClassDocumentation; + +namespace Redot_Documentation_Tests; + +public sealed class DocumentationSearchTests +{ + [Theory] + [InlineData(2)] + [InlineData(3)] + [InlineData(4)] + public void CollectDistinctPages_SearchesBeyondFirstThousandSections(int requestedPages) + { + using var directory = new Lucene.Net.Store.RAMDirectory(); + using var analyzer = new Lucene.Net.Analysis.Core.WhitespaceAnalyzer(Lucene.Net.Util.LuceneVersion.LUCENE_48); + using (var writer = new Lucene.Net.Index.IndexWriter(directory, + new Lucene.Net.Index.IndexWriterConfig(Lucene.Net.Util.LuceneVersion.LUCENE_48, analyzer))) + { + for (int i = 0; i < 1100; i++) + DocumentationSearchService.Add(writer, new("Dense", "Section", $"/dense#{i}", "/dense", "guides", "needle")); + DocumentationSearchService.Add(writer, new("Second", "Section", "/second", "/second", "guides", "needle")); + DocumentationSearchService.Add(writer, new("Third", "Section", "/third", "/third", "guides", "needle")); + writer.Commit(); + } + using var reader = Lucene.Net.Index.DirectoryReader.Open(directory); + var searcher = new Lucene.Net.Search.IndexSearcher(reader); + var query = new Lucene.Net.Search.TermQuery(new Lucene.Net.Index.Term("bodyTerms", "needle")); + var hits = DocumentationSearchService.CollectDistinctPages(searcher, query, requestedPages); + Assert.Equal(new[] { "/dense", "/second", "/third" }.Take(requestedPages), hits.Select(d => d.Get("page"))); + Assert.Equal("/dense#0", hits[0].Get("url")); + } + + [Fact] + public async Task Index_SearchesBodyAndMembers_IsolatesVersions_AndRefreshesSnapshots() + { + string root = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")); + try + { + foreach (string version in new[] { "stable", "latest" }) + { + Directory.CreateDirectory(Path.Combine(root, "docs", version)); + await File.WriteAllTextAsync(Path.Combine(root, "docs", version, "player.md"), + "# Coding the player\n\n## Physics\n\n" + (version == "stable" ? "Detect collisions with walls." : "Future physics changes.")); + } + await File.WriteAllTextAsync(Path.Combine(root, "docs", "Versions.json"), JsonSerializer.Serialize(new[] { + new DocumentationVersion { Slug="stable",FriendlyName="Stable",BranchName="stable",IsLatestStable=true }, + new DocumentationVersion { Slug="latest",FriendlyName="Latest",BranchName="master",IsNextPrerelease=true } + })); + var env = new TestEnvironment(root); + var versions = new VersionManagerService(env); versions.LoadContent(); + var catalog = new ClassDocumentationCatalog(); + var logger = new TestLogger(); + using var service = new DocumentationSearchService(versions, catalog, env, logger); + await service.StartAsync(default); + await Wait(() => service.Search("latest", "physics").Available); + string cache = Path.Combine(root, "App_Data", "search", "stable"); + string manifest = Path.Combine(cache, "current.txt"); + await Wait(() => File.Exists(manifest)); + string initialIndex = Path.Combine(cache, File.ReadAllText(manifest)); + string temporary = Path.Combine(cache, new string('A', 64) + ".building-test"); + string unrelated = Path.Combine(cache, "notes"); + Directory.CreateDirectory(temporary); + Directory.CreateDirectory(unrelated); + var hits = service.Search("stable", "detect collisions").Hits; + Assert.Single(hits); + Assert.EndsWith("player#physics", hits[0].Url); + Assert.Contains("collisions", hits[0].Snippet); + Assert.Empty(service.Search("latest", "collisions").Hits); + Assert.Empty(service.Search("stable", "collisions", "classes").Hits); + Assert.Single(service.Search("stable", "colisions").Hits); + catalog.Publish(new(versions.LatestStableVersion, "revision1", DateTimeOffset.UtcNow, + new Dictionary { ["CharacterBody3D"] = new() { Name = "CharacterBody3D", Description = "Sliding collision motion", Methods = [new() { Name = "move_and_slide", Description = "Move while sliding along walls." }] } })); + await Wait(() => service.Search("stable", "character body", "classes").Hits.Count == 1); + await Wait(() => !Directory.Exists(initialIndex)); + string firstClassIndex = Path.Combine(cache, File.ReadAllText(manifest)); + Assert.True(Directory.Exists(firstClassIndex)); + Assert.EndsWith("#method-move-and-slide", service.Search("stable", "move_and_slide", "classes").Hits[0].Url); + catalog.Publish(new(versions.LatestStableVersion, "revision2", DateTimeOffset.UtcNow, + new Dictionary { ["NewClass"] = new() { Name = "NewClass", Description = "Replacement snapshot" } })); + await Wait(() => service.Search("stable", "replacement", "classes").Hits.Count == 1); + await Wait(() => !Directory.Exists(firstClassIndex)); + string activeIndex = Path.Combine(cache, File.ReadAllText(manifest)); + Assert.True(Directory.Exists(activeIndex)); + Assert.Single(Directory.GetDirectories(cache), p => Path.GetFileName(p).Length == 64); + Assert.True(Directory.Exists(temporary)); + Assert.True(Directory.Exists(unrelated)); + Assert.Single(service.Search("latest", "physics").Hits); + Assert.Empty(service.Search("stable", "character body", "classes").Hits); + env.ContentRootPath = Path.Combine(root, "missing-root"); + catalog.Publish(new(versions.LatestStableVersion, "revision3", DateTimeOffset.UtcNow, + new Dictionary())); + await Wait(() => logger.Errors > 0); + Assert.True(Directory.Exists(activeIndex)); + Assert.Equal(activeIndex, Path.Combine(cache, File.ReadAllText(manifest))); + Assert.Single(service.Search("stable", "replacement", "classes").Hits); + env.ContentRootPath = root; + catalog.Publish(new(versions.LatestStableVersion, "revision2", DateTimeOffset.UtcNow, + new Dictionary { ["NewClass"] = new() { Name = "NewClass", Description = "Replacement snapshot" } })); + await service.StopAsync(default); + using var cached = new DocumentationSearchService(versions, catalog, env, NullLogger.Instance); + await cached.StartAsync(default); + await Wait(() => cached.Search("stable", "replacement").Hits.Count == 1); + await cached.StopAsync(default); + } + finally { Directory.Delete(root, true); } + } + private static async Task Wait(Func ready) + { + for (int i = 0; i < 200; i++) { if (ready()) return; await Task.Delay(50); } + Assert.True(ready(), "Search index did not become ready"); + } + private sealed class TestLogger : ILogger + { + public int Errors; + public IDisposable? BeginScope(TState state) where TState : notnull => null; + public bool IsEnabled(LogLevel level) => true; + public void Log(LogLevel level, EventId id, TState state, Exception? exception, Func formatter) + { if (level == LogLevel.Error) Interlocked.Increment(ref Errors); } + } + private sealed class TestEnvironment(string root) : IWebHostEnvironment + { + public string ApplicationName { get; set; } = "Tests"; + public string EnvironmentName { get; set; } = "Development"; + public string ContentRootPath { get; set; } = root; + public string WebRootPath { get; set; } = root; + public IFileProvider ContentRootFileProvider { get; set; } = new NullFileProvider(); + public IFileProvider WebRootFileProvider { get; set; } = new NullFileProvider(); + } +} diff --git a/Redot-Documentation/Components/Layout/HeaderSearch.razor b/Redot-Documentation/Components/Layout/HeaderSearch.razor new file mode 100644 index 0000000..84b9845 --- /dev/null +++ b/Redot-Documentation/Components/Layout/HeaderSearch.razor @@ -0,0 +1,41 @@ +@implements IAsyncDisposable +@inject IDialogService Dialogs +@inject NavigationManager Navigation +@inject Redot_Documentation.Services.VersionManagerService Versions +@inject IJSRuntime JS + + Search documentation…Ctrl / ⌘ K + +@code { + private IJSObjectReference? _module; + private DotNetObjectReference? _reference; + private bool _open; + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (!firstRender) return; + _module = await JS.InvokeAsync("import", "./js/search.js"); + _reference = DotNetObjectReference.Create(this); + await _module.InvokeVoidAsync("register", _reference); + } + [JSInvokable] public async Task Open() + { + if (_open) return; + _open = true; + try + { + string[] parts = Navigation.ToBaseRelativePath(Navigation.Uri).Split('/'); + string version = parts.Length > 1 && string.Equals(parts[0], "en", StringComparison.OrdinalIgnoreCase) && Versions.TryGetVersionProvider(parts[1],out _) ? parts[1] : Versions.LatestStableVersion.Slug; + bool mobile = _module is not null && await _module.InvokeAsync("isMobile"); + var dialog = await Dialogs.ShowAsync("Search",new DialogParameters { ["Version"] = version },new DialogOptions { FullWidth = true, MaxWidth = MaxWidth.Medium, FullScreen = mobile, CloseButton = true, CloseOnEscapeKey = true }); + await dialog.Result; + if (_module is not null) await _module.InvokeVoidAsync("restoreFocus"); + } + finally { _open = false; } + } + public async ValueTask DisposeAsync() + { + try { if (_module is not null) { await _module.InvokeVoidAsync("unregister"); await _module.DisposeAsync(); } } + catch (JSDisconnectedException) { } + _reference?.Dispose(); + } +} diff --git a/Redot-Documentation/Components/Layout/MainLayout.razor b/Redot-Documentation/Components/Layout/MainLayout.razor index 0b6168e..feb8791 100644 --- a/Redot-Documentation/Components/Layout/MainLayout.razor +++ b/Redot-Documentation/Components/Layout/MainLayout.razor @@ -11,6 +11,7 @@ +
@if (HasNavigation) { @@ -18,13 +19,16 @@ Redot Docs - +
+ +
Download +
@if (HasNavigation) { diff --git a/Redot-Documentation/Components/Layout/SearchDialog.razor b/Redot-Documentation/Components/Layout/SearchDialog.razor new file mode 100644 index 0000000..2390cbd --- /dev/null +++ b/Redot-Documentation/Components/Layout/SearchDialog.razor @@ -0,0 +1,9 @@ + + Search documentation + + +@code { + [CascadingParameter] private IMudDialogInstance Dialog { get; set; } = null!; + [Parameter] public string Version { get; set; } = ""; + private void Close() => Dialog.Close(); +} diff --git a/Redot-Documentation/Components/Layout/SearchPanel.razor b/Redot-Documentation/Components/Layout/SearchPanel.razor new file mode 100644 index 0000000..b1bfd0d --- /dev/null +++ b/Redot-Documentation/Components/Layout/SearchPanel.razor @@ -0,0 +1,187 @@ +@using Redot_Documentation.Search +@using Redot_Documentation.Services +@using System.Text.RegularExpressions +@using System.Net +@implements IAsyncDisposable +@inject IJSRuntime JS +@inject IDocumentationSearch SearchService +@inject VersionManagerService Versions +@inject NavigationManager Navigation + +
+ +
+ + @foreach (var version in Versions.Versions) { @version.FriendlyName } + + + All + Guides & tutorials + Class reference + +
+
+ + @if (_displayQuery.Length == 0) { Search explanations, code samples, and API names. } + else if (!_response.Available) { Search is preparing this version. Please try again shortly. } + else { @_response.Hits.Count@(_response.HasMore ? "+" : "") results } + + Searching… + @(_selected >= 0 ? $"{_response.Hits[_selected].Title}: {_response.Hits[_selected].Heading}" : "") +
+
+ @if (_response.Available && _displayQuery.Length > 0 && _response.Hits.Count == 0) + { No matches. Try fewer words or a different version. } + +
+
+ @if (!FullPage && _query.Trim().Length > 0) + { View all results } + @if (FullPage && _response.HasMore && _limit < 100) + { Show more results } +
+
+ +@code { + [Parameter] public string? Query { get; set; } + [Parameter] public string? Version { get; set; } + [Parameter] public string? Kind { get; set; } + [Parameter] public bool FullPage { get; set; } + [Parameter] public EventCallback ResultChosen { get; set; } + private string _query = "", _version = "", _kind = "all"; + private int _selected = -1, _limit = 30; + private bool _busy, _showLoading, _disposed, _scrollSelection; + private long _requestId; + private string _displayQuery = ""; + private (string?, string?, string?)? _parameters; + private ElementReference _panel; + private IJSObjectReference? _module; + private CancellationTokenSource? _pending; + private SearchResponse _response = new(true, []); + private string ResultsUrl => $"/search?q={Uri.EscapeDataString(_query)}&version={Uri.EscapeDataString(_version)}&kind={_kind}"; + protected override async Task OnParametersSetAsync() + { + var incoming = (Query, Version, Kind); + if (_parameters == incoming) return; + _parameters = incoming; + string query = Query ?? ""; + string version = Versions.TryGetVersionProvider(Version ?? "", out _) ? Version! : Versions.LatestStableVersion.Slug; + string kind = Kind is "guides" or "classes" ? Kind : "all"; + if ((_query, _version, _kind) == (query, version, kind)) return; + (_query, _version, _kind) = (query, version, kind); + _limit = 30; + await Run(false); + } + private async Task QueryChanged(string value) { _query = value; _limit = 30; await Run(true); } + private async Task VersionChanged(string value) { _version = value; await Run(false); } + private async Task KindChanged(string value) { _kind = value; await Run(false); } + private async Task More() { _limit += 30; await Run(false); } + private async Task Run(bool debounce) + { + _pending?.Cancel(); + long request = ++_requestId; + var pending = _pending = new CancellationTokenSource(); + string query = _query.Trim(), version = _version, kind = _kind; + int limit = FullPage ? _limit : 10; + _busy = query.Length > 0; + _showLoading = false; + _selected = -1; + _scrollSelection = false; + try + { + if (query.Length == 0) + { + _response = new(true, []); + _displayQuery = ""; + SyncUrl(); + return; + } + _ = ShowLoadingAsync(request, pending.Token); + if (debounce) await Task.Delay(200, pending.Token); + var result = await Task.Run(() => SearchService.Search(version, query, kind, limit), pending.Token); + if (_disposed || request != _requestId || pending.IsCancellationRequested) return; + _response = result; + _displayQuery = query; + SyncUrl(); + } + catch (OperationCanceledException) { } + finally + { + pending.Cancel(); + if (request == _requestId) { _busy = false; _showLoading = false; _pending = null; } + pending.Dispose(); + } + } + private void SyncUrl() + { + if (FullPage && new Uri(Navigation.Uri).PathAndQuery != ResultsUrl) + Navigation.NavigateTo(ResultsUrl, replace: true); + } + private async Task ShowLoadingAsync(long request, CancellationToken token) + { + try + { + await Task.Delay(400, token); + await InvokeAsync(() => + { + if (!_disposed && request == _requestId && _busy) + { _showLoading = true; StateHasChanged(); } + }); + } + catch (OperationCanceledException) { } + } + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) _module = await JS.InvokeAsync("import", "./js/search.js"); + if (_scrollSelection && _module is not null) + { + _scrollSelection = false; + await _module.InvokeVoidAsync("scrollSelected", _panel); + } + } + private async Task HandleKey(KeyboardEventArgs args) + { + if (_busy || _response.Hits.Count == 0) return; + if (args.Key == "ArrowDown") _selected = (_selected + 1) % _response.Hits.Count; + if (args.Key == "ArrowUp") _selected = (_selected + _response.Hits.Count - 1) % _response.Hits.Count; + if (args.Key is "ArrowDown" or "ArrowUp") _scrollSelection = true; + if (args.Key == "Enter") + { + var hit = _response.Hits[Math.Max(0,_selected)]; + await ResultChosen.InvokeAsync(); + Navigation.NavigateTo(hit.Url); + } + } + private MarkupString Highlight(string text) + { + var terms = SearchContent.Terms(_displayQuery).OrderByDescending(t => t.Length).Select(Regex.Escape).ToArray(); + if (terms.Length == 0) return new(WebUtility.HtmlEncode(text)); + var output = new System.Text.StringBuilder(); + int start = 0; + foreach (Match match in Regex.Matches(text,string.Join('|',terms),RegexOptions.IgnoreCase)) + { + output.Append(WebUtility.HtmlEncode(text[start..match.Index])); + output.Append("").Append(WebUtility.HtmlEncode(match.Value)).Append(""); + start = match.Index + match.Length; + } + return new(output.Append(WebUtility.HtmlEncode(text[start..])).ToString()); + } + public async ValueTask DisposeAsync() + { + _disposed = true; + ++_requestId; + _pending?.Cancel(); + try { if (_module is not null) await _module.DisposeAsync(); } + catch (JSDisconnectedException) { } + } +} diff --git a/Redot-Documentation/Components/Pages/DocViewer.razor b/Redot-Documentation/Components/Pages/DocViewer.razor index d354b34..2d63a7e 100644 --- a/Redot-Documentation/Components/Pages/DocViewer.razor +++ b/Redot-Documentation/Components/Pages/DocViewer.razor @@ -41,22 +41,6 @@ else } @code { - private static readonly Regex HeadingRegex = new( - @"[^>]*)>(?.*?)", - RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled); - - private static readonly Regex IdRegex = new( - @"\sid\s*=\s*[\""'](?[^\""']+)[\""']", - RegexOptions.IgnoreCase | RegexOptions.Compiled); - - private static readonly Regex HtmlTagRegex = new( - @"<[^>]+>", - RegexOptions.Compiled); - - private static readonly Regex WhitespaceRegex = new( - @"\s+", - RegexOptions.Compiled); - [Parameter] public string? DocumentPath { get; set; } @@ -80,7 +64,7 @@ else : $"{docPath}.md"; var html = await DocRendererService.RenderToHtmlAsync(path, versionProvider); - renderedHtml = BuildTableOfContentsAndEnsureHeadingIds(html); + renderedHtml = DocumentHeadings.Apply(html, tableOfContents); } catch (Exception ex) { @@ -119,72 +103,6 @@ else return (VersionManagerService.GetVersionProvider(VersionManagerService.LatestStableVersion.Slug), normalizedPath); } - private string BuildTableOfContentsAndEnsureHeadingIds(string html) - { - tableOfContents.Clear(); - - var usedIds = new HashSet(StringComparer.OrdinalIgnoreCase); - - return HeadingRegex.Replace(html, match => - { - var level = int.Parse(match.Groups[1].Value); - var attributes = match.Groups["attributes"].Value; - var content = match.Groups["content"].Value; - var title = DecodeHeadingTitle(content); - - var existingIdMatch = IdRegex.Match(attributes); - if (string.IsNullOrWhiteSpace(title)) - { - if (existingIdMatch.Success) - { - usedIds.Add(existingIdMatch.Groups["id"].Value); - } - return match.Value; - } - var id = existingIdMatch.Success - ? existingIdMatch.Groups["id"].Value - : HeadingAnchor.FromTitle(title); - - id = EnsureUniqueId(id, usedIds); - - if (existingIdMatch.Success && !string.Equals(existingIdMatch.Groups["id"].Value, id, StringComparison.Ordinal)) - { - attributes = IdRegex.Replace(attributes, $" id=\"{id}\"", 1); - } - else if (!existingIdMatch.Success) - { - attributes = $" id=\"{id}\"{attributes}"; - } - - tableOfContents.Add(new DocumentHeading(level, id, title)); - return $"{content}"; - }); - } - - private static string DecodeHeadingTitle(string content) - { - var withoutTags = HtmlTagRegex.Replace(content, string.Empty); - var decoded = System.Net.WebUtility.HtmlDecode(withoutTags); - return WhitespaceRegex.Replace(decoded, " ").Trim(); - } - - private static string EnsureUniqueId(string id, HashSet usedIds) - { - var normalizedId = string.IsNullOrWhiteSpace(id) ? "section" : id; - if (usedIds.Add(normalizedId)) - { - return normalizedId; - } - - var suffix = 2; - while (!usedIds.Add($"{normalizedId}-{suffix}")) - { - suffix++; - } - - return $"{normalizedId}-{suffix}"; - } - private string BuildTableOfContentsHref(string id) { var normalizedPath = (DocumentPath ?? string.Empty).Trim('/'); diff --git a/Redot-Documentation/Components/Pages/Licenses.razor b/Redot-Documentation/Components/Pages/Licenses.razor index 720ac83..236f9ab 100644 --- a/Redot-Documentation/Components/Pages/Licenses.razor +++ b/Redot-Documentation/Components/Pages/Licenses.razor @@ -51,6 +51,8 @@ See the media notice and credits in the relevant pages.

    +
  • Lucene.NET: Apache 2.0 license and notices; J2N: license notices.
  • +
  • Html Agility Pack: MIT license.
  • MudBlazor: MIT license and copyright notice.
  • Bootstrap: Copyright © 2011-2024 The Bootstrap Authors, MIT license.
  • Prism: Copyright © 2012 Lea Verou, MIT license.
  • diff --git a/Redot-Documentation/Components/Pages/Search.razor b/Redot-Documentation/Components/Pages/Search.razor new file mode 100644 index 0000000..80336f9 --- /dev/null +++ b/Redot-Documentation/Components/Pages/Search.razor @@ -0,0 +1,11 @@ +@page "/search" +Search — Redot Docs +
    +

    Search documentation

    + +
    +@code { + [SupplyParameterFromQuery(Name = "q")] public string? Query { get; set; } + [SupplyParameterFromQuery(Name = "version")] public string? Version { get; set; } + [SupplyParameterFromQuery(Name = "kind")] public string? Kind { get; set; } +} diff --git a/Redot-Documentation/Program.cs b/Redot-Documentation/Program.cs index 0f65b50..03fda84 100644 --- a/Redot-Documentation/Program.cs +++ b/Redot-Documentation/Program.cs @@ -19,6 +19,9 @@ public static void Main(string[] args) builder.Services.AddMudServices(); builder.Services.AddScoped(); builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(sp => sp.GetRequiredService()); + builder.Services.AddHostedService(sp => sp.GetRequiredService()); builder.Services.Configure( builder.Configuration.GetSection(ClassDocumentationOptions.SectionName)); builder.Services.AddSingleton(); diff --git a/Redot-Documentation/Redot-Documentation.csproj b/Redot-Documentation/Redot-Documentation.csproj index b3afd25..6c0853c 100644 --- a/Redot-Documentation/Redot-Documentation.csproj +++ b/Redot-Documentation/Redot-Documentation.csproj @@ -11,6 +11,9 @@ + + + diff --git a/Redot-Documentation/Search/DocumentationSearchService.cs b/Redot-Documentation/Search/DocumentationSearchService.cs new file mode 100644 index 0000000..8e6d48a --- /dev/null +++ b/Redot-Documentation/Search/DocumentationSearchService.cs @@ -0,0 +1,235 @@ +using System.Diagnostics; +using System.Security.Cryptography; +using System.Text; +using System.Threading.Channels; +using Lucene.Net.Analysis.Core; +using Lucene.Net.Documents; +using Lucene.Net.Index; +using Lucene.Net.Search; +using Lucene.Net.Search.Similarities; +using Lucene.Net.Store; +using Lucene.Net.Util; +using Redot_Documentation.Services; +using Redot_Documentation.ClassDocumentation; +using Redot_Documentation.Versioning; + +namespace Redot_Documentation.Search; + +public sealed class DocumentationSearchService(VersionManagerService versions, ClassDocumentationCatalog catalog, + IWebHostEnvironment environment, ILogger logger) : BackgroundService, IDocumentationSearch +{ + private readonly object _gate = new(); + private readonly Dictionary _indexes = new(StringComparer.OrdinalIgnoreCase); + private readonly Channel _updates = Channel.CreateUnbounded(); + private sealed record OpenIndex(FSDirectory Directory, DirectoryReader Reader) : IDisposable + { + public void Dispose() { Reader.Dispose(); Directory.Dispose(); } + } + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + catalog.Changed += Queue; + try + { + foreach (var version in versions.Versions) Queue(version.Slug); + await foreach (string slug in _updates.Reader.ReadAllAsync(stoppingToken)) + { + try { await BuildAsync(slug, stoppingToken); } + catch (OperationCanceledException) when (stoppingToken.IsCancellationRequested) { break; } + catch (Exception ex) { logger.LogError(ex, "Search indexing failed for {Version}; retaining previous index", slug); } + } + } + finally { catalog.Changed -= Queue; } + } + private void Queue(string slug) => _updates.Writer.TryWrite(slug); + private async Task BuildAsync(string slug, CancellationToken ct) + { + var timer = Stopwatch.StartNew(); + var provider = versions.GetVersionProvider(slug); + string root = Path.Combine(environment.ContentRootPath, "docs"); + var files = new[] { provider.VersionRoot, Path.Combine(root, "About"), Path.Combine(root, "Community"), Path.Combine(root, "Contributing") } + .Where(System.IO.Directory.Exists).SelectMany(p => System.IO.Directory.EnumerateFiles(p, "*.md", SearchOption.AllDirectories)).Order().ToArray(); + catalog.TryGetSnapshot(slug, out var snapshot); + using var hash = IncrementalHash.CreateHash(HashAlgorithmName.SHA256); + hash.AppendData(Encoding.UTF8.GetBytes("search-schema-2:" + snapshot?.CommitSha)); + foreach (string file in files) + { + hash.AppendData(Encoding.UTF8.GetBytes(Path.GetRelativePath(root, file))); + hash.AppendData(await File.ReadAllBytesAsync(file, ct)); + } + string fingerprint = Convert.ToHexString(hash.GetHashAndReset()); + string cache = Path.Combine(environment.ContentRootPath, "App_Data", "search", slug); + System.IO.Directory.CreateDirectory(cache); + string path = Path.Combine(cache, fingerprint); + string manifest = Path.Combine(cache, "current.txt"); + lock (_gate) + { + if (!_indexes.ContainsKey(slug) && File.Exists(manifest)) + { + string previous = File.ReadAllText(manifest).Trim(); + if (previous.Length == 64 && previous.All(Uri.IsHexDigit)) TryOpen(slug, Path.Combine(cache, previous)); + } + } + bool validCache; + using (var check = FSDirectory.Open(path)) + { + try { using var reader = DirectoryReader.Open(check); validCache = true; } + catch { validCache = false; } + } + if (!validCache) + { + string temp = path + ".building-" + Guid.NewGuid().ToString("N"); + try + { + using (var directory = FSDirectory.Open(temp)) + using (var analyzer = new WhitespaceAnalyzer(LuceneVersion.LUCENE_48)) + using (var writer = new IndexWriter(directory, new IndexWriterConfig(LuceneVersion.LUCENE_48, analyzer) { Similarity = new BM25Similarity() })) + { + var renderer = new DocRendererService(environment); + foreach (string file in files) + { + ct.ThrowIfCancellationRequested(); + string relative = Path.GetRelativePath(root, file).Replace('\\', '/'); + string html = DocumentHeadings.Apply(await renderer.RenderToHtmlAsync(relative, provider, ct), []); + string url = "/en/" + string.Join('/', relative[..^3].Split('/').Select(Uri.EscapeDataString)); + foreach (var entry in SearchContent.Extract(html, url, "guides")) Add(writer, entry); + } + if (snapshot is not null) + { + var classRenderer = new ClassDocumentationRenderer(); + foreach (var entry in snapshot.Classes.Values) + { + ct.ThrowIfCancellationRequested(); + foreach (var section in SearchContent.Extract(classRenderer.RenderPage(entry, snapshot), ClassDocumentationRenderer.ClassPath(slug, entry.Name), "classes")) Add(writer, section); + } + } + writer.Commit(); + } + if (System.IO.Directory.Exists(path)) System.IO.Directory.Delete(path, true); + System.IO.Directory.Move(temp, path); + } + finally { if (System.IO.Directory.Exists(temp)) System.IO.Directory.Delete(temp, true); } + } + lock (_gate) { if (!TryOpen(slug, path)) throw new IOException("Cannot open completed search index"); } + await File.WriteAllTextAsync(manifest + ".tmp", fingerprint, ct); + File.Move(manifest + ".tmp", manifest, true); + CleanupObsoleteIndexes(cache, fingerprint); + logger.LogInformation("Search index {Version}: {Documents} sections, {Milliseconds} ms, {Bytes} bytes", slug, _indexes[slug].Reader.NumDocs, timer.ElapsedMilliseconds, System.IO.Directory.GetFiles(path).Sum(f => new FileInfo(f).Length)); + } + private void CleanupObsoleteIndexes(string cache, string activeFingerprint) + { + // The replacement reader and manifest are ready, and TryOpen disposed the old reader. + // Only generated fingerprint directories belong to this retention policy. + try + { + foreach (string directory in System.IO.Directory.EnumerateDirectories(cache)) + { + string name = Path.GetFileName(directory); + if (name.Length != 64 || !name.All(Uri.IsHexDigit) + || string.Equals(name, activeFingerprint, StringComparison.OrdinalIgnoreCase) + || (File.GetAttributes(directory) & FileAttributes.ReparsePoint) != 0) + continue; + + try { System.IO.Directory.Delete(directory, recursive: true); } + catch (Exception ex) when (ex is IOException or UnauthorizedAccessException) + { + logger.LogWarning(ex, "Could not remove obsolete search index {Directory}; will retry after the next publication", directory); + } + } + } + catch (Exception ex) when (ex is IOException or UnauthorizedAccessException) + { + logger.LogWarning(ex, "Could not clean search cache {Cache}; active search index is unchanged", cache); + } + } + private bool TryOpen(string slug, string path) + { + FSDirectory? dir = null; + try + { + dir = FSDirectory.Open(path); + var next = new OpenIndex(dir, DirectoryReader.Open(dir)); + if (_indexes.Remove(slug, out var old)) old.Dispose(); + _indexes[slug] = next; + return true; + } + catch { dir?.Dispose(); return false; } + } + internal static void Add(IndexWriter writer, SearchDocument entry) + { + var doc = new Document(); + foreach (var (name, value) in new[] { ("title", entry.Title), ("heading", entry.Heading), ("body", entry.Body) }) + { + doc.Add(new StoredField(name, value)); + doc.Add(new TextField(name + "Terms", string.Join(' ', SearchContent.TermsForIndex(value)), Field.Store.NO)); + } + foreach (var (name, value) in new[] { ("url", entry.Url), ("page", entry.Page), ("kind", entry.Kind), ("exact", entry.Heading.ToLowerInvariant()) }) doc.Add(new StringField(name, value, Field.Store.YES)); + if (entry.Kind == "classes") + { + string symbol = entry.Heading.Split('(', '=')[0].Split(' ', StringSplitOptions.RemoveEmptyEntries).LastOrDefault() ?? ""; + doc.Add(new StringField("exact", symbol.ToLowerInvariant(), Field.Store.NO)); + } + writer.AddDocument(doc); + } + public SearchResponse Search(string version, string query, string kind = "all", int limit = 30) + { + if (!versions.TryGetVersionProvider(version, out _)) return new(false, []); + limit = Math.Clamp(limit, 1, 100); + query = query.Length > 200 ? query[..200] : query; + string[] terms = SearchContent.Terms(query); + lock (_gate) + { + if (!_indexes.TryGetValue(version, out var index)) return new(false, []); + if (terms.Length == 0) return new(true, []); + var searcher = new IndexSearcher(index.Reader) { Similarity = new BM25Similarity() }; + var main = new BooleanQuery(); + var content = new BooleanQuery(); + foreach (var term in terms) + { + var matches = new BooleanQuery(); + foreach (var (field, boost) in new[] { ("titleTerms", 4f), ("headingTerms", 6f), ("bodyTerms", 1f) }) + { + matches.Add(new TermQuery(new Term(field, term)) { Boost = boost }, Occur.SHOULD); + if (term.Length >= 3) matches.Add(new PrefixQuery(new Term(field, term)) { Boost = boost * .4f }, Occur.SHOULD); + } + content.Add(matches, Occur.MUST); + } + main.Add(content, Occur.MUST); + main.Add(new TermQuery(new Term("exact", query.Trim().ToLowerInvariant())) { Boost = 15 }, Occur.SHOULD); + if (kind is "guides" or "classes") main.Add(new TermQuery(new Term("kind", kind)), Occur.MUST); + var hits = CollectDistinctPages(searcher, main, limit + 1); + if (hits.Count == 0 && terms.All(t => t.Length >= 4)) + { + var fuzzy = new BooleanQuery(); + foreach (string term in terms) fuzzy.Add(new FuzzyQuery(new Term("bodyTerms", term), 1), Occur.MUST); + if (kind is "guides" or "classes") fuzzy.Add(new TermQuery(new Term("kind", kind)), Occur.MUST); + hits = CollectDistinctPages(searcher, fuzzy, limit + 1); + } + return new(true, hits.Take(limit).Select(d => new SearchHit(d.Get("title"), d.Get("heading"), d.Get("url"), d.Get("kind"), SearchContent.Snippet(d.Get("body"), query))).ToArray(), hits.Count > limit); + } + } + internal static IReadOnlyList CollectDistinctPages(IndexSearcher searcher, Query query, int count) + { + const int batchSize = 128; + var pages = new HashSet(StringComparer.Ordinal); + var hits = new List(); + ScoreDoc? after = null; + while (hits.Count < count) + { + var batch = searcher.SearchAfter(after, query, batchSize); + foreach (var score in batch.ScoreDocs) + { + var document = searcher.Doc(score.Doc); + if (pages.Add(document.Get("page"))) hits.Add(document); + if (hits.Count == count) return hits; + } + if (batch.ScoreDocs.Length < batchSize) break; + after = batch.ScoreDocs[^1]; + } + return hits; + } + public override void Dispose() + { + base.Dispose(); + lock (_gate) { foreach (var index in _indexes.Values) index.Dispose(); _indexes.Clear(); } + } +} diff --git a/Redot-Documentation/Search/SearchDocument.cs b/Redot-Documentation/Search/SearchDocument.cs new file mode 100644 index 0000000..3fe4af2 --- /dev/null +++ b/Redot-Documentation/Search/SearchDocument.cs @@ -0,0 +1,49 @@ +using HtmlAgilityPack; +using System.Text; +using System.Text.RegularExpressions; + +namespace Redot_Documentation.Search; + +public sealed record SearchDocument(string Title, string Heading, string Url, string Page, string Kind, string Body); +public sealed record SearchHit(string Title, string Heading, string Url, string Kind, string Snippet); +public sealed record SearchResponse(bool Available, IReadOnlyList Hits, bool HasMore = false); +public interface IDocumentationSearch +{ + SearchResponse Search(string version, string query, string kind = "all", int limit = 30); +} + +public static class SearchContent +{ + public static IEnumerable Extract(string html, string url, string kind) + { + var doc = new HtmlDocument(); + doc.LoadHtml(html); + foreach (var node in doc.DocumentNode.SelectNodes("//script|//style|//footer|//button")?.ToArray() ?? []) node.Remove(); + string title = Clean(doc.DocumentNode.SelectSingleNode("//h1")?.InnerText ?? url.Split('/').Last()); + string heading = title, target = url; + var body = new StringBuilder(); + foreach (var node in doc.DocumentNode.Descendants()) + { + if (node.Name is "h1" or "h2" or "h3") + { + if (body.Length > 0) yield return new(title, heading, target, url, kind, Clean(body.ToString())); + body.Clear(); + heading = Clean(node.InnerText); + string anchor = node.GetAttributeValue("id", ""); + target = anchor.Length > 0 ? url + "#" + Uri.EscapeDataString(anchor) : url; + } + if (node.NodeType == HtmlNodeType.Text) body.Append(node.InnerText).Append(' '); + } + if (body.Length > 0) yield return new(title, heading, target, url, kind, Clean(body.ToString())); + } + public static string Clean(string text) => Regex.Replace(HtmlEntity.DeEntitize(text), @"\s+", " ").Trim(); + public static string Normalize(string text) => Regex.Replace(Regex.Replace(text, @"([a-z])([A-Z])", "$1 $2"), @"[_]+", " ").ToLowerInvariant(); + public static IEnumerable TermsForIndex(string text) => Regex.Matches(Normalize(text), @"[\p{L}\p{N}]+(?:[+#]+)?").Select(m => m.Value); + public static string[] Terms(string text) => Regex.Matches(Normalize(text), @"[\p{L}\p{N}]+(?:[+#]+)?").Select(m => m.Value).Take(12).ToArray(); + public static string Snippet(string body, string query) + { + int match = Terms(query).Select(t => body.IndexOf(t, StringComparison.OrdinalIgnoreCase)).Where(i => i >= 0).DefaultIfEmpty(0).Min(); + int start = Math.Max(0, match - 65), length = Math.Min(240, body.Length - start); + return (start > 0 ? "…" : "") + body.Substring(start, length) + (start + length < body.Length ? "…" : ""); + } +} diff --git a/Redot-Documentation/Services/DocumentHeadings.cs b/Redot-Documentation/Services/DocumentHeadings.cs new file mode 100644 index 0000000..15a900b --- /dev/null +++ b/Redot-Documentation/Services/DocumentHeadings.cs @@ -0,0 +1,90 @@ +using System.Text.RegularExpressions; +using Redot_Documentation.Components.Layout; + +namespace Redot_Documentation.Services; + +public static class DocumentHeadings +{ + private static readonly Regex HeadingRegex = new( + @"[^>]*)>(?.*?)", + RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled); + + private static readonly Regex IdRegex = new( + @"\sid\s*=\s*[\""'](?[^\""']+)[\""']", + RegexOptions.IgnoreCase | RegexOptions.Compiled); + + private static readonly Regex HtmlTagRegex = new( + @"<[^>]+>", + RegexOptions.Compiled); + + private static readonly Regex WhitespaceRegex = new( + @"\s+", + RegexOptions.Compiled); + + public static string Apply(string html, List tableOfContents) + { + tableOfContents.Clear(); + + var usedIds = new HashSet(StringComparer.OrdinalIgnoreCase); + + return HeadingRegex.Replace(html, match => + { + var level = int.Parse(match.Groups[1].Value); + var attributes = match.Groups["attributes"].Value; + var content = match.Groups["content"].Value; + var title = DecodeHeadingTitle(content); + + var existingIdMatch = IdRegex.Match(attributes); + if (string.IsNullOrWhiteSpace(title)) + { + if (existingIdMatch.Success) + { + usedIds.Add(existingIdMatch.Groups["id"].Value); + } + return match.Value; + } + var id = existingIdMatch.Success + ? existingIdMatch.Groups["id"].Value + : HeadingAnchor.FromTitle(title); + + id = EnsureUniqueId(id, usedIds); + + if (existingIdMatch.Success && !string.Equals(existingIdMatch.Groups["id"].Value, id, StringComparison.Ordinal)) + { + attributes = IdRegex.Replace(attributes, $" id=\"{id}\"", 1); + } + else if (!existingIdMatch.Success) + { + attributes = $" id=\"{id}\"{attributes}"; + } + + tableOfContents.Add(new DocumentHeading(level, id, title)); + return $"{content}"; + }); + } + + private static string DecodeHeadingTitle(string content) + { + var withoutTags = HtmlTagRegex.Replace(content, string.Empty); + var decoded = System.Net.WebUtility.HtmlDecode(withoutTags); + return WhitespaceRegex.Replace(decoded, " ").Trim(); + } + + private static string EnsureUniqueId(string id, HashSet usedIds) + { + var normalizedId = string.IsNullOrWhiteSpace(id) ? "section" : id; + if (usedIds.Add(normalizedId)) + { + return normalizedId; + } + + var suffix = 2; + while (!usedIds.Add($"{normalizedId}-{suffix}")) + { + suffix++; + } + + return $"{normalizedId}-{suffix}"; + } + +} diff --git a/Redot-Documentation/wwwroot/app.css b/Redot-Documentation/wwwroot/app.css index 509a4a7..ed8ca1b 100644 --- a/Redot-Documentation/wwwroot/app.css +++ b/Redot-Documentation/wwwroot/app.css @@ -263,3 +263,56 @@ h1[tabindex="-1"]:focus { outline: none; } .request-id { margin-top: 20px; } .article-container > h1 { font-size: 2.5rem; font-weight: 750; margin-bottom: 24px; } .mobile-toc .doc-viewer-toc h4 { display: none; } + +/* Keep search centered independently of the different widths on either side. */ +.docs-appbar .mud-toolbar { display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,480px) minmax(0,1fr); gap: 24px; } +.header-brand-group,.header-website-group { display:flex; align-items:center; gap:16px; } +.header-website-group { justify-content:flex-end; } +.header-search { width:100%; border-color:#38383e!important; background:#19191d; color:#bdbdc5!important; text-transform:none; } +.header-search .mud-button-label { display:flex; width:100%; gap:12px; } +.header-search kbd { margin-left:auto; font-size:11px; white-space:nowrap; } +.search-filters { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:12px 0; } +.search-status { color:#b0b0b0; margin:16px 0; } +.search-results { display:grid; gap:8px; } +.search-result { display:flex; flex-direction:column; gap:8px; padding:16px; border:1px solid #303038; border-radius:10px; color:#dedee3; text-decoration:none; } +.search-result:hover,.search-result.selected { background:#242026; border-color:#ff3b0a; } +.search-result strong { color:#fff; } +.search-result-kind { font-size:12px; color:#b0b0b0; overflow-wrap:anywhere; } +.search-result mark { color:#ffd0c4; background:#642515; } +.search-page { max-width:960px; margin:auto; padding:48px 24px; } +@media(max-width:1250px) { + .docs-appbar .mud-toolbar { grid-template-columns:auto minmax(40px,1fr) auto; gap:16px; } + .header-search { max-width:360px; justify-self:center; } + .header-search kbd { display:none; } +} +@media(max-width:950px) { + .header-search { width:44px; min-width:44px; justify-self:end; padding:8px; } + .header-search .search-placeholder { display:none; } + .header-search .mud-button-label { justify-content:center; } + .header-brand-group,.header-website-group { gap:8px; } +} +@media(max-width:600px) { + .docs-appbar .mud-toolbar { gap:8px; padding:0 12px; } + .search-filters { gap:8px; } +} + +@media(max-width:360px) { .header-website-group { display:none; } .docs-appbar .mud-toolbar { grid-template-columns:1fr auto; } } + +/* Search keeps its geometry while requests and result counts change. */ +.documentation-search-dialog { height:min(720px,calc(var(--search-viewport-height,100dvh) - 64px)); max-height:calc(var(--search-viewport-height,100dvh) - 64px)!important; } +.documentation-search-dialog .mud-dialog-content { display:flex; flex-direction:column; min-height:0; overflow:hidden; } +.documentation-search-dialog .search-panel { display:flex; flex-direction:column; height:100%; min-height:0; } +.search-panel > .search-query,.search-panel > .search-filters,.search-panel > .search-status,.search-panel > .search-actions { flex:none; } +.search-status { display:flex; align-items:center; gap:12px; height:3rem; font-size:14px; } +.search-summary { flex:1; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; } +.search-loading { flex:none; font-size:12px; } +.search-announcement { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; } +.search-result-region { min-height:0; overflow-y:auto; scrollbar-gutter:stable; overflow-anchor:none; } +.documentation-search-dialog .search-result-region { flex:1; } +.search-page .search-result-region { min-height:20rem; max-height:70dvh; } +.search-actions { height:48px; padding-top:8px; } +@media(max-width:600px) { + .documentation-search-dialog { height:var(--search-viewport-height,100dvh); max-height:var(--search-viewport-height,100dvh)!important; } + .documentation-search-dialog .mud-dialog-title { padding-block:12px; } + .documentation-search-dialog .search-status { margin:8px 0; } +} diff --git a/Redot-Documentation/wwwroot/js/search.js b/Redot-Documentation/wwwroot/js/search.js new file mode 100644 index 0000000..0d03a64 --- /dev/null +++ b/Redot-Documentation/wwwroot/js/search.js @@ -0,0 +1,30 @@ +let handler; +function updateViewport() { + document.documentElement.style.setProperty('--search-viewport-height', `${window.visualViewport?.height ?? window.innerHeight}px`); +} +export function register(reference) { + unregister(); + handler = event => { + if (event.target.closest('.search-query') && ['ArrowDown','ArrowUp'].includes(event.key) && event.target.tagName === 'INPUT' && event.target.type === 'text') event.preventDefault(); + if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'k') { + event.preventDefault(); + reference.invokeMethodAsync('Open'); + } + }; + document.addEventListener('keydown', handler); + updateViewport(); + window.visualViewport?.addEventListener('resize', updateViewport); + window.addEventListener('resize', updateViewport); +} +export function unregister() { if (handler) document.removeEventListener('keydown', handler); handler = null; window.visualViewport?.removeEventListener('resize', updateViewport); window.removeEventListener('resize', updateViewport); document.documentElement.style.removeProperty('--search-viewport-height'); } +export function isMobile() { return window.matchMedia('(max-width: 600px)').matches; } +export function restoreFocus() { document.getElementById('documentation-search-trigger')?.focus(); } + +export function scrollSelected(panel) { + const region = panel.querySelector('.search-result-region'); + const selected = region?.querySelector('.search-result.selected'); + if (!selected) return; + const outer = region.getBoundingClientRect(), inner = selected.getBoundingClientRect(); + if (inner.top < outer.top) region.scrollTop -= outer.top - inner.top; + else if (inner.bottom > outer.bottom) region.scrollTop += inner.bottom - outer.bottom; +} diff --git a/Redot-Documentation/wwwroot/licenses/HTML-AGILITY-PACK-MIT.txt b/Redot-Documentation/wwwroot/licenses/HTML-AGILITY-PACK-MIT.txt new file mode 100644 index 0000000..1a22520 --- /dev/null +++ b/Redot-Documentation/wwwroot/licenses/HTML-AGILITY-PACK-MIT.txt @@ -0,0 +1,18 @@ +The MIT License (MIT) +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Redot-Documentation/wwwroot/licenses/J2N-LICENSE.txt b/Redot-Documentation/wwwroot/licenses/J2N-LICENSE.txt new file mode 100755 index 0000000..739247c --- /dev/null +++ b/Redot-Documentation/wwwroot/licenses/J2N-LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 J2N + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Redot-Documentation/wwwroot/licenses/LUCENE-APACHE-2.0.txt b/Redot-Documentation/wwwroot/licenses/LUCENE-APACHE-2.0.txt new file mode 100755 index 0000000..ed5e137 --- /dev/null +++ b/Redot-Documentation/wwwroot/licenses/LUCENE-APACHE-2.0.txt @@ -0,0 +1,751 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. this License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Apache Lucene.NET + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + +Some code in src/Lucene.Net/Util/UnicodeUtil.cs was derived from unicode +conversion examples available at http://www.unicode.org/Public/PROGRAMS/CVTUTF. + +Here is the copyright from those sources: + +/* + * Copyright 2001-2004 Unicode, Inc. + * + * Disclaimer + * + * this source code is provided as is by Unicode, Inc. No claims are + * made as to fitness for any particular purpose. No warranties of any + * kind are expressed or implied. The recipient agrees to determine + * applicability of information provided. If this file has been + * purchased on magnetic or optical media from Unicode, Inc., the + * sole remedy for any claim will be exchange of defective media + * within 90 days of receipt. + * + * Limitations on Rights to Redistribute this Code + * + * Unicode, Inc. hereby grants the right to freely use the information + * supplied in this file in the creation of products supporting the + * Unicode Standard, and to make copies of this file in any form + * for internal or external distribution as long as this notice + * remains attached. + */ + + +Some code in src/Lucene.Net/Util/ArrayUtil.cs was derived from Python 2.4.2 +sources available at http://www.python.org. + +Full license is here: + + http://www.python.org/download/releases/2.4.2/license/ + + +Some code in src/Lucene.Net/Util/UnicodeUtil.cs was +derived from Python 3.1.2 sources available at +http://www.python.org. Full license is here: + + http://www.python.org/download/releases/3.1.2/license/ + + +Some code in src/Lucene.Net/Util/Automaton was +derived from Brics automaton sources available at +www.brics.dk/automaton/. Here is the copyright from those sources: + +/* + * Copyright (c) 2001-2009 Anders Moeller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +The levenshtein automata tables in src/Lucene.Net/Util/Automaton +were automatically generated with the moman/finenight FSA package. +Here is the copyright for those sources: + +# Copyright (c) 2010, Jean-Philippe Barrette-LaPierre, +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, +# copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following +# conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. + + +Some code in src/Lucene.Net/Util/UnicodeUtil.cs was +derived from ICU (http://www.icu-project.org) +The full license is available here: + http://source.icu-project.org/repos/icu/icu/trunk/license.html + +/* + * Copyright (C) 1999-2010, International Business Machines + * Corporation and others. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * provided that the above copyright notice(s) and this permission notice appear + * in all copies of the Software and that both the above copyright notice(s) and + * this permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE + * LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder shall not + * be used in advertising or otherwise to promote the sale, use or other + * dealings in this Software without prior written authorization of the + * copyright holder. + */ + + +The following license applies to the Snowball stemmers: + +Copyright (c) 2001, Dr Martin Porter +Copyright (c) 2002, Richard Boulton +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holders nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + +this SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF this SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +The following license applies to src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs: + +Copyright © 2003, +Center for Intelligent Information Retrieval, +University of Massachusetts, Amherst. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. The names "Center for Intelligent Information Retrieval" and +"University of Massachusetts" must not be used to endorse or promote products +derived from this software without prior written permission. To obtain +permission, contact info@ciir.cs.umass.edu. + +THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF MASSACHUSETTS AND OTHER CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +======== + +The following license applies to the Morfologik project: + +Copyright (c) 2006 Dawid Weiss +Copyright (c) 2007-2011 Dawid Weiss, Marcin Miłkowski +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of Morfologik nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +The dictionary comes from Morfologik project. Morfologik uses data from +Polish ispell/myspell dictionary hosted at http://www.sjp.pl/slownik/en/ and +is licenced on the terms of (inter alia) LGPL and Creative Commons +ShareAlike. The part-of-speech tags were added in Morfologik project and +are not found in the data from sjp.pl. The tagset is similar to IPI PAN +tagset. + +--- + +The following license applies to the Morfeusz project, +used by org.apache.lucene.analysis.morfologik. + +BSD-licensed dictionary of Polish (SGJP) +http://sgjp.pl/morfeusz/ + +Copyright © 2011 Zygmunt Saloni, Włodzimierz Gruszczyński, + Marcin Woliński, Robert Wołosz + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDERS “AS IS” AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +======== + +Some code in src/Lucene.Net/Support/LimitedConcurrencyLevelTaskScheduler.cs +was derived from the MSDN web site and falls under the following license: + +MICROSOFT LIMITED PUBLIC LICENSE version 1.1 +This license governs use of code marked as "sample" or "example" available on this web site +without a license agreement, as provided under the section above titled +"NOTICE SPECIFIC TO SOFTWARE AVAILABLE ON THIS WEB SITE." If you use such +code (the "software"), you accept this license. If you do not accept the +license, do not use the software. + +1. Definitions +The terms "reproduce," "reproduction," "derivative works," and "distribution" have the +same meaning here as under U.S. copyright law. +A "contribution" is the original software, or any additions or changes to the software. +A "contributor" is any person that distributes its contribution under this license. +"Licensed patents" are a contributor’s patent claims that read directly on its contribution. + +2. Grant of Rights +(A) Copyright Grant - Subject to the terms of this license, including the license conditions +and limitations in section 3, each contributor grants you a non-exclusive, worldwide, +royalty-free copyright license to reproduce its contribution, prepare derivative works +of its contribution, and distribute its contribution or any derivative works that you create. +(B) Patent Grant - Subject to the terms of this license, including the license conditions +and limitations in section 3, each contributor grants you a non-exclusive, worldwide, +royalty-free license under its licensed patents to make, have made, use, sell, +offer for sale, import, and/or otherwise dispose of its contribution in the +software or derivative works of the contribution in the software. + +3. Conditions and Limitations +(A) No Trademark License- This license does not grant you rights to use any contributors’ +name, logo, or trademarks. +(B) If you bring a patent claim against any contributor over patents that you claim are +infringed by the software, your patent license from such contributor to the software +ends automatically. +(C) If you distribute any portion of the software, you must retain all copyright, patent, +trademark, and attribution notices that are present in the software. +(D) If you distribute any portion of the software in source code form, you may do so only +under this license by including a complete copy of this license with your distribution. +If you distribute any portion of the software in compiled or object code form, you may +only do so under a license that complies with this license. +(E) The software is licensed "as-is." You bear the risk of using it. The contributors +give no express warranties, guarantees or conditions. You may have additional consumer +rights under your local laws which this license cannot change. To the extent permitted +under your local laws, the contributors exclude the implied warranties of merchantability, +fitness for a particular purpose and non-infringement. +(F) Platform Limitation - The licenses granted in sections 2(A) and 2(B) extend only +to the software or derivative works that you create that run directly on a Microsoft +Windows operating system product, Microsoft run-time technology (such as the .NET +Framework or Silverlight), or Microsoft application platform (such as Microsoft +Office or Microsoft Dynamics). + +======== + +Some code in src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer and +src/Lucene.Net.Tests.Analysis.Stempel/Egothor.Stemmer falls +under the following license + + Egothor Software License version 1.00 + Copyright (C) 1997-2004 Leo Galambos. + Copyright (C) 2002-2004 "Egothor developers" + on behalf of the Egothor Project. + All rights reserved. + + This software is copyrighted by the "Egothor developers". If this + license applies to a single file or document, the "Egothor developers" + are the people or entities mentioned as copyright holders in that file + or document. If this license applies to the Egothor project as a + whole, the copyright holders are the people or entities mentioned in + the file CREDITS. This file can be found in the same location as this + license in the distribution. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + 1. Redistributions of source code must retain the above copyright + notice, the list of contributors, this list of conditions, and the + following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, the list of contributors, this list of conditions, and the + disclaimer that follows these conditions in the documentation + and/or other materials provided with the distribution. + 3. The name "Egothor" must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact Leo.G@seznam.cz + 4. Products derived from this software may not be called "Egothor", + nor may "Egothor" appear in their name, without prior written + permission from Leo.G@seznam.cz. + + In addition, we request that you include in the end-user documentation + provided with the redistribution and/or in the software itself an + acknowledgement equivalent to the following: + "This product includes software developed by the Egothor Project. + http://egothor.sf.net/" + + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE EGOTHOR PROJECT OR ITS CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + This software consists of voluntary contributions made by many + individuals on behalf of the Egothor Project and was originally + created by Leo Galambos (Leo.G@seznam.cz). + +======== + +The code RectangularArrays classes falls under the following license + + Copyright © 2007 - 2013 Tangible Software Solutions Inc. + this class can be used by anyone provided that the copyright notice remains intact. + +======== + +src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellTernarySearchTrie.cs +falls under the following license + + Copyright (c) 2005 Bruno Martins + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the organization nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + THE POSSIBILITY OF SUCH DAMAGE. + +======== + +The code in +src/Lucene.Net.Benchmark/Support/Sax +falls under the following license: + +// http://www.saxproject.org +// Written by David Megginson +// NO WARRANTY! This class is in the public domain. + +--- + +The code in .build/psake/ falls under the following license: + +psake +Copyright (c) 2012-13 James Kovacs, Damian Hickey and Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +--- + +src/Lucene.Net/Support/Compatibility/NullableAttributes.cs +src/Lucene.Net/Support/DateTimeOffsetUtil.cs +falls under the following license + +The MIT License (MIT) + +Copyright (c) 2019 .NET Foundation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +Some code in src/Lucene.Net/Support/ConcurrentHashSet.cs falls under the following license: + +MIT License + +Copyright (c) 2019 Bar Arnon + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +Some code in +src/Lucene.Net.TestFramework/Support/Util/DefaultNamespaceTypeWrapper.cs +src/Lucene.Net.TestFramework/Support/Util/LuceneTestCase.TestFixtureAttribute.cs +src/Lucene.Net.TestFramework/Support/Util/NUnitTestFixtureBuilder.cs +falls under the following license: + +// Copyright (c) 2021 Charlie Poole, Rob Prouse +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. diff --git a/Redot-Documentation/wwwroot/licenses/LUCENE-NOTICE.txt b/Redot-Documentation/wwwroot/licenses/LUCENE-NOTICE.txt new file mode 100755 index 0000000..1864f94 --- /dev/null +++ b/Redot-Documentation/wwwroot/licenses/LUCENE-NOTICE.txt @@ -0,0 +1,5 @@ +Apache Lucene.Net +Copyright 2006-2024 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/).