Skip to content

Commit 392dd65

Browse files
committed
asYouType as a runtime option
1 parent ac79456 commit 392dd65

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ In your `config/scout.php` add:
6363
],
6464
```
6565

66+
The `asYouType` option can be set per model basis, see example bellow
67+
6668
## Usage
6769

6870
After you have installed scout and the TNTSearch driver, you need to add the
@@ -80,6 +82,8 @@ use Laravel\Scout\Searchable;
8082
class Post extends Model
8183
{
8284
use Searchable;
85+
86+
public $asYouType = true;
8387

8488
/**
8589
* Get the indexable data array for the model.

src/Engines/TNTSearchEngine.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ protected function performSearch(Builder $builder)
128128
$this->tnt->selectIndex("{$index}.index");
129129

130130
$this->builder = $builder;
131+
$this->tnt->asYouType = $builder->model->asYouType ?: false;
131132

132133
return $this->tnt->search($builder->query, $limit);
133134
}

0 commit comments

Comments
 (0)