Evaluate a query against the outpack database, returning a vector
of matching packet ids. Note that by default this only searches
through packets that are unpacked and available for direct use on
this computer; to search within packets known to other locations
(and that we might know about via their metadata) you will need to
use the options
argument.
Usage
orderly_search(
expr,
name = NULL,
scope = NULL,
subquery = NULL,
parameters = NULL,
envir = parent.frame(),
location = NULL,
allow_remote = NULL,
fetch_metadata = FALSE,
options = NULL,
root = NULL
)
Arguments
- expr
The query expression. A
NULL
expression matches everything.- name
Optionally, the name of the packet to scope the query on. This will be intersected with
scope
arg and is a shorthand way of runningscope = list(name = "name")
- scope
Optionally, a scope query to limit the packets searched by
pars
- subquery
Optionally, named list of subqueries which can be referenced by name from the
expr
.- parameters
Optionally, a named list of parameters to substitute into the query (using the
this:
prefix)- envir
Optionally, an environment to substitute into the query (using the
environment:
prefix). The default here is to use the calling environment, but you can explicitly pass this in if you want to control where this lookup happens.- location
Optional vector of locations to pull from. We might in future expand this to allow wildcards or exceptions.
- allow_remote
Logical, indicating if we should allow packets to be found that are not currently unpacked (i.e., are known only to a location that we have metadata from). If this is
TRUE
, then in conjunction with orderly_dependency you might pull a large quantity of data. The default isNULL
. This isTRUE
if remote locations are listed explicitly as a character vector in thelocation
argument, or if you have specifiedfetch_metadata = TRUE
, otherwiseFALSE
.- fetch_metadata
Logical, indicating if we should pull metadata immediately before the search. If
location
is given, then we will pass this through to orderly_location_fetch_metadata to filter locations to update. If pulling many packets in sequence, you will want to update this option toFALSE
after the first pull, otherwise it will update the metadata between every packet, which will be needlessly slow.- options
DEPRECATED. Please don't use this any more, and instead use the arguments
location
,allow_remote
andfetch_metadata
directly.- root
The path to the root directory, or
NULL
(the default) to search for one from the current working directory. This function does not require that the directory is configured for orderly, and can be anyoutpack
root (see orderly_init for details).