From c759d7b63a46a102293f3052ed522f377d82e583 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 12 Jun 2024 15:13:50 +0100 Subject: [PATCH] Remove more instances of the work lucene. --- packages/account-portal | 2 +- .../backend/DataTable/modals/ExportModal.svelte | 4 ++-- packages/frontend-core/src/fetch/DataFetch.js | 8 ++++---- packages/server/src/integrations/googlesheets.ts | 2 +- packages/shared-core/src/filters.ts | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/account-portal b/packages/account-portal index 247f56d455..a03225549e 160000 --- a/packages/account-portal +++ b/packages/account-portal @@ -1 +1 @@ -Subproject commit 247f56d455abbd64da17d865275ed978f577549f +Subproject commit a03225549e3ce61f43d0da878da162e08941b939 diff --git a/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte b/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte index 52e23b9a37..2a31f5c452 100644 --- a/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte @@ -49,7 +49,7 @@ exportFormat = Array.isArray(options) ? options[0]?.key : [] } - $: luceneFilter = QueryUtils.buildQuery(appliedFilters) + $: query = QueryUtils.buildQuery(appliedFilters) $: exportOpDisplay = buildExportOpDisplay( sorting, filterDisplay, @@ -139,7 +139,7 @@ tableId: view, format: exportFormat, search: { - query: luceneFilter, + query, sort: sorting?.sortColumn, sortOrder: sorting?.sortOrder, paginate: false, diff --git a/packages/frontend-core/src/fetch/DataFetch.js b/packages/frontend-core/src/fetch/DataFetch.js index e9601af3d0..dedd06264c 100644 --- a/packages/frontend-core/src/fetch/DataFetch.js +++ b/packages/frontend-core/src/fetch/DataFetch.js @@ -3,7 +3,7 @@ import { cloneDeep } from "lodash/fp" import { QueryUtils } from "../utils" import { convertJSONSchemaToTableSchema } from "../utils/json" -const { buildQuery, luceneLimit, runQuery, luceneSort } = QueryUtils +const { buildQuery, limit: queryLimit, runQuery, sort } = QueryUtils /** * Parent class which handles the implementation of fetching data from an @@ -176,7 +176,7 @@ export default class DataFetch { } } - // Build the lucene query + // Build the query let query = this.options.query if (!query) { query = buildQuery(filter) @@ -233,12 +233,12 @@ export default class DataFetch { // If we don't support sorting, do a client-side sort if (!this.features.supportsSort && clientSideSorting) { - rows = luceneSort(rows, sortColumn, sortOrder, sortType) + rows = sort(rows, sortColumn, sortOrder, sortType) } // If we don't support pagination, do a client-side limit if (!this.features.supportsPagination && clientSideLimiting) { - rows = luceneLimit(rows, limit) + rows = queryLimit(rows, limit) } return { diff --git a/packages/server/src/integrations/googlesheets.ts b/packages/server/src/integrations/googlesheets.ts index 593f3ef891..d02d646fa4 100644 --- a/packages/server/src/integrations/googlesheets.ts +++ b/packages/server/src/integrations/googlesheets.ts @@ -585,7 +585,7 @@ class GoogleSheetsIntegration implements DatasourcePlus { }) } const [sortField, sortInfo] = Object.entries(query.sort)[0] - response = dataFilters.luceneSort( + response = dataFilters.sort( response, sortField, sortInfo.direction, diff --git a/packages/shared-core/src/filters.ts b/packages/shared-core/src/filters.ts index 9b4cf86ed4..f714f1cef6 100644 --- a/packages/shared-core/src/filters.ts +++ b/packages/shared-core/src/filters.ts @@ -451,7 +451,7 @@ export const runQuery = (docs: any[], query?: SearchFilters) => { * @param sortOrder the sort order ("ascending" or "descending") * @param sortType the type of sort ("string" or "number") */ -export const luceneSort = ( +export const sort = ( docs: any[], sort: string, sortOrder: SortDirection, @@ -481,7 +481,7 @@ export const luceneSort = ( * @param docs the data * @param limit the number of docs to limit to */ -export const luceneLimit = (docs: any[], limit: string) => { +export const limit = (docs: any[], limit: string) => { const numLimit = parseFloat(limit) if (isNaN(numLimit)) { return docs