Skip to contents

Search every record type at once (live only: a past release cannot be searched, so a pinned client gets plasticdb_release_live_only).

Usage

search_hits(q, limit = Inf, client = plasticdb_client())

search_grouped(q, limit = 10, client = plasticdb_client())

search_autocomplete(q, client = plasticdb_client())

Arguments

q

The search text.

limit

For search_hits(), the most hits to return; for search_grouped(), the hits per record type.

client

A plasticdb_client().

Value

A tibble with provenance, or (search_grouped()) a list.

Details

  • search_hits() returns ranked hits, one row each, with entity_type (protein, microorganism, plastic, paper, ...), route_key (a string: the accession or id to pass to the matching *_get() function; a variant's is its accession, for variants_get()) and rank. (It is not called search(), which would mask base::search().)

  • search_grouped() returns the top limit hits (at most 100) for each record type: a list with the overall total, a groups tibble (each type's total and the query that lists more) and the hits.

  • search_autocomplete() returns name suggestions, as the site's search box shows them.

Examples

search_hits("cutinase", limit = 5)[, c("entity_type", "route_key", "name")]
# \donttest{
search_grouped("PETase", limit = 1)$groups
# }