SearchFn
Operations

Troubleshooting

Diagnose and resolve common SearchFn errors with error codes and backend-specific playbooks.

Error Reference

Error CodeCauseResolution
DFQL_INVALIDInvalid request shape, missing required fields, or empty query stringValidate the request payload before sending. Check that resource, query, and documents fields are present and correctly typed.
LIMIT_EXCEEDEDQuery length, result limit, resource count, or batch size exceeds configured maximumsReduce the request size or increase server limits in the limits configuration.
DFQL_ABORTEDThe caller aborted the request via AbortSignalExpected behavior when users cancel searches. Retry from the client when appropriate.
DFQL_UNSUPPORTEDAdapter does not support the requested operation or configurationCheck your adapter's capabilities. For Elasticsearch/OpenSearch, verify the engine value is "elasticsearch" or "opensearch".
FORBIDDENAuthorization callback denied the requestVerify the user's credentials and permissions. Check the authorize callback logic.
INTERNALUnexpected backend or runtime failureCheck the structured logs for details. Inspect backend health (database connectivity, service availability).

Common Issues

Search returns no results

  1. Verify that initialize() was called with the correct searchFields.
  2. Verify that documents were indexed with matching field names.
  3. Check that the resource name matches between index and search calls.
  4. Try disabling fuzzy to rule out fuzzy matching issues.

initialize not called

Calling index or search before initialize may cause unexpected behavior. Always call initialize() with your resource definitions before other operations.

Adapter disposed

Calling any method after dispose() throws SEARCH_ADAPTER_DISPOSED. Call initialize() again to reinitialize the adapter.

Backend Playbooks

Postgres

SymptomCheck
Connection timeoutsVerify connectionString and network access to the database
Slow queriesCheck that migration SQL was run (tables and indexes exist)
Missing resultsVerify the target schema matches your database setup
Retry exhaustionIncrease retry.maxRetries or retry.maxDelayMs

Meilisearch

SymptomCheck
FORBIDDEN errorsVerify the API key has the correct permissions (search, documents, indexes)
Missing resultsCheck the Meilisearch dashboard for index status and task queue
Timeout errorsVerify host is reachable and increase requestTimeoutMs if needed
Wrong resultsVerify indexPrefix matches across your adapter instances

Elasticsearch / OpenSearch

SymptomCheck
DFQL_UNSUPPORTEDVerify engine is set to "elasticsearch" or "opensearch"
Connection errorsVerify node URL and authentication credentials
Missing indexesEnsure initialize() was called to create indexes
Cluster healthCheck cluster status via /_cluster/health endpoint