…$match->doc ]; } else { $current_post_object = relevanssi_get_post( $match->doc ); $minimum_doc_length = 5000; // in characters if ( ! $current_post_object ) { $idl = 1; } else { $post_length = max( $minimum_doc_length, strlen( $current_post_object->post_content ) ); $idl = $minimum_doc_length / $post_length; } $relevanssi_post_idl[ $match->doc ] = $idl; } $match_multiplier =……a boost to shorter posts that have a higher weight and will punish very long posts that rank high just for being long. The version above only considers post content. It does not count the attachment content. This version includes that: add_filter( ‘relevanssi_match’, ‘rlv_inverse_document_length’, 10, 2 ); function rlv_inverse_document_length( $match,…By default, Relevanssi tends to prefer longer posts. The default TF × IDF weights Relevanssi uses simply count the term frequency, ie. how many times a word appears in the post. That prefers longer posts as they usually have the search term appear more often. However, a 500-word post with…