apply_filters( 'relevanssi_pdf_for_parent_insert_data', array $insert_data, int $post_id )

Filters the indexing data for the attachment contents indexed for their parent posts.


(array) The index data, formatted as $insert_data[ term ][ column ] = frequency.

(int) The post ID for the parent post.

More information

When Relevanssi Premium indexes the attachment data, it can be indexed independently for the attachment post, or as part of the parent post where the attachment is attached to. If this option is chosen, Relevanssi uses the relevanssi_index_pdf_for_parent() function to index the content for the parent post.

This function reads in the attachment contents from the meta fields of the attached posts (the query that does this is filtered by relevanssi_pdf_for_parent_query), tokenizes the content and creates a data array from the tokens. This array is finally passed through this filter hook before it is returned.

The array that this filter gets has an entry for each distinct term. Since Relevanssi considers this custom field data, the term frequency counts are in $insert_data['term']['customfield'] for each term.