OptionalextraOptional additional fields to order by after similarity score and before ID for tie-breaking. These fields are independent of search fields and can be used to provide meaningful ordering when multiple results have the same similarity score.
The fields to search within.
Similarity search using PostgreSQL trigram similarity. Results are ordered by exact match priority, then by similarity score, then by specified extra order by fields if provided, then by ID for tie-breaking and stable pagination. Note that trigram similarity search can be significantly slower than ILIKE search, especially on large datasets without appropriate indexes, and results may not be as relevant as more advanced full-text search solutions. It is recommended to use this strategy only when ILIKE search does not meet the application's needs and to ensure appropriate database indexing for performance.
The search term to search for. Must be a non-empty string.
Similarity threshold for trigram matching. Must be between 0 and 1, where:
Recommended threshold values:
Search specification for similarity search using PostgreSQL trigram similarity.