Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

check_node_indexed()

Description

Function used to check if a fields' node needs (re-)indexing

Parameters

ColumnTypeDefaultDescription
$node array Individual node for a field ( as returned by get_nodes() )
$partial_index boolean false Partially index flag for node keywords

Return

void

Location

include/node_functions.php lines 1049 to 1071

Definition

 
function check_node_indexed(array $node$partial_index false)
    {
    if(
'' === trim($node['name']))
        {
        return;
        }

    
$count_indexed_node_keywords sql_value("SELECT count(node) AS 'value' FROM node_keyword WHERE node = '" escape_check($node['ref']) . "'"0);
    
$keywords                    split_keywords($node['name'], true$partial_index);

    if(
$count_indexed_node_keywords == count($keywords))
        {
        
// node has already been indexed
        
return;
        }

    
// (re-)index node
    
remove_all_node_keyword_mappings($node['ref']);
    
add_node_keyword_mappings($node$partial_index);
    
clear_query_cache("schema");

    return;
    }

This article was last updated 17th May 2021 23:05 Europe/London time based on the source file dated 29th March 2021 12:15 Europe/London time.