Collections functions
General functions
Render 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 1104 to 1126

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);
    
clear_query_cache("schema");

    return;
    }

This article was last updated 25th May 2022 04:35 Europe/London time based on the source file dated 6th April 2022 16:35 Europe/London time.