From b858bd3cad81da41e63b9f8e807e41421ca4aa34 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 8 May 2024 21:03:08 -0400 Subject: lots of api cleanup and cycle removal --- src/client/views/search/SearchBox.tsx | 54 +++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'src/client/views/search') diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index 56552c952..ae0838dd5 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -18,8 +18,8 @@ import { undoBatch } from '../../util/UndoManager'; import { ViewBoxBaseComponent } from '../DocComponent'; import { ObservableReactComponent } from '../ObservableReactComponent'; import { CollectionDockingView } from '../collections/CollectionDockingView'; -import { IRecommendation, Recommendation } from '../newlightbox/components'; -import { fetchRecommendations } from '../newlightbox/utils'; +// import { IRecommendation, Recommendation } from '../newlightbox/components'; +// import { fetchRecommendations } from '../newlightbox/utils'; import { DocumentView } from '../nodes/DocumentView'; import { FieldView, FieldViewProps } from '../nodes/FieldView'; import './SearchBox.scss'; @@ -142,7 +142,7 @@ export class SearchBox extends ViewBoxBaseComponent() { @observable _searchString = ''; @observable _docTypeString = 'all'; @observable _results: Map = new Map(); - @observable _recommendations: IRecommendation[] = []; + // @observable _recommendations: IRecommendation[] = []; @observable _pageRanks: Map = new Map(); @observable _linkedDocsOut: Map> = new Map>(); @observable _linkedDocsIn: Map> = new Map>(); @@ -375,29 +375,29 @@ export class SearchBox extends ViewBoxBaseComponent() { if (query) { this.searchCollection(query); - const response = await fetchRecommendations('', query, [], true); - const recs = response.recommendations as any[]; - const recommendations: IRecommendation[] = []; - recs.forEach(rec => { - const { title, url, type, text, transcript, previewUrl, embedding, distance, source, related_concepts: relatedConcepts, doc_id: docId } = rec; - recommendations.push({ - title, - data: url, - type, - text, - transcript, - previewUrl, - embedding, - distance: Math.round(distance * 100) / 100, - source: source, - related_concepts: relatedConcepts, - docId, - }); - }); - const setRecommendations = action(() => { - this._recommendations = recommendations; - }); - setRecommendations(); + // const response = await fetchRecommendations('', query, [], true); + // const recs = response.recommendations as any[]; + // const recommendations: IRecommendation[] = []; + // recs.forEach(rec => { + // const { title, url, type, text, transcript, previewUrl, embedding, distance, source, related_concepts: relatedConcepts, doc_id: docId } = rec; + // recommendations.push({ + // title, + // data: url, + // type, + // text, + // transcript, + // previewUrl, + // embedding, + // distance: Math.round(distance * 100) / 100, + // source: source, + // related_concepts: relatedConcepts, + // docId, + // }); + // }); + // const setRecommendations = action(() => { + // this._recommendations = recommendations; + // }); + // setRecommendations(); } }; @@ -470,7 +470,7 @@ export class SearchBox extends ViewBoxBaseComponent() { }); // eslint-disable-next-line react/jsx-props-no-spreading - const recommendationsJSX: JSX.Element[] = this._recommendations.map(props => ); + const recommendationsJSX: JSX.Element[] = []; // this._recommendations.map(props => ); return (
-- cgit v1.2.3-70-g09d2