Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(app): searchable workspaces #910

Merged
merged 3 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions docs/_tables/fr/properties/sourceFields.csv
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,16 @@ allowedOperatorsType ,String,Indique les opérateurs permis pour cet attri
| All
| Time
| Référez vous à `ogc-filter.ts <https://github.com/infra-geo-ouverte/igo2-lib/blob/master/packages/geo/src/lib/filter/shared/ogc-filter.ts#L291>`__ pour les opérateurs correspondants.",BasicAndSpatial
validation ,Object ,Indique les validations lors de la sauvegarde d'une entité ,"| Référez vous à `entity.interface.ts <https://github.com/infra-geo-ouverte/igo2-lib/blob/master/packages/common/src/lib/entity/shared/entity.interfaces.ts>`__ ."
relation ,String ,Indique les relations à lier pour la saisie des champs de type list ,"| Référez vous à `datasource.interface.ts <https://github.com/infra-geo-ouverte/igo2-lib/blob/master/packages/geo/src/lib/datasource/shared/datasources/datasource.interface.ts>`__ ."
validation ,Object ,Indique les validations lors de la sauvegarde d'une entité ,| Référez vous à `entity.interface.ts <https://github.com/infra-geo-ouverte/igo2-lib/blob/master/packages/common/src/lib/entity/shared/entity.interfaces.ts>`__ .,
relation ,String ,Indique les relations à lier pour la saisie des champs de type list ,| Référez vous à `datasource.interface.ts <https://github.com/infra-geo-ouverte/igo2-lib/blob/master/packages/geo/src/lib/datasource/shared/datasources/datasource.interface.ts>`__ .,
searchIndex,Object ,Indique si et comment le champs doit etre indexé pour etre recherchable (vector source seulement),"| enabled?: boolean;
| preset?: Preset;
| tokenize?: Tokenizer;
| cache?: boolean | number;
| resolution?: number;
| context?: boolean;
| optimize?: boolean;
| language?: string;
| encode?: Encoders;
| Si aucun champ n’est renseigné, la valeur par défaut s’appliquera. Seuls les champs dont l’occurrence des valeurs est supérieure a 2% sera indexé OU si le contenu n’est pas du float.
| Voir https://github.com/nextapps-de/flexsearch/ pour les propriétés associées.","tokenize: ""full"""
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"core-js": "^3.24.1",
"fast-text-encoding": "^1.0.4",
"file-saver": "^2.0.2",
"flexsearch": "0.7.21",
"hammerjs": "^2.0.8",
"html2canvas": "^1.4.1",
"jspdf": "^2.5.1",
Expand Down
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
import { IgoSpinnerModule, IgoStopPropagationModule } from '@igo2/common';
import { IgoAuthModule } from '@igo2/auth';
import {
provideWorkspaceSearchSource,
provideIChercheSearchSource,
provideIChercheReverseSearchSource,
provideNominatimSearchSource,
Expand Down Expand Up @@ -89,6 +90,7 @@ export const defaultTooltipOptions: MatTooltipDefaultOptions = {
RouteService,
provideNominatimSearchSource(),
provideIChercheSearchSource(),
provideWorkspaceSearchSource(),
provideIChercheReverseSearchSource(),
provideCoordinatesReverseSearchSource(),
provideILayerSearchSource(),
Expand Down
18 changes: 17 additions & 1 deletion src/contexts/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,23 @@
"queryable": true,
"queryTitle": "nomnavcana",
"url": "https://ws.mapserver.transports.gouv.qc.ca/swtq?service=WFS&request=GetFeature&version=1.1.0&typename=aeroport_piste&outputFormat=geojson",
"type": "vector"
"type": "vector",
"sourceFields": [
{ "name": "longpiste2"},
{ "name": "idobj", "searchIndex": {"enabled": true, "tokenize": "strict"}},
{ "name": "codeindic", "searchIndex": {"enabled": true}},
{ "name": "nomnavcana", "searchIndex": {"enabled": true}},
{ "name": "nbrpiste"},
{ "name": "indicpiste"},
{ "name": "surface"},
{ "name": "province"},
{ "name": "datdebappt"},
{ "name": "datmodif"},
{ "name": "version"},
{ "name": "source", "searchIndex": {"enabled": true}},
{ "name": "remarque", "searchIndex": {"enabled": true}},
{ "name": "objectid"}
]
}
},
{
Expand Down
4 changes: 4 additions & 0 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ export const environment: Environment = {
configFileToGeoDBService: './data/geoDataToIDB.json'
},
searchSources: {
workspace: {
available: true,
enabled: true
},
nominatim: {
available: false
},
Expand Down