Function Fast_custom_index->index_for_search__lang__appearance_context

Definitions

sources/database_search.php

  • Index a content resource, specifically for a particular language and appearance context.
  • Visibility: protected
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Return: array

Parameters

Name Type Default Set Range Description
$db object required parameter N/A N/A Database connection
$lang LANGUAGE_NAME required parameter N/A N/A Language codename
$index_table string required parameter N/A N/A Table containing our custom index
$content_fields array required parameter N/A N/A Map of content fields, field name to data (may contain fake fields)
$appearance_context integer required parameter N/A N/A An APPEARANCE_CONTEXT_* constant
$fields_to_index array required parameter N/A N/A List of field names from $content_fields that should be indexed for ngram tokens
$key_map array required parameter N/A N/A A map of keys for the index
$filter_field_transfer_map array required parameter N/A N/A A map between content field keys to index field keys, so we can fill out some of the filtering that goes inside the index
$ngrams_exclude ?array required parameter N/A N/A A list of ngrams to explicitly exclude (used internally to stop repetitions across multiple APPEARANCE_CONTEXTs, ultimately required to stop row repetition in output) (null: none)
$total_singular_ngram_tokens ?integer Null N/A N/A Maintain a count of singular ngrams (typically words) in here (null: do not maintain)
$statistics_map ?array Null N/A N/A Write into this map of singular ngram (typically, words) to number of occurrences (null: do not maintain a map)

Return

  • Map between ngrams and number of occurrences
  • Type: array
  • Set: N/A
  • Range: N/A