I recently moved from meilisearch to typesense on my Laravel app working with scout.
I’ve done all my configuration of models and search queries.
I was using a local instance of typesense which allowed me to import 3000 documents and I tought it was a normal behavior because I was working in local.
Before deploying my app, I installed a docker instance of meilisearch on my server and made some tests.
When I try to import documents with php artisan scout:import 'Model'
, I’m stuck at 3000 when my env is in local mode and 150000 when on development and production mode.
Do someone know if there is a parameter to change on my Laravel, on the typesense instance or anything else to import more documents ?
Here is my docker-compose.yml (which is the most common one):
version: '3.5'
services:
typesense:
image: typesense/typesense:27.0.rc21
environment:
TYPESENSE_DATA_DIR: /data
TYPESENSE_API_KEY: myKey
volumes:
- /tmp/typesense-server-data:/data
ports:
- 8108:8108
restart: 'always'
My scout config :
SCOUT_DRIVER=typesense
TYPESENSE_API_KEY=myKey
TYPESENSE_HOST=typesense.my-domain.com
TYPESENSE_PROTOCOL=https
TYPESENSE_PORT=443
And my scout model config :
'typesense' => [
'client-settings' => [
'api_key' => env('TYPESENSE_API_KEY', 'xyz'),
'nodes' => [
[
'host' => env('TYPESENSE_HOST', 'localhost'),
'port' => env('TYPESENSE_PORT', '8108'),
'path' => env('TYPESENSE_PATH', ''),
'protocol' => env('TYPESENSE_PROTOCOL', 'http'),
],
],
'enable_nested_fields' => true,
'nearest_node' => [
'host' => env('TYPESENSE_HOST', 'localhost'),
'port' => env('TYPESENSE_PORT', '8108'),
'path' => env('TYPESENSE_PATH', ''),
'protocol' => env('TYPESENSE_PROTOCOL', 'http'),
],
'connection_timeout_seconds' => env('TYPESENSE_CONNECTION_TIMEOUT_SECONDS', 2),
'healthcheck_interval_seconds' => env('TYPESENSE_HEALTHCHECK_INTERVAL_SECONDS', 30),
'num_retries' => env('TYPESENSE_NUM_RETRIES', 3),
'retry_interval_seconds' => env('TYPESENSE_RETRY_INTERVAL_SECONDS', 1),
],
'model-settings' => [
Url::class => [
'collection-schema' => [
'enable_nested_fields' => true,
'fields' => [
[
'name' => 'id',
'type' => 'string',
],
[
'name' => 'url',
'type' => 'string',
],
[
'name' => 'keywords',
'type' => 'object[]',
'fields' => [
[
'name' => 'id',
'type' => 'int32',
],
[
'name' => 'keyword',
'type' => 'string',
'sort' => true
],
[
'name' => 'volume',
'type' => 'int32',
],
[
'name' => 'position',
'type' => 'int32',
]
]
]
]
],
'search-parameters' => [
'query_by' => 'keywords.keyword'
],
],
],
],