From e87f8f5113756b188feb3de1fc6f9697a4c91b51 Mon Sep 17 00:00:00 2001
From: Andy Rickert <andrew_rickert@brown.edu>
Date: Mon, 3 Aug 2020 19:46:09 -0400
Subject: pdf search

---
 src/client/views/search/SearchBox.tsx | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'src/client/views/search/SearchBox.tsx')

diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx
index 09fbe383c..de6fff5d2 100644
--- a/src/client/views/search/SearchBox.tsx
+++ b/src/client/views/search/SearchBox.tsx
@@ -195,6 +195,7 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc
             console.log(this._results);
             this._results.forEach(result => {
                 Doc.UnBrushDoc(result[0]);
+                result[0].searchMatch = undefined;
             });
 
             this.props.Document._schemaHeaders = new List<SchemaHeaderField>([]);
@@ -493,15 +494,18 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc
         }
         this.props.Document._docFilters = undefined;
         this.noresults = "";
+
         this.dataDoc[this.fieldKey] = new List<Doc>([]);
         this.headercount = 0;
         this.children = 0;
         this.buckets = [];
         this.new_buckets = {};
         const query = StrCast(this.layoutDoc._searchString);
+        Doc.SetSearchQuery(query);
         this.getFinalQuery(query);
         this._results.forEach(result => {
             Doc.UnBrushDoc(result[0]);
+            result[0].searchMatch = undefined;
         });
         this._results = [];
         this._resultsSet.clear();
@@ -758,6 +762,7 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc
                             this._visibleDocuments[i] = result[0];
                             this._isSearch[i] = "search";
                             Doc.BrushDoc(result[0]);
+                            result[0].searchMatch = true;
                             Doc.AddDocToList(this.dataDoc, this.props.fieldKey, result[0]);
                             this.children++;
                         }
@@ -771,6 +776,7 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc
                             console.log(lines);
                             result[0].lines = lines;
                             result[0].highlighting = highlights.join(", ");
+                            result[0].searchMatch = true;
                             if (i < this._visibleDocuments.length) {
                                 this._visibleDocuments[i] = result[0];
                                 this._isSearch[i] = "search";
-- 
cgit v1.2.3-70-g09d2

