Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Classes/Eel/ElasticSearchQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,11 @@ public function count(): int
*/
public function fulltext(string $searchWord, array $options = []): QueryBuilderInterface
{
$encodedSearchWord = json_encode($searchWord, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE);
// remove quotes added by json_encode
$encodedSearchWord = \substr($encodedSearchWord, 1, \strlen($encodedSearchWord)-2);
// We automatically enable result highlighting when doing fulltext searches. It is up to the user to use this information or not use it.
$this->request->fulltext(trim(json_encode($searchWord, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE), '"'), $options);
$this->request->fulltext($encodedSearchWord, $options);
$this->request->highlight(150, 2);

return $this;
Expand Down