Skip to content

Commit

Permalink
Revert search performance regression
Browse files Browse the repository at this point in the history
We decided it is better to have a less intelligent search (that does not
match search terms in titles) for some people than a bad-performing
search for everyone.

We will revisit the search performance topic in the next release cycle,
possibly with larger changes around indexing.

Refs #1738, #1741, #1764.
  • Loading branch information
franzliedke committed Oct 26, 2019
1 parent aa31b83 commit 9f6ec80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Discussion/Search/Gambit/FulltextGambit.php
Expand Up @@ -53,7 +53,7 @@ public function apply(AbstractSearch $search, $bit)
// discussions that have a relevant title or that contain relevant posts.
$query
->addSelect('posts_ft.most_relevant_post_id')
->leftJoin(
->join(
new Expression('('.$subquery->toSql().') '.$grammar->wrapTable('posts_ft')),
'posts_ft.discussion_id', '=', 'discussions.id'
)
Expand Down
Expand Up @@ -76,7 +76,7 @@ public function can_search_for_author()
/**
* @test
*/
public function can_search_for_word_in_title_and_post()
public function can_search_for_word_in_post()
{
$this->database()->table('posts')->insert([
['id' => 2, 'discussion_id' => 2, 'created_at' => Carbon::now()->toDateTimeString(), 'user_id' => 2, 'type' => 'comment', 'content' => '<t><p>not in text</p></t>'],
Expand All @@ -98,7 +98,7 @@ public function can_search_for_word_in_title_and_post()
}, $data['data']);

// Order-independent comparison
$this->assertEquals(['2', '3'], $ids, 'IDs do not match', 0.0, 10, true);
$this->assertEquals(['3'], $ids, 'IDs do not match', 0.0, 10, true);
}

/**
Expand Down Expand Up @@ -126,7 +126,7 @@ public function ignores_non_word_characters_when_searching()
}, $data['data']);

// Order-independent comparison
$this->assertEquals(['2', '3'], $ids, 'IDs do not match', 0.0, 10, true);
$this->assertEquals(['3'], $ids, 'IDs do not match', 0.0, 10, true);
}

/**
Expand Down

0 comments on commit 9f6ec80

Please sign in to comment.