1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-28 06:22:24 +00:00
bramw_baserow/web-frontend/modules/database/utils/search.js
2023-07-05 16:01:03 +00:00

16 lines
677 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($env) {
return $env.BASEROW_USE_PG_FULLTEXT_SEARCH === 'true'
? SearchModes.MODE_FT_WITH_COUNT
: SearchModes.MODE_COMPAT
}