Skip to content

Commit

Permalink
Fix pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
alecritson committed Dec 17, 2024
1 parent de88b9e commit bdc2ff9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Engines/TypesenseEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function get(): SearchResults
$response = $engine->getMultiSearch()->perform($request, [
'collection' => (new $this->modelType)->searchableAs(),
]);

$completeResults = $response['results'][0];

unset( $response['results'][0]);
Expand Down Expand Up @@ -190,11 +190,16 @@ protected function buildSearch(array $options): array
'q' => $searchQuery->query,
'facet_query' => $facetQuery,
'prefix' => false,
'exlude_fields' => 'embedding',
'max_facet_values' => 50,
'sort_by' => $this->sortRaw ?: ($this->sortByIsValid() ? $this->sort : '_text_match:desc'),
'facet_by' => implode(',', $searchQuery->facets),
];

if ($this->query) {
$params['vector_query'] = "embedding:([], k: 200)";
}

if ($filters->count()) {
$params['filter_by'] = $filters->join(' && ');
}
Expand Down

0 comments on commit bdc2ff9

Please sign in to comment.