From 5a76a77826e57f9d9a6437c6b0c7afad8358e4af Mon Sep 17 00:00:00 2001 From: saithsab877 Date: Wed, 9 Oct 2024 14:42:48 +0500 Subject: [PATCH 1/3] fix(search): add search method --- src/network/fetchGraphData/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/network/fetchGraphData/index.ts b/src/network/fetchGraphData/index.ts index d87d1c7a2..3be1ec36b 100644 --- a/src/network/fetchGraphData/index.ts +++ b/src/network/fetchGraphData/index.ts @@ -21,7 +21,11 @@ const fetchNodes = async ( signal: AbortSignal, setAbortRequests: (status: boolean) => void, ): Promise => { - const args = new URLSearchParams(params).toString() + const args = new URLSearchParams({ + ...params, + search_method: 'vector', + }).toString() + const url = isLatest ? `/prediction/graph/search/latest?` : `/prediction/graph/search?${args}` const fetchWithLSAT = async (): Promise => { From 1f49651e60c2e4d1b772d0a9ce4c599870f95996 Mon Sep 17 00:00:00 2001 From: saithsab877 Date: Wed, 9 Oct 2024 18:43:19 +0500 Subject: [PATCH 2/3] fix(search): add search method --- src/network/fetchGraphData/index.ts | 6 +----- src/stores/useDataStore/index.ts | 2 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/network/fetchGraphData/index.ts b/src/network/fetchGraphData/index.ts index 3be1ec36b..d87d1c7a2 100644 --- a/src/network/fetchGraphData/index.ts +++ b/src/network/fetchGraphData/index.ts @@ -21,11 +21,7 @@ const fetchNodes = async ( signal: AbortSignal, setAbortRequests: (status: boolean) => void, ): Promise => { - const args = new URLSearchParams({ - ...params, - search_method: 'vector', - }).toString() - + const args = new URLSearchParams(params).toString() const url = isLatest ? `/prediction/graph/search/latest?` : `/prediction/graph/search?${args}` const fetchWithLSAT = async (): Promise => { diff --git a/src/stores/useDataStore/index.ts b/src/stores/useDataStore/index.ts index f1491c6f1..893eca4b3 100644 --- a/src/stores/useDataStore/index.ts +++ b/src/stores/useDataStore/index.ts @@ -132,6 +132,7 @@ const defaultData: Omit< top_node_count: '50', includeContent: 'true', node_type: [], + search_method: 'vector', }, isFetching: false, isLoadingNew: false, @@ -200,6 +201,7 @@ export const useDataStore = create()( ...(filterNodeTypes.length > 0 ? { node_type: JSON.stringify(filterNodeTypes) } : {}), ...(word ? { word } : {}), ...(aiRefId && AISearchQuery ? { previous_search_ref_id: aiRefId } : {}), + search_method: 'vector', } try { From 476ce330ad64325f1d6df22fe3689e73f44bd4ff Mon Sep 17 00:00:00 2001 From: saithsab877 Date: Thu, 17 Oct 2024 16:31:35 +0500 Subject: [PATCH 3/3] fix(search): add search method --- src/stores/useDataStore/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/stores/useDataStore/index.ts b/src/stores/useDataStore/index.ts index 893eca4b3..2ee1201ee 100644 --- a/src/stores/useDataStore/index.ts +++ b/src/stores/useDataStore/index.ts @@ -201,7 +201,6 @@ export const useDataStore = create()( ...(filterNodeTypes.length > 0 ? { node_type: JSON.stringify(filterNodeTypes) } : {}), ...(word ? { word } : {}), ...(aiRefId && AISearchQuery ? { previous_search_ref_id: aiRefId } : {}), - search_method: 'vector', } try {