From c386e1116539f6c3b36360b4c7dd85951d5985f0 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Sat, 15 Aug 2020 10:24:53 -0400
Subject: fixed searchBox layout to show drag icon

---
 src/client/views/search/SearchBox.tsx | 293 +++++++++++++++++-----------------
 1 file changed, 147 insertions(+), 146 deletions(-)

(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 084449d04..dbc30eeb6 100644
--- a/src/client/views/search/SearchBox.tsx
+++ b/src/client/views/search/SearchBox.tsx
@@ -872,163 +872,164 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc
         height = 31 + 31 * 6;
         return (
             <div style={{ pointerEvents: "all" }} className="searchBox-container">
+                <div style={{ position: "absolute", left: 15, height: 32, alignItems: "center", display: "flex" }}>{Doc.CurrentUserEmail}</div>
                 <div className="searchBox-bar">
-                    <div style={{ position: "absolute", left: 15 }}>{Doc.CurrentUserEmail}</div>
-                    <div style={{ display: "flex", alignItems: "center" }}>
-                        <Tooltip title={<div className="dash-tooltip" >drag search results as collection</div>} ><div>
-                            <FontAwesomeIcon onPointerDown={SetupDrag(this.collectionRef, () => StrCast(this.layoutDoc._searchString) ? this.startDragCollection() : undefined)} icon={"search"} size="lg"
-                                style={{ cursor: "hand", color: "black", padding: 1, left: 35, position: "relative" }} />
-                        </div></Tooltip>
-                        <div style={{
-                            position: "relative",
-                            left: 245,
-                            zIndex: 9000,
-                            color: "grey",
-                            background: "white",
-                        }}> {`${this._results.length}` + " of " + `${this.realTotalResults}`}</div>
-                        <div style={{ cursor: "default", left: 250, position: "relative", }}>
-                            <Tooltip title={<div className="dash-tooltip" >only display documents matching search</div>} ><div>
-                                <FontAwesomeIcon icon={"filter"} size="lg"
-                                    style={{ cursor: "hand", padding: 1, backgroundColor: this.filter ? "white" : "lightgray", color: this.filter ? "black" : "white" }}
-                                    onPointerDown={e => { e.stopPropagation(); SetupDrag(this.collectionRef, () => StrCast(this.layoutDoc._searchString) ? this.startDragCollection() : undefined); }}
-                                    onClick={action(() => {
-                                        ///DONT Change without emailing andy r first.
-                                        this.filter = !this.filter && !this.searchFullDB;
-                                        if (this.filter === true && this.currentSelectedCollection !== undefined) {
-                                            this.currentSelectedCollection.props.Document._searchDocs = new List<Doc>(this.docsforfilter);
-                                            let newarray: Doc[] = [];
-                                            let docs: Doc[] = [];
-                                            docs = DocListCast(this.currentSelectedCollection.dataDoc[Doc.LayoutFieldKey(this.currentSelectedCollection.dataDoc)]);
-                                            while (docs.length > 0) {
-                                                newarray = [];
-                                                docs.forEach((d) => {
-                                                    if (d.data !== undefined) {
-                                                        d._searchDocs = new List<Doc>(this.docsforfilter);
-                                                        const newdocs = DocListCast(d.data);
-                                                        newdocs.forEach((newdoc) => {
-                                                            newarray.push(newdoc);
-                                                        });
-                                                    }
-                                                });
-                                                docs = newarray;
-                                            }
-
-                                            this.currentSelectedCollection.props.Document._docFilters = new List<string>(this.viewspec);
-                                            this.props.Document.selectedDoc = this.currentSelectedCollection.props.Document;
-                                        }
-                                        else if (this.filter === false && this.currentSelectedCollection !== undefined) {
-                                            let newarray: Doc[] = [];
-                                            let docs: Doc[] = [];
-                                            docs = DocListCast(this.currentSelectedCollection.dataDoc[Doc.LayoutFieldKey(this.currentSelectedCollection.dataDoc)]);
-                                            while (docs.length > 0) {
-                                                newarray = [];
-                                                docs.forEach((d) => {
-                                                    if (d.data !== undefined) {
-                                                        d._searchDocs = new List<Doc>();
-                                                        d._docFilters = new List();
-                                                        const newdocs = DocListCast(d.data);
-                                                        newdocs.forEach((newdoc) => {
-                                                            newarray.push(newdoc);
-                                                        });
-                                                    }
-                                                });
-                                                docs = newarray;
-                                            }
-
-                                            this.currentSelectedCollection.props.Document._searchDocs = new List<Doc>([]);
-                                            this.currentSelectedCollection.props.Document._docFilters = new List();
-                                            this.props.Document.selectedDoc = undefined;
-                                        }
-                                    }
-                                    )} />
-                            </div></Tooltip></div>
+                    <div style={{ position: "relative", display: "flex", width: 400 }}>
                         <input value={this.newsearchstring} autoComplete="off" onChange={this.onChange} type="text" placeholder="Search..." id="search-input" ref={this.inputRef}
                             className="searchBox-barChild searchBox-input" onPointerDown={this.openSearch} onKeyPress={this.enter} onFocus={this.openSearch}
                             style={{ padding: 1, paddingLeft: 20, paddingRight: 20, color: "black", height: 20, width: 250 }} />
-                        <div style={{
-                            height: 25,
-                            paddingLeft: "4px",
-                            paddingRight: "4px",
-                            border: "1px solid gray",
-                            borderRadius: "0.3em",
-                            borderBottom: this.open === false ? "1px solid" : "none",
-                        }}>
-                            <form className="beta" style={{ justifyContent: "space-evenly", display: "flex" }}>
-                                <div style={{ display: "contents" }}>
-                                    <div className="radio" style={{ margin: 0 }}>
-                                        <label style={{ fontSize: 12, marginTop: 6 }} >
-                                            <input type="radio" style={{ marginLeft: -16, marginTop: -1 }} checked={!this.searchFullDB} onChange={() => {
-                                                runInAction(() => {
-                                                    this.searchFullDB = !this.searchFullDB;
-                                                    this.dataDoc[this.fieldKey] = new List<Doc>([]);
-                                                    if (this.currentSelectedCollection !== undefined) {
-                                                        let newarray: Doc[] = [];
-                                                        let docs: Doc[] = [];
-                                                        docs = DocListCast(this.currentSelectedCollection.dataDoc[Doc.LayoutFieldKey(this.currentSelectedCollection.dataDoc)]);
-                                                        while (docs.length > 0) {
-                                                            newarray = [];
-                                                            docs.forEach((d) => {
-                                                                if (d.data !== undefined) {
-                                                                    d._searchDocs = new List<Doc>();
-                                                                    d._docFilters = new List();
-                                                                    const newdocs = DocListCast(d.data);
-                                                                    newdocs.forEach((newdoc) => {
-                                                                        newarray.push(newdoc);
-                                                                    });
-                                                                }
+                        <div style={{ display: "flex", alignItems: "center" }}>
+                            <div style={{ position: "absolute", left: 10 }}>
+                                <Tooltip title={<div className="dash-tooltip" >drag search results as collection</div>}>
+                                    <div><FontAwesomeIcon onPointerDown={SetupDrag(this.collectionRef, () => StrCast(this.layoutDoc._searchString) ? this.startDragCollection() : undefined)} icon={"search"} size="lg"
+                                        style={{ cursor: "hand", color: "black", padding: 1, position: "relative" }} /></div>
+                                </Tooltip>
+                            </div>
+                            <div style={{ position: "absolute", left: 200, width: 30, zIndex: 9000, color: "grey", background: "white", }}>
+                                {`${this._results.length}` + " of " + `${this.realTotalResults}`}
+                            </div>
+                            <div style={{ cursor: "default", left: 235, position: "absolute", }}>
+                                <Tooltip title={<div className="dash-tooltip" >only display documents matching search</div>} >
+                                    <div><FontAwesomeIcon icon={"filter"} size="lg"
+                                        style={{ cursor: "hand", padding: 1, backgroundColor: this.filter ? "white" : "lightgray", color: this.filter ? "black" : "white" }}
+                                        onPointerDown={e => { e.stopPropagation(); SetupDrag(this.collectionRef, () => StrCast(this.layoutDoc._searchString) ? this.startDragCollection() : undefined); }}
+                                        onClick={action(() => {
+                                            ///DONT Change without emailing andy r first.
+                                            this.filter = !this.filter && !this.searchFullDB;
+                                            if (this.filter === true && this.currentSelectedCollection !== undefined) {
+                                                this.currentSelectedCollection.props.Document._searchDocs = new List<Doc>(this.docsforfilter);
+                                                let newarray: Doc[] = [];
+                                                let docs: Doc[] = [];
+                                                docs = DocListCast(this.currentSelectedCollection.dataDoc[Doc.LayoutFieldKey(this.currentSelectedCollection.dataDoc)]);
+                                                while (docs.length > 0) {
+                                                    newarray = [];
+                                                    docs.forEach((d) => {
+                                                        if (d.data !== undefined) {
+                                                            d._searchDocs = new List<Doc>(this.docsforfilter);
+                                                            const newdocs = DocListCast(d.data);
+                                                            newdocs.forEach((newdoc) => {
+                                                                newarray.push(newdoc);
                                                             });
-                                                            docs = newarray;
                                                         }
-                                                        this.currentSelectedCollection.props.Document._docFilters = new List();
-                                                        this.currentSelectedCollection.props.Document._searchDocs = undefined;
-                                                        this.currentSelectedCollection = undefined;
-                                                    }
-                                                    this.submitSearch();
-                                                });
-                                            }} />
-                                        Collection
-                                    </label>
-                                    </div>
-                                    <div className="radio" style={{ margin: 0 }}>
-                                        <label style={{ fontSize: 12, marginTop: 6 }} >
-                                            <input style={{ marginLeft: -16, marginTop: -1 }} type="radio" checked={this.searchFullDB} onChange={() => {
-                                                runInAction(() => {
-                                                    this.searchFullDB = !this.searchFullDB;
-                                                    this.dataDoc[this.fieldKey] = new List<Doc>([]);
-                                                    this.filter = false;
-                                                    if (this.currentSelectedCollection !== undefined) {
-                                                        let newarray: Doc[] = [];
-                                                        let docs: Doc[] = [];
-                                                        docs = DocListCast(this.currentSelectedCollection.dataDoc[Doc.LayoutFieldKey(this.currentSelectedCollection.dataDoc)]);
-                                                        while (docs.length > 0) {
-                                                            newarray = [];
-                                                            docs.forEach((d) => {
-                                                                if (d.data !== undefined) {
-                                                                    d._searchDocs = new List<Doc>();
-                                                                    d._docFilters = new List();
-                                                                    const newdocs = DocListCast(d.data);
-                                                                    newdocs.forEach((newdoc) => {
-                                                                        newarray.push(newdoc);
-                                                                    });
-                                                                }
+                                                    });
+                                                    docs = newarray;
+                                                }
+
+                                                this.currentSelectedCollection.props.Document._docFilters = new List<string>(this.viewspec);
+                                                this.props.Document.selectedDoc = this.currentSelectedCollection.props.Document;
+                                            }
+                                            else if (this.filter === false && this.currentSelectedCollection !== undefined) {
+                                                let newarray: Doc[] = [];
+                                                let docs: Doc[] = [];
+                                                docs = DocListCast(this.currentSelectedCollection.dataDoc[Doc.LayoutFieldKey(this.currentSelectedCollection.dataDoc)]);
+                                                while (docs.length > 0) {
+                                                    newarray = [];
+                                                    docs.forEach((d) => {
+                                                        if (d.data !== undefined) {
+                                                            d._searchDocs = new List<Doc>();
+                                                            d._docFilters = new List();
+                                                            const newdocs = DocListCast(d.data);
+                                                            newdocs.forEach((newdoc) => {
+                                                                newarray.push(newdoc);
                                                             });
-                                                            docs = newarray;
                                                         }
-                                                        this.currentSelectedCollection.props.Document._docFilters = new List();
-                                                        this.currentSelectedCollection.props.Document._searchDocs = undefined;
-                                                        this.currentSelectedCollection = undefined;
-                                                    }
-                                                    this.submitSearch();
-                                                });
-                                            }} />
-                                            DB
-                                    </label>
+                                                    });
+                                                    docs = newarray;
+                                                }
+
+                                                this.currentSelectedCollection.props.Document._searchDocs = new List<Doc>([]);
+                                                this.currentSelectedCollection.props.Document._docFilters = new List();
+                                                this.props.Document.selectedDoc = undefined;
+                                            }
+                                        }
+                                        )} /></div>
+                                </Tooltip>
+                            </div>
+                            <div style={{
+                                height: 25,
+                                paddingLeft: "4px",
+                                paddingRight: "4px",
+                                border: "1px solid gray",
+                                borderRadius: "0.3em",
+                                borderBottom: this.open === false ? "1px solid" : "none",
+                            }}>
+                                <form className="beta" style={{ justifyContent: "space-evenly", display: "flex" }}>
+                                    <div style={{ display: "contents" }}>
+                                        <div className="radio" style={{ margin: 0 }}>
+                                            <label style={{ fontSize: 12, marginTop: 6 }} >
+                                                <input type="radio" style={{ marginLeft: -16, marginTop: -1 }} checked={!this.searchFullDB} onChange={() => {
+                                                    runInAction(() => {
+                                                        this.searchFullDB = !this.searchFullDB;
+                                                        this.dataDoc[this.fieldKey] = new List<Doc>([]);
+                                                        if (this.currentSelectedCollection !== undefined) {
+                                                            let newarray: Doc[] = [];
+                                                            let docs: Doc[] = [];
+                                                            docs = DocListCast(this.currentSelectedCollection.dataDoc[Doc.LayoutFieldKey(this.currentSelectedCollection.dataDoc)]);
+                                                            while (docs.length > 0) {
+                                                                newarray = [];
+                                                                docs.forEach((d) => {
+                                                                    if (d.data !== undefined) {
+                                                                        d._searchDocs = new List<Doc>();
+                                                                        d._docFilters = new List();
+                                                                        const newdocs = DocListCast(d.data);
+                                                                        newdocs.forEach((newdoc) => {
+                                                                            newarray.push(newdoc);
+                                                                        });
+                                                                    }
+                                                                });
+                                                                docs = newarray;
+                                                            }
+                                                            this.currentSelectedCollection.props.Document._docFilters = new List();
+                                                            this.currentSelectedCollection.props.Document._searchDocs = undefined;
+                                                            this.currentSelectedCollection = undefined;
+                                                        }
+                                                        this.submitSearch();
+                                                    });
+                                                }} />
+                                            Collection
+                                        </label>
+                                        </div>
+                                        <div className="radio" style={{ margin: 0 }}>
+                                            <label style={{ fontSize: 12, marginTop: 6 }} >
+                                                <input style={{ marginLeft: -16, marginTop: -1 }} type="radio" checked={this.searchFullDB} onChange={() => {
+                                                    runInAction(() => {
+                                                        this.searchFullDB = !this.searchFullDB;
+                                                        this.dataDoc[this.fieldKey] = new List<Doc>([]);
+                                                        this.filter = false;
+                                                        if (this.currentSelectedCollection !== undefined) {
+                                                            let newarray: Doc[] = [];
+                                                            let docs: Doc[] = [];
+                                                            docs = DocListCast(this.currentSelectedCollection.dataDoc[Doc.LayoutFieldKey(this.currentSelectedCollection.dataDoc)]);
+                                                            while (docs.length > 0) {
+                                                                newarray = [];
+                                                                docs.forEach((d) => {
+                                                                    if (d.data !== undefined) {
+                                                                        d._searchDocs = new List<Doc>();
+                                                                        d._docFilters = new List();
+                                                                        const newdocs = DocListCast(d.data);
+                                                                        newdocs.forEach((newdoc) => {
+                                                                            newarray.push(newdoc);
+                                                                        });
+                                                                    }
+                                                                });
+                                                                docs = newarray;
+                                                            }
+                                                            this.currentSelectedCollection.props.Document._docFilters = new List();
+                                                            this.currentSelectedCollection.props.Document._searchDocs = undefined;
+                                                            this.currentSelectedCollection = undefined;
+                                                        }
+                                                        this.submitSearch();
+                                                    });
+                                                }} />
+                                                DB
+                                        </label>
+                                        </div>
                                     </div>
-                                </div>
-                            </form>
+                                </form>
+                            </div>
                         </div>
-                    </div>
 
+                    </div>
                 </div>
                 <div style={{ zIndex: 20000, color: "black" }}>
                     {this._searchbarOpen === true ?
-- 
cgit v1.2.3-70-g09d2


From e9f8804a68327c64e1ade13081cab0b3b6c0ce21 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Sat, 15 Aug 2020 16:02:22 -0400
Subject: fixes for search -- need to rethink how to get a sortable string
 field (removed _s suffix for now).

---
 solr-8.3.1/server/solr/dash/conf/schema.xml |  7 ++++---
 src/client/documents/Documents.ts           |  1 +
 src/client/util/CurrentUserUtils.ts         | 18 +++++++++---------
 src/client/views/search/SearchBox.tsx       |  6 +++---
 src/server/Search.ts                        |  6 ++----
 5 files changed, 19 insertions(+), 19 deletions(-)

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

diff --git a/solr-8.3.1/server/solr/dash/conf/schema.xml b/solr-8.3.1/server/solr/dash/conf/schema.xml
index a0496444b..4f6ae57b2 100644
--- a/solr-8.3.1/server/solr/dash/conf/schema.xml
+++ b/solr-8.3.1/server/solr/dash/conf/schema.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <schema name="default-config" version="1.6">
   <uniqueKey>id</uniqueKey>
+  <fieldType name="list" class="solr.StrField" sortMissingLast="true" docValues="true"/>
   <fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true">
         <tokenizer class="solr.KeywordTokenizerFactory"/>
   </fieldType>
@@ -49,18 +50,18 @@
   <field name="_version_" type="plong" indexed="true" stored="true"/>
   <field name="proto" type="string" indexed="true" stored="true" uninvertible="false"  />
 
-  <dynamicField name="*_s" type="string" indexed="true" stored="true" uninvertible="false" docValues="true"/>
+  <!-- <dynamicField name="*_s" type="string" indexed="true" stored="false" uninvertible="false" docValues="true"/> -->
   <dynamicField name="*_t" type="text" indexed="true" stored="true" uninvertible="false" docValues="false"/>
   <dynamicField name="*_n" type="pdouble" indexed="true" stored="true" uninvertible="false" docValues="false"/>
   <dynamicField name="*_d" type="pdate" indexed="true" stored="true" uninvertible="false" docValues="true"/>
-  <dynamicField name="*_l" type="string" indexed="true" stored="true" uninvertible="false" docValues="false" multiValued="true"/>
+  <dynamicField name="*_l" type="list" indexed="true" stored="true" uninvertible="false" docValues="false" multiValued="true"/>
   <dynamicField name="*_i" type="string" indexed="true" stored="true" uninvertible="false" docValues="false"/>
   <dynamicField name="*_b" type="boolean" indexed="true" stored="true" uninvertible="false" docValues="false"/>
   <dynamicField name="*_a" type="text" indexed="true" stored="false" uninvertible="false" docValues="false" multiValued="true"/>
 
   <!-- <field name="_height" type="pdouble" indexed="true" stored="true" uninvertible="false" docValues="true"/> -->
 
-  <copyField source="*_t" dest="*_s"/>
+  <!-- <copyField source="*_t" dest="*_s"/> -->
   <copyField source="*_t" dest="DEFAULT"/>
   <copyField source="*_t" dest="*_a"/>
   <copyField source="*_n" dest="*_a"/>
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 77f8d3d50..e69c53260 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -185,6 +185,7 @@ export interface DocumentOptions {
     targetContainer?: Doc; // document whose proto will be set to 'panel' as the result of a onClick click script
     searchFileTypes?: List<string>; // file types allowed in a search query
     strokeWidth?: number;
+    cloneFieldFilter?: List<string>; // fields not to copy when the document is cloned
     _stayInCollection?: boolean;// whether the document should remain in its collection when someone tries to drag and drop it elsewhere
     treeViewPreventOpen?: boolean; // ignores the treeViewOpen Doc flag which allows a treeViewItem's expand/collapse state to be independent of other views of the same document in the tree view
     treeViewHideTitle?: boolean; // whether to hide the title of a tree view
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index 2c3a7cb66..d77ac8fe9 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -398,36 +398,36 @@ export class CurrentUserUtils {
         }
         if (doc.emptyCollection === undefined) {
             doc.emptyCollection = Docs.Create.FreeformDocument([],
-                { _nativeWidth: undefined, _nativeHeight: undefined, _width: 150, _height: 100, title: "freeform", system: true });
+                { _nativeWidth: undefined, _nativeHeight: undefined, _width: 150, _height: 100, title: "freeform", system: true, cloneFieldFilter: new List<string>(["system"]) });
         }
         if (doc.emptyPane === undefined) {
-            doc.emptyPane = Docs.Create.FreeformDocument([], { _nativeWidth: undefined, _nativeHeight: undefined, title: "Untitled Collection", system: true });
+            doc.emptyPane = Docs.Create.FreeformDocument([], { _nativeWidth: undefined, _nativeHeight: undefined, title: "Untitled Collection", system: true, cloneFieldFilter: new List<string>(["system"]) });
         }
         if (doc.emptyComparison === undefined) {
-            doc.emptyComparison = Docs.Create.ComparisonDocument({ title: "compare", _width: 300, _height: 300, system: true });
+            doc.emptyComparison = Docs.Create.ComparisonDocument({ title: "compare", _width: 300, _height: 300, system: true, cloneFieldFilter: new List<string>(["system"]) });
         }
         if (doc.emptyScript === undefined) {
-            doc.emptyScript = Docs.Create.ScriptingDocument(undefined, { _width: 200, _height: 250, title: "script", system: true });
+            doc.emptyScript = Docs.Create.ScriptingDocument(undefined, { _width: 200, _height: 250, title: "script", system: true, cloneFieldFilter: new List<string>(["system"]) });
         }
         if (doc.emptyScreenshot === undefined) {
-            doc.emptyScreenshot = Docs.Create.ScreenshotDocument("", { _width: 400, _height: 200, title: "screen snapshot", system: true });
+            doc.emptyScreenshot = Docs.Create.ScreenshotDocument("", { _width: 400, _height: 200, title: "screen snapshot", system: true, cloneFieldFilter: new List<string>(["system"]) });
         }
         if (doc.emptyAudio === undefined) {
-            doc.emptyAudio = Docs.Create.AudioDocument(nullAudio, { _width: 200, title: "ready to record audio", system: true });
+            doc.emptyAudio = Docs.Create.AudioDocument(nullAudio, { _width: 200, title: "ready to record audio", system: true, cloneFieldFilter: new List<string>(["system"]) });
         }
         if (doc.emptyImage === undefined) {
             doc.emptyImage = Docs.Create.ImageDocument("https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg", { _width: 250, _nativeWidth: 250, title: "an image of a cat", system: true });
         }
         if (doc.emptyButton === undefined) {
-            doc.emptyButton = Docs.Create.ButtonDocument({ _width: 150, _height: 50, _xPadding: 10, _yPadding: 10, title: "Button", system: true });
+            doc.emptyButton = Docs.Create.ButtonDocument({ _width: 150, _height: 50, _xPadding: 10, _yPadding: 10, title: "Button", system: true, cloneFieldFilter: new List<string>(["system"]) });
         }
         if (doc.emptyDocHolder === undefined) {
             doc.emptyDocHolder = Docs.Create.DocumentDocument(
                 ComputedField.MakeFunction("selectedDocs(this,this.excludeCollections,[_last_])?.[0]") as any,
-                { _width: 250, _height: 250, title: "container", system: true });
+                { _width: 250, _height: 250, title: "container", system: true, cloneFieldFilter: new List<string>(["system"]) });
         }
         if (doc.emptyWebpage === undefined) {
-            doc.emptyWebpage = Docs.Create.WebDocument("", { title: "webpage", _nativeWidth: 850, _nativeHeight: 962, _width: 400, UseCors: true, system: true });
+            doc.emptyWebpage = Docs.Create.WebDocument("", { title: "webpage", _nativeWidth: 850, _nativeHeight: 962, _width: 400, UseCors: true, system: true, cloneFieldFilter: new List<string>(["system"]) });
         }
         if (doc.activeMobileMenu === undefined) {
             this.setupActiveMobileMenu(doc);
diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx
index dbc30eeb6..99db78778 100644
--- a/src/client/views/search/SearchBox.tsx
+++ b/src/client/views/search/SearchBox.tsx
@@ -337,7 +337,7 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc
 
 
         query = query.replace(/-\s+/g, '');
-        query = query.replace(/-/g, "");
+        // query = query.replace(/-/g, "");
         return query;
     }
 
@@ -607,7 +607,7 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc
         const types = ["preselement", "docholder", "search", "searchitem", "fonticonbox"]; // this.filterTypes;
         const baseExpr = "NOT system_b:true";
         const includeDeleted = this.getDataStatus() ? "" : " NOT deleted_b:true";
-        const typeExpr = !types ? "" : ` ${types.map(type => `NOT ({!join from=id to=proto_i}type_t:${type}) AND NOT type_t:${type}`).join(" AND ")}`;
+        const typeExpr = !types ? "" : `(type_t:* OR {!join from=id to=proto_i}type_t:*) ${types.map(type => `NOT ({!join from=id to=proto_i}type_t:${type}) AND NOT type_t:${type}`).join(" AND ")}`;
         // fq: type_t:collection OR {!join from=id to=proto_i}type_t:collection   q:text_t:hello
         const query = [baseExpr, includeDeleted, typeExpr].join(" AND ").replace(/AND $/, "");
         return query;
@@ -625,7 +625,7 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc
             while (this._results.length <= this._endIndex && (this._numTotalResults === -1 || this._maxSearchIndex < this._numTotalResults)) {
                 this._curRequest = SearchUtil.Search(query, true, { fq: this.filterQuery, start: this._maxSearchIndex, rows: this.NumResults, hl: true, "hl.fl": "*", }).then(action(async (res: SearchUtil.DocSearchResult) => {
                     // happens at the beginning
-                    this.realTotalResults = res.numFound;
+                    this.realTotalResults = res.numFound <= 0 ? 0 : res.numFound;
                     if (res.numFound !== this._numTotalResults && this._numTotalResults === -1) {
                         this._numTotalResults = res.numFound;
                     }
diff --git a/src/server/Search.ts b/src/server/Search.ts
index decd1f5b1..3869867cd 100644
--- a/src/server/Search.ts
+++ b/src/server/Search.ts
@@ -7,11 +7,10 @@ export namespace Search {
 
     export async function updateDocument(document: any) {
         try {
-            const res = await rp.post(pathTo("update"), {
+            return await rp.post(pathTo("update"), {
                 headers: { 'content-type': 'application/json' },
                 body: JSON.stringify([document])
             });
-            return res;
         } catch (e) {
             // console.warn("Search error: " + e + document);
         }
@@ -19,11 +18,10 @@ export namespace Search {
 
     export async function updateDocuments(documents: any[]) {
         try {
-            const res = await rp.post(pathTo("update"), {
+            return await rp.post(pathTo("update"), {
                 headers: { 'content-type': 'application/json' },
                 body: JSON.stringify(documents)
             });
-            return res;
         } catch (e) {
             // console.warn("Search error: ", e, documents);
         }
-- 
cgit v1.2.3-70-g09d2

