RazorDocs Search

Controllers

Type

DocsController

Controller for serving documentation pages.

Method

Index

Task<IActionResult> Index()

Displays the documentation index view containing available documentation items.

Returns

A view result whose model is the collection of documentation items extracted from the repository.

Method

Details

Task<IActionResult> Details(string path)

Displays the details view for a documentation item identified by the given path.

Parameters

  • pathThe unique path or identifier of the documentation item to retrieve.

Returns

An IActionResult rendering the details view with the document; returns NotFoundResult if the path is invalid or the document is missing.

Method

Search

Method

SearchIndex

Task<IActionResult> SearchIndex()

Returns docs search index data for live-hosted docs.

Returns

A JSON result containing searchable document metadata and content fields.

Method

ShouldRefreshCache

bool ShouldRefreshCache(IQueryCollection query)

Determines whether the search index cache should be refreshed based on the presence of a "refresh" query parameter.

Parameters

  • queryThe collection of query parameters from the HTTP request.

Returns

true if the cache should be refreshed; otherwise, false.

Method

CanRefreshCache

bool CanRefreshCache()

Checks whether the current user has permission to initiate a cache refresh.

Returns

true if the user is authenticated; otherwise, false.