Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nbolender committed Dec 18, 2019
1 parent c0fa861 commit 7783036
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/TNTSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ public function search($phrase, $numOfResults = 100)
*/
public function searchBoolean($phrase, $numOfResults = 100)
{
$keywords = $this->breakIntoTokens($phrase);
$lastKeyword = end($keywords);
$keywords = $this->breakIntoTokens($phrase);
$lastKeyword = end($keywords);

$stack = [];
$startTimer = microtime(true);
Expand All @@ -165,12 +165,12 @@ public function searchBoolean($phrase, $numOfResults = 100)
$left = array_pop($stack);
$right = array_pop($stack);
if (is_string($left)) {
$isLastKeyword = $left == $lastKeyword;
$isLastKeyword = $left == $lastKeyword;
$left = $this->getAllDocumentsForKeyword($this->stemmer->stem($left), true, $isLastKeyword)
->pluck('doc_id');
}
if (is_string($right)) {
$isLastKeyword = $right == $lastKeyword;
$isLastKeyword = $right == $lastKeyword;
$right = $this->getAllDocumentsForKeyword($this->stemmer->stem($right), true, $isLastKeyword)
->pluck('doc_id');
}
Expand All @@ -188,12 +188,12 @@ public function searchBoolean($phrase, $numOfResults = 100)
$right = array_pop($stack);

if (is_string($left)) {
$isLastKeyword = $left == $lastKeyword;
$isLastKeyword = $left == $lastKeyword;
$left = $this->getAllDocumentsForKeyword($this->stemmer->stem($left), true, $isLastKeyword)
->pluck('doc_id');
}
if (is_string($right)) {
$isLastKeyword = $right == $lastKeyword;
$isLastKeyword = $right == $lastKeyword;
$right = $this->getAllDocumentsForKeyword($this->stemmer->stem($right), true, $isLastKeyword)
->pluck('doc_id');
}
Expand Down

0 comments on commit 7783036

Please sign in to comment.