aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--solr-8.3.1/server/solr/dash/conf/schema.xml7
-rw-r--r--src/client/documents/Documents.ts1
-rw-r--r--src/client/util/CurrentUserUtils.ts18
-rw-r--r--src/client/views/search/SearchBox.tsx6
-rw-r--r--src/server/Search.ts6
5 files changed, 19 insertions, 19 deletions
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);
}