Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 9, 2024. It is now read-only.
This repository was archived by the owner on Jan 9, 2024. It is now read-only.

Fallback not worked #122

Open
Open
@coolycow

Description

Hi!

If I understand correctly, then Fallback will not work.

My config:

'mysql' => [
 'mode' => 'NATURAL_LANGUAGE',
 'model_directories' => [app_path() . '/Models'],
 'min_search_length' => 3,
 'min_fulltext_search_length' => 4,
 'min_fulltext_search_fallback' => 'LIKE_EXPANDED',
 'query_expansion' => false
 ]

I am trying to find a match on two characters and I am getting an empty result.

If I understood everything correctly, then the problem occurs because of this code: (src/Engines/MySQLEngine.php):

public function search(Builder $builder)
{
 $result = [];
 if ($this->shouldNotRun($builder)) {
 $result['results'] = Collection::make();
 $result['count'] = 0;
 return $result;
 }
...
}
protected function shouldNotRun($builder)
{
 return strlen($builder->query) < config('scout.mysql.min_search_length');
}

There is no check that the mode is used, in which the search should be switched to another mode if the number of characters is less than necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /