I have found the solution for that, Now result match to exact full sentence like – “crest of holy fire”. You just need to add one filter code in your Search Everything plugin.
1. Open the plugin file – search-everything.php
2. Search function or keyword – function se_get_search_terms()
3. Add this line code just before return statement – $search_terms = apply_filters( ‘merge_search_term’, $search_terms );
function se_get_search_terms() {
global $wpdb;
$s = isset( $this->query_instance->query_vars['s'] ) ? $this->query_instance->query_vars['s'] : '';
$sentence = isset( $this->query_instance->query_vars['sentence'] ) ? $this->query_instance->query_vars['sentence'] : false;
$search_terms = array();
if ( !empty( $s ) ) {
// added slashes screw with quote grouping when done early, so done later
$s = stripslashes( $s );
if ( $sentence ) {
$search_terms = array( $s );
} else {
preg_match_all( '/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches );
$search_terms = array_filter(array_map( create_function( '$a', 'return trim($a, "\\"\'\\n\\r ");' ), $matches[0] ));
}
}
// I have added following filter.
$search_terms = apply_filters( 'merge_search_term', $search_terms );
return $search_terms;
}
look like this
4. Now final step, Open your theme functions.php file add the following code
add_filter( 'merge_search_term', 'callback_merge_search_term', 10, 1 );
function callback_merge_search_term($search_terms){
$merge_search_terms = implode(" ", $search_terms);
$one_index_search_term = array($merge_search_terms);
return $one_index_search_term;
}
-
This reply was modified 8 years, 5 months ago by
shubham jain.