You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when using PostgreSQL as the index for full-text search with Laravel Scout, the default language is set to English with no built-in way to modify it. This limitation restricts the use of the driver in applications requiring multilingual support, reducing the flexibility of Laravel Scout in global scenarios.
Expected Behavior:
There should be support for configuring the default language, either globally or at the model level, to enable compatibility with multilingual applications.
Current Behavior:
The default language for full-text search is fixed to English, with no options for modification.
Impact of the Issue:
The lack of support limits the usage of Laravel Scout in contexts where multiple languages are required, making it harder for developers to adopt the framework in global environments.
Possible Solution:
Enhance Laravel Scout with additional configurations to allow custom language settings:
1 - Global Configuration: Add an option in the file
return [
'driver' => 'database',
'database' => [
'language' => 'portuguese', // Default language for full-text search
],
];
2 - Model-Level Configuration: Introduce a method in models for specifying the language.
class Post extends Model
{
use Searchable;
publicfunctionsearchableLanguage(): string
{
return'portuguese';
}
}
3 - Method-Level Override: Provide an option to dynamically override the language when calling .
1 - Set up PostgreSQL as the index for full-text search in Laravel Scout.
2 - Execute a search and note that the default language is English.
3 - Observe that there are no options to modify the language globally, at the model level, or through method calls.
Note:
I was unsure whether this should be categorized as a feature request or a bug. Since I couldn't submit it as a feature request, I am submitting it as a bug report instead. Apologies for any inconvenience this may cause.
Steps To Reproduce
1 - Set up PostgreSQL as the index for full-text search in Laravel Scout.
2 - Execute a search and note that the default language is English.
3 - Observe that there are no options to modify the language globally, at the model level, or through method calls.
The text was updated successfully, but these errors were encountered:
However, this functionality is not clearly documented, which may lead to confusion and incorrect interpretations about the lack of support.
That said, I believe it would still be valuable to explore and document additional functionalities, such as global configurations or support within the method, to provide more flexibility in Laravel Scout. By keeping this issue open, I hope it serves as a proposal for these improvements and highlights the need for better documentation in Laravel Scout.
Scout Version
10.14
Scout Driver
Database
Laravel Version
12.0
PHP Version
8.4.4
Database Driver & Version
Postgres 17
SDK Version
No response
Meilisearch CLI Version
No response
Description
Currently, when using PostgreSQL as the index for full-text search with Laravel Scout, the default language is set to English with no built-in way to modify it. This limitation restricts the use of the driver in applications requiring multilingual support, reducing the flexibility of Laravel Scout in global scenarios.
Expected Behavior:
There should be support for configuring the default language, either globally or at the model level, to enable compatibility with multilingual applications.
Current Behavior:
The default language for full-text search is fixed to English, with no options for modification.
Impact of the Issue:
The lack of support limits the usage of Laravel Scout in contexts where multiple languages are required, making it harder for developers to adopt the framework in global environments.
Possible Solution:
Enhance Laravel Scout with additional configurations to allow custom language settings:
1 - Global Configuration: Add an option in the file
2 - Model-Level Configuration: Introduce a method in models for specifying the language.
3 - Method-Level Override: Provide an option to dynamically override the language when calling .
Steps to Reproduce:
1 - Set up PostgreSQL as the index for full-text search in Laravel Scout.
2 - Execute a search and note that the default language is English.
3 - Observe that there are no options to modify the language globally, at the model level, or through method calls.
Note:
I was unsure whether this should be categorized as a feature request or a bug. Since I couldn't submit it as a feature request, I am submitting it as a bug report instead. Apologies for any inconvenience this may cause.
Steps To Reproduce
1 - Set up PostgreSQL as the index for full-text search in Laravel Scout.
2 - Execute a search and note that the default language is English.
3 - Observe that there are no options to modify the language globally, at the model level, or through method calls.
The text was updated successfully, but these errors were encountered: