1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-13 16:49:07 +00:00
bramw_baserow/web-frontend/modules/database/utils/search.js
2023-08-07 11:29:29 +00:00

16 lines
683 B
JavaScript

export const SearchModes = {
// Use this mode to search rows using LIKE operators against each
// field type, and return an accurate `count` in the response.
// This method is slow after a few thousand rows and dozens of fields.
MODE_COMPAT: 'compat',
// Use this mode to search rows using Postgres full-text search against
// each field type, and provide a `count` in the response. This
// method is much faster as tables grow in size.
MODE_FT_WITH_COUNT: 'full-text-with-count',
}
export function getDefaultSearchModeFromEnv($config) {
return $config.BASEROW_USE_PG_FULLTEXT_SEARCH === 'true'
? SearchModes.MODE_FT_WITH_COUNT
: SearchModes.MODE_COMPAT
}