aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/search/SearchBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/search/SearchBox.tsx')
-rw-r--r--src/client/views/search/SearchBox.tsx54
1 files changed, 27 insertions, 27 deletions
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<SearchBoxProps>() {
@observable _searchString = '';
@observable _docTypeString = 'all';
@observable _results: Map<Doc, string[]> = new Map<Doc, string[]>();
- @observable _recommendations: IRecommendation[] = [];
+ // @observable _recommendations: IRecommendation[] = [];
@observable _pageRanks: Map<Doc, number> = new Map<Doc, number>();
@observable _linkedDocsOut: Map<Doc, Set<Doc>> = new Map<Doc, Set<Doc>>();
@observable _linkedDocsIn: Map<Doc, Set<Doc>> = new Map<Doc, Set<Doc>>();
@@ -375,29 +375,29 @@ export class SearchBox extends ViewBoxBaseComponent<SearchBoxProps>() {
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<SearchBoxProps>() {
});
// eslint-disable-next-line react/jsx-props-no-spreading
- const recommendationsJSX: JSX.Element[] = this._recommendations.map(props => <Recommendation {...props} />);
+ const recommendationsJSX: JSX.Element[] = []; // this._recommendations.map(props => <Recommendation {...props} />);
return (
<div className="searchBox-container" style={{ pointerEvents: 'all', color: SnappingManager.userColor, background: SnappingManager.userBackgroundColor }}>