Documentation

do_search.php

Table of Contents

Functions

do_search()  : null|string|array<string|int, mixed>|PreparedStatementQuery
Takes a search string $search, as provided by the user, and returns a results set of matching resources. If there are no matches, instead returns an array of suggested searches
resolve_given_nodes()  : mixed

Functions

Takes a search string $search, as provided by the user, and returns a results set of matching resources. If there are no matches, instead returns an array of suggested searches

do_search(string $search[, string $restypes = '' ][, string $order_by = 'relevance' ][, string $archive = '0' ][, int|array<string|int, mixed> $fetchrows = -1 ][, string $sort = 'desc' ][, bool $access_override = false ][, int $starsearch = DEPRECATED_STARSEARCH ][, bool $ignore_filters = false ][, bool $return_disk_usage = false ][, string $recent_search_daylimit = '' ][, string|bool $go = false ][, bool $stats_logging = true ][, bool $return_refs_only = false ][, bool $editable_only = false ][, bool $returnsql = false ][, int $access = null ][, mixed $smartsearch = false ]) : null|string|array<string|int, mixed>|PreparedStatementQuery
Parameters
$search : string

Search string

$restypes : string = ''

Optionally used to specify which resource types to search for

$order_by : string = 'relevance'
$archive : string = '0'

Allows searching in more than one archive state

$fetchrows : int|array<string|int, mixed> = -1
  • If passing an integer, retrieve the specified number of rows (a limit with no offset). The returned array of resources will be padded with '0' elements up to the total without the limit.
  • If passing an array, the first element must be the offset (int) and the second the limit (int) (the number of rows to return). See setup_search_chunks() for more detail. IMPORTANT: When passing an array, the returned array will be in structured form - as returned by sql_limit_with_total_count() i.e. the array will have 'total' (the count) and 'data' (the resources) named array elements, and the data will not be padded.
$sort : string = 'desc'
$access_override : bool = false

Used by smart collections, so that all all applicable resources can be judged regardless of the final access-based results

$starsearch : int = DEPRECATED_STARSEARCH

DEPRECATED_STARSEARCH passed in for backwards compatibility

$ignore_filters : bool = false
$return_disk_usage : bool = false
$recent_search_daylimit : string = ''
$go : string|bool = false

Paging direction (prev|next)

$stats_logging : bool = true

Log keyword usage

$return_refs_only : bool = false
$editable_only : bool = false
$returnsql : bool = false

Returns the query as a PreparedStatementQuery instance

$access : int = null

Search for resources with this access

$smartsearch : mixed = false
Tags
uses
debug()
hook()
ps_value()
ps_query()
split_keywords()
add_verbatim_keywords()
search_filter()
search_special()
Return values
null|string|array<string|int, mixed>|PreparedStatementQuery

resolve_given_nodes()

resolve_given_nodes(mixed &$search, mixed &$node_bucket, mixed &$node_bucket_not) : mixed
Parameters
$search : mixed
$node_bucket : mixed
$node_bucket_not : mixed
On this page

Search results