.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 | |
|---|---|
Count | Number of files currently in the index. |
Reindex | 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. |
Search | Searches 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.
| Parameter | Type | Default |
|---|---|---|
full | bool | false |
Search
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.
| Parameter | Type | Default |
|---|---|---|
query | string | required |
max | int | 50 |
Returns IReadOnlyList<FileSearchEntry>.