Last active
August 29, 2015 14:03
-
-
Save tonymet/1c662dfb30db229fe055 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$count = $boost = count($matches); | |
$query .= "(or (phrase boost=" . ($boost+1) . " '" . $keyword . "')"; | |
for($i=0; $i < $count -1; $i++ ) | |
{ | |
$query .="(and (phrase boost={$boost} '" . $matches[$i] . "'))"; | |
$boost-=1; | |
} | |
$query .= "(prefix boost={$boost} '" . $matches[$i] . "'))"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment