Get-NozGraph, Find-NozNote, Measure-NozGarden, Set-NozNoteStatus, Get-NozOrphans — graph edges, Meilisearch search, garden stats, frontmatter status patch, orphan detection from inbound link analysis.
35 lines
891 B
C#
35 lines
891 B
C#
using System.Management.Automation;
|
|
|
|
namespace Noz.PowerShell.Cmdlets;
|
|
|
|
[Cmdlet(VerbsCommon.Find, "NozNote")]
|
|
[OutputType(typeof(NozSearchHit))]
|
|
public sealed class FindNozNoteCmdlet : NozCmdletBase
|
|
{
|
|
[Parameter(Mandatory = true, Position = 0)]
|
|
public string Query { get; set; } = "";
|
|
|
|
[Parameter]
|
|
public string? Topic { get; set; }
|
|
|
|
[Parameter]
|
|
public int Limit { get; set; } = 20;
|
|
|
|
protected override void ProcessRecord()
|
|
{
|
|
var hits = Run(Api.SearchAsync(Query, Topic, Limit));
|
|
|
|
foreach (var h in hits)
|
|
{
|
|
WriteObject(new NozSearchHit
|
|
{
|
|
Slug = h.Slug,
|
|
Title = h.Title,
|
|
Description = h.Description,
|
|
Topic = h.Topic,
|
|
Status = h.Status,
|
|
Lang = h.Lang,
|
|
});
|
|
}
|
|
}
|
|
}
|