Function __global->can_use_fast_custom_index

Definitions

sources/database_search.php

  • Find if we can use the fast custom index.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$hook string No No required parameter N/A N/A The hook it is for (assumption that this hook is at least capable in some situations)
$db ?object No No Null N/A N/A Database connection (null: do not do indexed-already check)
$index_table ?string No No Null N/A N/A Index table (null: do not do indexed-already check)
$search_query ?string No No Null N/A N/A Search uery to run for (null: no query to check at this point)
$has_heavy_filtering ?boolean No No Null N/A N/A Whether there is heavy filtering (which suggests to use fast custom index) (null: unknown at this point)

Returns

  • Whether we can
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Find if we can use the fast custom index.
 *
 * @param  string $hook The hook it is for (assumption that this hook is at least capable in some situations)
 * @param  ?object $db Database connection (null: do not do indexed-already check)
 * @param  ?string $index_table Index table (null: do not do indexed-already check)
 * @param  ?string $search_query Search uery to run for (null: no query to check at this point)
 * @param  ?boolean $has_heavy_filtering Whether there is heavy filtering (which suggests to use fast custom index) (null: unknown at this point)
 * @return boolean Whether we can
 */

function can_use_fast_custom_index(string $hook, ?object $db = null, ?string $index_table = null, ?string $search_query = null, ?bool $has_heavy_filtering = null) : bool