add typesense search config values to .env

This commit is contained in:
Irfan 2022-11-28 23:00:43 +05:00
parent 4ad079c600
commit 5f571cfb14
2 changed files with 4 additions and 1 deletions

View File

@ -103,6 +103,8 @@ QUEUE_DELAY_PER_JOB=5
#TYPESENSE_HOST=localhost
#TYPESENSE_PORT=8108
#TYPESENSE_API_KEY=
#TYPESENSE_SEARCH_EXHAUSTIVE=true
#TYPESENSE_SEARCH_CUTTOFF_MS=450
###
# ElasticSearch Config

View File

@ -31,7 +31,8 @@ class TypeSenseScoutSearchService implements ScoutSearchService
// let's enable exhaustive search
// which will make Typesense consider all variations of prefixes and typo corrections of the words
// in the query exhaustively, without stopping early when enough results are found.
$options['exhaustive_search'] = true;
$options['exhaustive_search'] = env('TYPESENSE_SEARCH_EXHAUSTIVE', true);
$options['search_cutoff_ms'] = env('TYPESENSE_SEARCH_EXHAUSTIVE', 450);
if (array_key_exists('per_page', $options) && $options['per_page'] > 250) {
$options['per_page'] = min($this->maxItemsPerPage, 250);