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
* 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.
112
+
* 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.
113
+
* 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.
* Order the entities by specified columns and orders. If the ID field is not included in the orderBy, it will be automatically included as the last orderBy field to ensure stable pagination.
177
+
* Pagination specification determining how to order and paginate results.
* The number of entities to return starting from the entity after the cursor (for forward pagination). Must be a positive integer.
190
+
* The number of entities to return starting from the entity after the cursor. Must be a positive integer.
106
191
*/
107
192
first: number;
108
193
109
194
/**
110
-
* The cursor to paginate after for forward pagination, typically an opaque string encoding of the values of the cursor fields of the last entity in the previous page. If not provided, pagination starts from the beginning of the result set.
195
+
* The cursor to paginate after for forward pagination.
* The number of entities to return starting from the entity before the cursor (for backward pagination). Must be a positive integer.
208
+
* The number of entities to return starting from the entity before the cursor. Must be a positive integer.
124
209
*/
125
210
last: number;
126
211
127
212
/**
128
-
* The cursor to paginate before for backward pagination, typically an opaque string encoding of the values of the cursor fields of the first entity in the previous page. If not provided, pagination starts from the end of the result set.
213
+
* The cursor to paginate before for backward pagination.
129
214
*/
130
215
before?: string;
131
216
}
132
217
133
218
/**
134
-
* Load page pagination arguments, which can be either forward or backward pagination arguments.
219
+
* Load page pagination arguments, which can be either forward or backward unified pagination arguments.
* Standard pagination with ORDER BY. Results are ordered by the specified orderBy fields, with ID field automatically included for stable pagination if not already present.
7
+
*/
8
+
STANDARD='standard',
9
+
10
+
/**
11
+
* Case-insensitive pattern matching search using SQL ILIKE operator.
12
+
* Results are ordered by the fields being searched within in the order specified, then by ID for tie-breaking and stable pagination.
13
+
*/
14
+
ILIKE_SEARCH='ilike-search',
15
+
16
+
/**
17
+
* 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.
18
+
*
19
+
* Performance considerations:
20
+
* - Trigram search can be significantly slower than ILIKE search, especially on large datasets without appropriate indexes.
21
+
* - Consider using ILIKE search for smaller datasets or when exact substring matching is sufficient
22
+
* - For larger datasets, ensure proper indexing or consider dedicated full-text search solutions.
23
+
* - For optimal performance, create GIN or GIST indexes on searchable columns:
24
+
* ```sql
25
+
* CREATE EXTENSION IF NOT EXISTS pg_trgm;
26
+
* CREATE INDEX idx_table_field_trigram ON table_name USING gin(field_name gin_trgm_ops);
27
+
* -- Or for multiple columns:
28
+
* CREATE INDEX idx_table_search ON table_name USING gin((field1 || ' ' || field2) gin_trgm_ops);
0 commit comments