Function Fast_custom_index->get_search_rows
Definitions
sources/database_search.php
- Get some rows, queried from the database according to the search parameters, using the fast custom index.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
---|---|---|---|---|---|---|---|
$db | object | No | No | required parameter | N/A | N/A | Database connection |
$index_table | string | No | No | required parameter | N/A | N/A | Table containing our custom index |
$content_table | string | No | No | required parameter | N/A | N/A | The content table to query (may contain JOIN components) |
$key_transfer_map | array | No | No | required parameter | N/A | N/A | A map to show how keys relate between the index table and the content table, used to construct a JOIN |
$where_clause | string | No | No | required parameter | N/A | N/A | Special WHERE clause querying things from content table (i.e. stuff not covered in our index) |
$extra_join_clause | string | No | No | required parameter | N/A | N/A | Extra SQL to insert into the JOIN clauses of each keyword, used to enforce query constraints handled within our indexing |
$search_query | string | No | No | required parameter | N/A | N/A | Search query |
$only_search_meta | boolean | No | No | required parameter | N/A | N/A | Whether to only do a META (tags) search |
$only_titles | boolean | No | No | required parameter | N/A | N/A | Whether to only search titles (as opposed to both titles and content) |
$max | integer | No | No | required parameter | N/A | N/A | Start position in total results |
$start | integer | No | No | required parameter | N/A | N/A | Maximum results to return in total |
$order | ID_TEXT | No | No | required parameter | N/A | N/A | What to order by |
$direction | ID_TEXT | No | No | required parameter | N/A | N/A | Order direction |
$permissions_module | ?string | No | No | Null | N/A | N/A | The permission module to check category access for (null: none) |
$index_permissions_field | ?string | No | No | Null | N/A | N/A | The field that specifies the permissions ID to check category access for (null: none) |
$permissions_field_is_string | boolean | No | No | False | N/A | N/A | Whether the permissions field is a string |
$force_index | ?string | No | No | Null | N/A | N/A | Force a specific index to be used (null: none) |
Returns
- The rows found
- Type: array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Get some rows, queried from the database according to the search parameters, using the fast custom index.
*
* @param object $db Database connection
* @param string $index_table Table containing our custom index
* @param string $content_table The content table to query (may contain JOIN components)
* @param array $key_transfer_map A map to show how keys relate between the index table and the content table, used to construct a JOIN
* @param string $where_clause Special WHERE clause querying things from content table (i.e. stuff not covered in our index)
* @param string $extra_join_clause Extra SQL to insert into the JOIN clauses of each keyword, used to enforce query constraints handled within our indexing
* @param string $search_query Search query
* @param boolean $only_search_meta Whether to only do a META (tags) search
* @param boolean $only_titles Whether to only search titles (as opposed to both titles and content)
* @param integer $max Start position in total results
* @param integer $start Maximum results to return in total
* @param ID_TEXT $order What to order by
* @param ID_TEXT $direction Order direction
* @param ?string $permissions_module The permission module to check category access for (null: none)
* @param ?string $index_permissions_field The field that specifies the permissions ID to check category access for (null: none)
* @param boolean $permissions_field_is_string Whether the permissions field is a string
* @param ?string $force_index Force a specific index to be used (null: none)
* @return array The rows found
*/
public function get_search_rows(object $db, string $index_table, string $content_table, array $key_transfer_map, string $where_clause, string $extra_join_clause, string $search_query, bool $only_search_meta, bool $only_titles, int $max, int $start, string $order, string $direction, ?string $permissions_module = null, ?string $index_permissions_field = null, bool $permissions_field_is_string = false, ?string $force_index = null) : array
* Get some rows, queried from the database according to the search parameters, using the fast custom index.
*
* @param object $db Database connection
* @param string $index_table Table containing our custom index
* @param string $content_table The content table to query (may contain JOIN components)
* @param array $key_transfer_map A map to show how keys relate between the index table and the content table, used to construct a JOIN
* @param string $where_clause Special WHERE clause querying things from content table (i.e. stuff not covered in our index)
* @param string $extra_join_clause Extra SQL to insert into the JOIN clauses of each keyword, used to enforce query constraints handled within our indexing
* @param string $search_query Search query
* @param boolean $only_search_meta Whether to only do a META (tags) search
* @param boolean $only_titles Whether to only search titles (as opposed to both titles and content)
* @param integer $max Start position in total results
* @param integer $start Maximum results to return in total
* @param ID_TEXT $order What to order by
* @param ID_TEXT $direction Order direction
* @param ?string $permissions_module The permission module to check category access for (null: none)
* @param ?string $index_permissions_field The field that specifies the permissions ID to check category access for (null: none)
* @param boolean $permissions_field_is_string Whether the permissions field is a string
* @param ?string $force_index Force a specific index to be used (null: none)
* @return array The rows found
*/
public function get_search_rows(object $db, string $index_table, string $content_table, array $key_transfer_map, string $where_clause, string $extra_join_clause, string $search_query, bool $only_search_meta, bool $only_titles, int $max, int $start, string $order, string $direction, ?string $permissions_module = null, ?string $index_permissions_field = null, bool $permissions_field_is_string = false, ?string $force_index = null) : array