Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

log_keyword_usage()

Description

Log which keywords are used in a search

Parameters

ColumnTypeDefaultDescription
$keywords array refs of keywords used in a search
$search_result
$search_results array result of the search

Location

include/search_functions.php lines 3627 to 3646

Definition

 
function log_keyword_usage($keywords$search_result)
    {
    if(
is_array($keywords) && count($keywords) > 0)
        {
        if(
array_key_exists('total'$search_result))
            {
            
$count $search_result['total'];
            }
        elseif(
is_array($search_result))
            {
            
$count count($search_result);
            }

        
$log_code = (!isset($count) || $count 'Keyword usage' 'Keyword usage - no results found');
        foreach(
$keywords as $keyword)
            {
            
daily_stat($log_code$keyword);
            }
        }
    }

This article was last updated 4th December 2024 09:05 Europe/London time based on the source file dated 27th November 2024 09:40 Europe/London time.