/sources/database_search.php

Description
Functions
build_content_where (line 722)

Build a fulltext query WHERE clause from given content.

  • return: Array of WHERE clause and exploded content
array build_content_where (string $content, boolean $boolean_search, string &$boolean_operator)
  • string $content: The search content
  • boolean $boolean_search: Whether it's a boolean search
  • string &$boolean_operator: Boolean operation to use
build_search_results_interface (line 824)

Build a templated list of the given search results, for viewing.

  • return: Interface
tempcode build_search_results_interface (array $results, integer $start, integer $max, string $direction, [boolean $general_search = false])
  • array $results: Search results
  • integer $start: Start index
  • integer $max: Maximum index
  • string $direction: Sort direction
  • boolean $general_search: Whether this is a general search, rather than a search for a specific result-type (such as all members)
build_search_submitter_clauses (line 141)

Build up a submitter search clause, taking into account members, authors, usernames, and usergroups.

  • return: An SQL fragment (NULL: block query)
?string build_search_submitter_clauses (?ID_TEXT $member_field_name, ?MEMBER $member_id, ID_TEXT $author, [?ID_TEXT $author_field_name = NULL])
  • ?ID_TEXT $member_field_name: The field name for member IDs (NULL: Cannot match against member IDs)
  • ?MEMBER $member_id: Member ID (NULL: Unknown, so cannot search)
  • ID_TEXT $author: Author
  • ?ID_TEXT $author_field_name: The field name for authors (NULL: Cannot match against member IDs)
db_like_assemble (line 218)

Generate SQL for a boolean search.

  • return: The SQL
string db_like_assemble (string $content, [string $boolean_operator = 'AND'])
  • string $content: Boolean search string
  • string $boolean_operator: Boolean operator to use
exact_match_sql (line 200)

Get special SQL from POSTed parameters for a catalogue search field that is to be exact-matched.

  • return: Tuple of SQL details (array: extra trans fields to search, array: extra plain fields to search, string: an extra table segment for a join, string: the name of the field to use as a title, if this is the title, extra WHERE clause stuff) (NULL: nothing special)
?array exact_match_sql (array $row, integer $i, [ID_TEXT $type = 'short'])
  • array $row: The row for the field to input
  • integer $i: We're processing for the ith row
  • ID_TEXT $type: Table type
get_search_rows (line 334)

Get some rows, queried from the database according to the search parameters.

  • return: The rows found
array get_search_rows (?ID_TEXT $meta_type, ?ID_TEXT $meta_id_field, array $content_explode, boolean $only_search_meta, ID_TEXT $direction, integer $max, integer $start, boolean $only_titles, ID_TEXT $table, array $fields, string $where_clause, string $content_where, ID_TEXT $order, [string $select = '*'], [?array $raw_fields = NULL], [?string $permissions_module = NULL], [?string $permissions_field = NULL], [boolean $permissions_field_is_string = false])
  • ?ID_TEXT $meta_type: The META type used by our content (NULL: Cannot support META search)
  • ?ID_TEXT $meta_id_field: The name of the field that retrieved META IDs will relate to (NULL: Cannot support META search)
  • array $content_explode: A list of words for the boolean search
  • boolean $only_search_meta: Whether to only do a META (tags) search
  • ID_TEXT $direction: Order direction
  • integer $max: Start position in total results
  • integer $start: Maximum results to return in total
  • boolean $only_titles: Whether to only search titles (as opposed to both titles and content)
  • ID_TEXT $table: The table name
  • array $fields: The translateable fields to search over (or an ! which is skipped). The first of these must be the title field or an '!'; if it is '!' then the title field will be the first raw-field
  • string $where_clause: The WHERE clause
  • string $content_where: The WHERE clause that applies specifically for content (this will be duplicated to check against multiple fields). ? refers to the yet-unknown field name
  • ID_TEXT $order: What to order by
  • string $select: What to select
  • ?array $raw_fields: The non-translateable fields to search over (NULL: there are none)
  • ?string $permissions_module: The permission module to check category access for (NULL: none)
  • ?string $permissions_field: The field that specifies the permissions ID to check category access for (NULL: none)
  • boolean $permissions_field_is_string: Whether the permissions field is a string
init__database_search (line 26)

Standard code module initialisation function.

void init__database_search ()
in_memory_search_match (line 636)

Perform a database-style in-memory boolean search on single item.

  • return: Whether we have a match
boolean in_memory_search_match (array $filter, string $title, string $post)
  • array $filter: A map of POST data in search-form style
  • string $title: The title to try and match
  • string $post: The post to try and match
opensearch_script (line 34)

Server opensearch requests.

void opensearch_script ()
sort_search_results (line 782)

Sort search results as returned by the search hook.

  • return: Sorted results
array sort_search_results (array $hook_results, array $results, string $direction)
  • array $hook_results: Search results from the search hook, assumed already sorted
  • array $results: Existing array of results (originally starts blank)
  • string $direction: Sort direction

Documentation generated on Sun, 02 Jan 2011 23:12:53 +0000 by phpDocumentor 1.4.3