From f14b574527436ba0d3db7cbe99369e0a8ccff93c Mon Sep 17 00:00:00 2001 From: asier-isayas Date: Tue, 20 May 2025 10:49:09 -0400 Subject: [PATCH] Enable Full Text Search on all NoSQL accounts (#2157) * Enable Full Text Search on all NoSQL accounts * format * fix tests * run tests --------- Co-authored-by: Asier Isayas --- .../Controls/Settings/SettingsComponent.tsx | 4 +- .../SettingsComponent.test.tsx.snap | 26 +++++++++++++ .../AddCollectionPanel/AddCollectionPanel.tsx | 18 +++------ .../AddCollectionPanel.test.tsx.snap | 38 +++++++++++++++++++ .../AddGlobalSecondaryIndexPanel.tsx | 14 +++---- ...AddGlobalSecondaryIndexPanel.test.tsx.snap | 11 ++++++ src/Utils/CapabilityUtils.ts | 4 -- 7 files changed, 89 insertions(+), 26 deletions(-) diff --git a/src/Explorer/Controls/Settings/SettingsComponent.tsx b/src/Explorer/Controls/Settings/SettingsComponent.tsx index 3f286d822..29a85845c 100644 --- a/src/Explorer/Controls/Settings/SettingsComponent.tsx +++ b/src/Explorer/Controls/Settings/SettingsComponent.tsx @@ -13,7 +13,7 @@ import { } from "Explorer/Controls/Settings/SettingsSubComponents/ThroughputInputComponents/ThroughputBucketsComponent"; import { useDatabases } from "Explorer/useDatabases"; import { isFabricNative } from "Platform/Fabric/FabricUtil"; -import { isFullTextSearchEnabled, isVectorSearchEnabled } from "Utils/CapabilityUtils"; +import { isVectorSearchEnabled } from "Utils/CapabilityUtils"; import { isRunningOnPublicCloud } from "Utils/CloudUtils"; import * as React from "react"; import DiscardIcon from "../../../../images/discard.svg"; @@ -188,7 +188,7 @@ export class SettingsComponent extends React.Component + + + )} - {this.shouldShowFullTextSearchParameters() && ( + {this.showFullTextSearch && ( + + + + + + + + + (); const [isExecuting, setIsExecuting] = useState(); + const showFullTextSearch: MutableRefObject = useRef(userContext.apiType === "SQL"); + useEffect(() => { const sourceContainerOptions: IDropdownOption[] = []; useDatabases.getState().databases.forEach((database: Database) => { @@ -140,10 +142,6 @@ export const AddGlobalSecondaryIndexPanel = (props: AddGlobalSecondaryIndexPanel return isVectorSearchEnabled() && (isServerlessAccount() || showCollectionThroughputInput()); }; - const showFullTextSearchParameters = (): boolean => { - return isFullTextSearchEnabled() && (isServerlessAccount() || showCollectionThroughputInput()); - }; - const getAnalyticalStorageTtl = (): number => { if (!isSynapseLinkEnabled()) { return undefined; @@ -228,7 +226,7 @@ export const AddGlobalSecondaryIndexPanel = (props: AddGlobalSecondaryIndexPanel }; } - if (showFullTextSearchParameters()) { + if (showFullTextSearch) { indexingPolicy.fullTextIndexes = fullTextIndexes; } @@ -387,7 +385,7 @@ export const AddGlobalSecondaryIndexPanel = (props: AddGlobalSecondaryIndexPanel }} /> )} - {showFullTextSearchParameters() && ( + {showFullTextSearch && ( diff --git a/src/Explorer/Panes/AddGlobalSecondaryIndexPanel/__snapshots__/AddGlobalSecondaryIndexPanel.test.tsx.snap b/src/Explorer/Panes/AddGlobalSecondaryIndexPanel/__snapshots__/AddGlobalSecondaryIndexPanel.test.tsx.snap index cef30c445..dcc3834b1 100644 --- a/src/Explorer/Panes/AddGlobalSecondaryIndexPanel/__snapshots__/AddGlobalSecondaryIndexPanel.test.tsx.snap +++ b/src/Explorer/Panes/AddGlobalSecondaryIndexPanel/__snapshots__/AddGlobalSecondaryIndexPanel.test.tsx.snap @@ -172,6 +172,17 @@ exports[`AddGlobalSecondaryIndexPanel render default panel 1`] = ` } setEnableAnalyticalStore={[Function]} /> + { export const isVectorSearchEnabled = (): boolean => { return userContext.apiType === "SQL" && isCapabilityEnabled(Constants.CapabilityNames.EnableNoSQLVectorSearch); }; - -export const isFullTextSearchEnabled = (): boolean => { - return userContext.apiType === "SQL" && isCapabilityEnabled(Constants.CapabilityNames.EnableNoSQLFullTextSearch); -};