Collections functions
Encryption functions
General functions
Theme permission 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 1024 to 1046

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 11th July 2020 02:35 Europe/London time based on the source file dated 6th July 2020 18:09 Europe/London time.