Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for Typesense integration in Scout #9250

Merged
merged 3 commits into from
Jan 16, 2024

Conversation

jasonbosco
Copy link
Contributor

@taylorotwell @driesvints This PR contains documentation for the recently merged Scout PR (laravel/scout#773) that adds Typesense support to Scout.

@taylorotwell taylorotwell marked this pull request as draft January 11, 2024 20:56
@taylorotwell
Copy link
Member

Drafting until release day

@driesvints driesvints marked this pull request as ready for review January 16, 2024 08:26
@taylorotwell taylorotwell merged commit 1b796f1 into laravel:10.x Jan 16, 2024
@nickturrietta
Copy link
Contributor

@jasonbosco, unless I'm mistaken this code does not work for modifying query parameters [1].

use App\Models\Todo;
 
Todo::search('Groceries')->withSearchParameters([
    'query_by' => 'title, description'
])->get();

This was my solution fwiw.

use App\Models\Todo;

tap(Todo::search('Groceries'), function($builder) {
    return $builder->model->searchableUsing()->withSearchParameters([
        'exclude_fields' => 'some_field_here',
    ]);
})->get();

[1] https://laravel.com/docs/10.x/scout#typesense-dynamic-search-parameters

@jasonbosco
Copy link
Contributor Author

CC: @karakhanyans - please see @nickturrietta's comment above.

@jasonbosco
Copy link
Contributor Author

@nickturrietta This issue has been fixed here: laravel/scout#791

The method signature is slightly different now:

use App\Models\Todo;
 
Todo::search('Groceries')->options([
    'query_by' => 'title, description'
])->get();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants