aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-08-13 16:28:30 -0400
committerbobzel <zzzman@gmail.com>2020-08-13 16:28:30 -0400
commit79ecb86980d67ea2c57be4e38d396a5b19484bfe (patch)
treed883670d46186a12afaf6551a1e651ec13a2b2dd
parent122642c8f53ae37f67c92313490b247f0af154ba (diff)
changed solr schema so that text and date fields are sortable. fixed one line text not to show scrollbars. fixed scriptingRepl to allow document ids to be entered.
-rw-r--r--solr-8.3.1/server/solr/dash/conf/schema.xml14
-rw-r--r--src/client/util/SearchUtil.ts2
-rw-r--r--src/client/views/ScriptingRepl.tsx2
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx3
-rw-r--r--src/server/ApiManagers/SearchManager.ts5
5 files changed, 17 insertions, 9 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 36e803d83..47aa56787 100644
--- a/solr-8.3.1/server/solr/dash/conf/schema.xml
+++ b/solr-8.3.1/server/solr/dash/conf/schema.xml
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema name="default-config" version="1.6">
<uniqueKey>id</uniqueKey>
- <fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true"/>
+ <fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true">
+ <tokenizer class="solr.KeywordTokenizerFactory"/>
+ </fieldType>
<fieldType name="text" class="solr.TextField">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
@@ -41,23 +43,25 @@
<fieldType name="pdaterange" class="solr.DateRangeField"/>
<fieldType name="pdouble" class="solr.DoublePointField"/>
+ <field name="string" type="string" indexed="true" stored="true" uninvertible="true"/>
<field name="text" type="text" indexed="true" stored="false" uninvertible="false" multiValued="true"/>
<field name="id" type="string" indexed="true" stored="true" uninvertible="false" required="true"/>
<field name="_version_" type="plong" indexed="true" stored="true"/>
<field name="proto" type="string" indexed="true" stored="true" uninvertible="false" />
<field name="_height" type="pdouble" indexed="true" stored="true" uninvertible="false" docValues="true"/>
-
+ <dynamicField name="*_s" type="string" indexed="true" stored="true" 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="pdaterange" 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="*_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"/>
- <copyField source="*_t" dest="text"/>
+ <copyField source="*_t" dest="*_s"/>
+
+ <!-- <field name="_height" type="pdouble" indexed="true" stored="true" uninvertible="false" docValues="true"/> -->
<copyField source="*_t" dest="*_a"/>
<copyField source="*_n" dest="*_a"/>
diff --git a/src/client/util/SearchUtil.ts b/src/client/util/SearchUtil.ts
index 3073da954..a66cce6a5 100644
--- a/src/client/util/SearchUtil.ts
+++ b/src/client/util/SearchUtil.ts
@@ -38,7 +38,7 @@ export namespace SearchUtil {
query = query || "*"; //If we just have a filter query, search for * as the query
const rpquery = Utils.prepend("/dashsearch");
const replacedQuery = query.replace(/type_t:([^ )])/, (substring, arg) => `{!join from=id to=proto_i}type_t:${arg}`);
- const gotten = await rp.get(rpquery, { qs: { ...options, q: replacedQuery } });
+ const gotten = await rp.get(rpquery, { qs: { ...options, /* sort: "lastModified_d desc", */ q: replacedQuery } });
const result: IdSearchResult = gotten.startsWith("<") ? { ids: [], docs: [], numFound: 0, lines: [] } : JSON.parse(gotten);
if (!returnDocs) {
return result;
diff --git a/src/client/views/ScriptingRepl.tsx b/src/client/views/ScriptingRepl.tsx
index 1eb380e0b..db087fb23 100644
--- a/src/client/views/ScriptingRepl.tsx
+++ b/src/client/views/ScriptingRepl.tsx
@@ -104,7 +104,7 @@ export class ScriptingRepl extends React.Component {
if (ts.isParameter(node.parent)) {
// delete knownVars[node.text];
} else if (isntPropAccess && isntPropAssign && !(node.text in knownVars) && !(node.text in globalThis)) {
- const match = node.text.match(/\d([0-9]+)/);
+ const match = node.text.match(/d([0-9]+)/);
if (match) {
const m = parseInt(match[1]);
usedDocuments.push(m);
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index f1eb5ef09..8c05d3603 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -648,7 +648,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
const options = cm.findByDescription("Options...");
const optionItems = options && "subitems" in options ? options.subitems : [];
- !Doc.UserDoc().noviceMode && optionItems.push({ description: this.Document._singleLine ? "Make Single Line" : "Make Multi Line", event: () => this.layoutDoc._singleLine = !this.layoutDoc._singleLine, icon: "expand-arrows-alt" });
+ !Doc.UserDoc().noviceMode && optionItems.push({ description: !this.Document._singleLine ? "Make Single Line" : "Make Multi Line", event: () => this.layoutDoc._singleLine = !this.layoutDoc._singleLine, icon: "expand-arrows-alt" });
optionItems.push({ description: `${this.Document._autoHeight ? "Lock" : "Auto"} Height`, event: () => this.layoutDoc._autoHeight = !this.layoutDoc._autoHeight, icon: "plus" });
optionItems.push({ description: `${!this.layoutDoc._nativeWidth || !this.layoutDoc._nativeHeight ? "Lock" : "Unlock"} Aspect`, event: this.toggleNativeDimensions, icon: "snowflake" });
!options && cm.addItem({ description: "Options...", subitems: optionItems, icon: "eye" });
@@ -1580,6 +1580,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
onScroll={this.onscrolled} onDrop={this.ondrop} >
<div className={`formattedTextBox-inner${rounded}${selclass}`} ref={this.createDropTarget}
style={{
+ overflow: this.layoutDoc._singleLine ? "hidden" : undefined,
padding: this.layoutDoc._textBoxPadding ? StrCast(this.layoutDoc._textBoxPadding) : `${Math.max(0, NumCast(this.layoutDoc._yMargin, this.props.yMargin || 0) + selPad)}px ${NumCast(this.layoutDoc._xMargin, this.props.xMargin || 0) + selPad}px`,
pointerEvents: !this.props.active() ? ((this.layoutDoc.isLinkButton || this.props.onClick) ? "none" : undefined) : undefined
}}
diff --git a/src/server/ApiManagers/SearchManager.ts b/src/server/ApiManagers/SearchManager.ts
index 99f227b28..a5aaab63e 100644
--- a/src/server/ApiManagers/SearchManager.ts
+++ b/src/server/ApiManagers/SearchManager.ts
@@ -62,7 +62,7 @@ export class SearchManager extends ApiManager {
subscription: "/dashsearch",
secureHandler: async ({ req, res }) => {
const solrQuery: any = {};
- ["q", "fq", "start", "rows", "hl", "hl.fl"].forEach(key => solrQuery[key] = req.query[key]);
+ ["q", "fq", "start", "rows", "sort", "hl", "hl.fl"].forEach(key => solrQuery[key] = req.query[key]);
if (solrQuery.q === undefined) {
res.send([]);
return;
@@ -136,6 +136,9 @@ export namespace SolrManager {
const term = ToSearchTerm(value);
if (term !== undefined) {
const { suffix, value } = term;
+ if (key.endsWith('lastModified')) {
+ update["lastModified" + suffix] = value;
+ }
update[key + suffix] = value;
dynfield = true;
}