• Hi,

    Im using relevanssi instead of the regular wordpress search
    I had 2 queries

    1st I wanted to search the tilte and contents for the full string searched
    for eg i search for “is this true” then wordpress query searches for search_terms : is, this and true. I dont want this meaning it should search tile, content etc for search term “is this true”. So I did as follows:
    $wp_query->query_vars[‘search_terms’] = array( “0” => ‘”‘.$_REQUEST[‘s’].'”‘);
    $wp_query->query_vars[‘s’] = ‘”‘.$_REQUEST[‘s’].'”‘;
    $wp_query->query[‘s’] = ‘”‘.$_REQUEST[‘s’].'”‘;
    relevanssi_do_query($wp_query);

    when i display the output it shows me the search_term as array(“0″=>”is this true”)

    But when i echo the content with highlighting using following code
    if (function_exists(‘relevanssi_highlight_terms’)) {
    echo relevanssi_highlight_terms(get_the_content(),get_search_query());
    }
    else { echo get_the_content(); }

    it shows me individual search term highlighted like “is this”, “this”, “is”, “this true” etc

    I dont want this to happen ANY SOLUTIONS 🙁
    As a record with title “is this true” has to come top even if the number of matched string in content is more. Hope u got what i mean

    2nd how to project the relevance score as a percentage.

    Plz help
    Aalok Dhond

    http://wordpress.org/extend/plugins/relevanssi/

Viewing 1 replies (of 1 total)
  • Plugin Author Mikko Saari

    (@msaari)

    The Relevanssi score is not a percentage. There’s no upper bound to it, no perfect 100% score, so there’s really no meaningful way to make it a percentage.

    Highlighting does highlight individual words, there’s no way to make it highlight only complete phrases at the moment.

    To make sure titles are ranked higher, increase the title weight a lot, to 1000 or more.

Viewing 1 replies (of 1 total)

The topic ‘Search based on the full string’ is closed to new replies.