Skip to content

.NET API

FileSearchApi

Scriptable access to the ArtisanFileSearch index: instant in-RAM search over the user’s indexed design files (by file name). Read-only.

from ArtisanPlugin.Scripting import FileSearchApi

See also the guide, API Reference › File Search, and the Python package, ra.file_search.

Methods

Method
CountNumber of files currently in the index.
ReindexRebuilds the index from the configured folders on a background thread and returns immediately — results of a Search right after may still be from the old index.
SearchSearches the file index.

Count

int FileSearchApi.Count()

Number of files currently in the index.

Returns int.

Reindex

void FileSearchApi.Reindex(bool full = false)

Rebuilds the index from the configured folders on a background thread and returns immediately — results of a Search right after may still be from the old index. full forces a clean re-scan.

ParameterTypeDefault
fullboolfalse
IReadOnlyList<FileSearchEntry> FileSearchApi.Search(string query, int max = 50)

Searches the file index. Multiple whitespace-separated tokens must ALL match (order-independent); results are ranked exact-name, starts-with, contains. An EMPTY query returns the most recently modified files. Each entry has: FullPath, FileName, Extension, Size (bytes) and ModifiedUtc.

ParameterTypeDefault
querystringrequired
maxint50

Returns IReadOnlyList<FileSearchEntry>.