diff options
| author | bobzel <zzzman@gmail.com> | 2020-08-15 16:02:22 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-08-15 16:02:22 -0400 |
| commit | e9f8804a68327c64e1ade13081cab0b3b6c0ce21 (patch) | |
| tree | f220c8f94bc107cc0a3435c3f93ba8c7da96e333 /src/client/views | |
| parent | 44df6420f1e4a7b77ad3ce6dfe2805dfe40a69da (diff) | |
fixes for search -- need to rethink how to get a sortable string field (removed _s suffix for now).
Diffstat (limited to 'src/client/views')
| -rw-r--r-- | src/client/views/search/SearchBox.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |
