Skip to content

Commit 38be79e

Browse files
committed
fix(geo): do not upgrade flexsearch since it seem not compatible with TS
nextapps-de/flexsearch#342
1 parent 9200d96 commit 38be79e

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

package-lock.json

+13-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
"bowser": "^2.11.0",
7272
"core-js": "^3.32.2",
7373
"file-saver": "^2.0.2",
74-
"flexsearch": "0.7.31",
7574
"hammerjs": "2.0.8",
7675
"html2canvas": "^1.4.1",
7776
"jspdf": "^2.5.1",

packages/geo/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"@igo2/utils": "*",
5656
"@mat-datetimepicker/core": "~13.0.0",
5757
"file-saver": "^2.0.2",
58-
"flexsearch": "0.7.31",
58+
"flexsearch": "0.7.21",
5959
"html2canvas": "^1.4.1",
6060
"jspdf": "^2.5.1",
6161
"jspdf-autotable": "^3.5.29",

packages/geo/src/lib/feature/shared/strategies/search.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { EntityStoreStrategy } from '@igo2/common';
22

3-
import { Document, DocumentOptions } from 'flexsearch';
3+
import { DocumentOptions, Document as FlexSearchDocument } from 'flexsearch';
44
import { skipWhile } from 'rxjs/operators';
55

66
import { FeatureStoreSearchIndexStrategyOptions } from '../feature.interfaces';
@@ -59,7 +59,7 @@ export class FeatureStoreSearchIndexStrategy extends EntityStoreStrategy {
5959
}
6060

6161
private initStoreSearchIndex(store) {
62-
store.searchDocument = new Document({ tokenize: 'full' });
62+
store.searchDocument = new FlexSearchDocument({ tokenize: 'full' });
6363
}
6464

6565
/**
@@ -166,7 +166,7 @@ export class FeatureStoreSearchIndexStrategy extends EntityStoreStrategy {
166166
if (toIndex.length === 0) {
167167
this.initStoreSearchIndex(store);
168168
} else {
169-
store.searchDocument = new Document({
169+
store.searchDocument = new FlexSearchDocument({
170170
document: {
171171
id: 'igoSearchID',
172172
index: contentToIndex

packages/geo/src/lib/search/shared/sources/workspace.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Inject, Injectable } from '@angular/core';
33
import { LanguageService, StorageService } from '@igo2/core';
44

55
import pointOnFeature from '@turf/point-on-feature';
6-
import { SimpleDocumentSearchResultSetUnit } from 'flexsearch';
76
import { BehaviorSubject, Observable, of } from 'rxjs';
87

98
import { FEATURE } from '../../../feature/shared/feature.enums';
@@ -103,8 +102,7 @@ export class WorkspaceSearchSource extends SearchSource implements TextSearch {
103102
const termToUse = term;
104103
fswi.searchDocument
105104
.search(termToUse, { limit: page * limitValue })
106-
.map((i) => {
107-
const foundIn: SimpleDocumentSearchResultSetUnit = i;
105+
.map((foundIn) => {
108106
const field = foundIn.field;
109107
foundIn.result.map((index) => {
110108
const feature = fswi.index.get(index);

0 commit comments

Comments
 (0)