Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 1131 to 1150

Definition

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

    
$count_indexed_node_keywords ps_value("SELECT count(node) AS 'value' FROM node_keyword WHERE node = ?", array("i"$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);
    }

This article was last updated 19th March 2024 02:35 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.