truesearch.query

Search the TrueSearch index for files and directories in path and its subdirectories.

TrueSearch uses the index that answers macOS Spotlight searches through SMB. Middleware converts the filters into a Spotlight query. Thus, a query gets the same results as a Spotlight search from a Mac.

Type: object

Type: array
No Additional Items

Tuple Validation

Parameter 1: data

data

Type: object

The directory to search, the filters, the options, and the user.

No Additional Properties

Path

Type: string

The directory to search. Use an absolute path in a dataset that TrueSearch indexes. TrueSearch indexes each dataset that contains an SMB share with Spotlight search enabled, or a WebShare share with search enabled. If path is above the indexed directory of the dataset, TrueSearch searches all of the indexed directory.

Must be at least 1 characters long

Username

Default: null

The user to search as. The user must be able to access path. The results include only the files and directories that this user can access. An administrator can use this to see what the user can find. If username is null, the search runs as root and returns all matches.

Type: string
Type: null

Recursive

Type: boolean Default: false

Also search the indexed datasets that are mounted beneath path. Each dataset has a separate index. Without recursive, the query searches only the dataset that contains path. With recursive, the query merges the results of all datasets, newest first. limit applies to the merged results.

Query-Filters

Type: array Default: []

Filters can also use macos_kind, tags, and comment. These fields are not in the results.

No Additional Items
Each item of this array must be:
Type: object

Examples:

[
    [
        "name",
        "=",
        "bob"
    ]
]
[
    [
        "OR",
        [
            [
                "name",
                "=",
                "bob"
            ],
            [
                "name",
                "=",
                "larry"
            ]
        ]
    ]
]

TruesearchQueryOptions

Type: object Default: {"limit": 100}

Options for the results of the query.

No Additional Properties

Limit

Type: integer Default: 100

The maximum number of entries to return.

Value must be greater or equal to 1 and lesser or equal to 1000

Result

Type: array of object

The entries that match, with the newest entries first.

No Additional Items
Each item of this array must be:

TruesearchEntry

Type: object
No Additional Properties

Path

Type: string

The absolute path of the file or directory.

Name

Type: string

The name of the file or directory.

Type

Type: enum (of string)

The type of the file or directory. OTHER is a FIFO, a socket, or a device file.

Must be one of:
  • "DIRECTORY"
  • "FILE"
  • "SYMLINK"
  • "OTHER"

Size


The size in bytes.

Type: integer
Type: null

Mode


The file mode, as st_mode gives it.

Type: integer
Type: null

Uid


The user ID of the owner.

Type: integer
Type: null

Gid


The group ID of the owner group.

Type: integer
Type: null

Mtime


The last time that the data changed.

Type: stringFormat: date-time
Type: null

Btime


The time that the file was created.

Type: stringFormat: date-time
Type: null

Atime


The last time that the file was read.

Type: stringFormat: date-time
Type: null

Inode


The inode number, as st_ino gives it.

Type: integer
Type: null

Handle


A file handle, encoded in base64. Use it on the NAS to open the file in a race-free manner. It identifies the file uniquely in its dataset for the lifetime of the file.

Type: string
Type: null


Required roles: READONLY_ADMIN