[ACS-4794] ES query migration changes (#8773)

* [ACS-4794] ES query migration changes

* [ACS-4974] Remove * from path as it causes exception

* [ACS-4974] Apply PATH workarounds for PNAME and ANAME

* [ACS-4974] Add custom query to autocomplete options filter

* [ACS-4974] Correct username
This commit is contained in:
MichalKinas
2023-11-14 08:23:55 +01:00
committed by GitHub
parent e2c116c25a
commit 15fdbc7e29
4 changed files with 4 additions and 3 deletions

View File

@@ -98,7 +98,7 @@ export class CustomResourcesService {
getRecentFiles(personId: string, pagination: PaginationModel, filters?: string[]): Observable<ResultSetPaging> {
const defaultFilter = [
'TYPE:"content"',
'-PNAME:"0/wiki"',
'-PATH:"//cm:wiki/*"',
'-TYPE:"app:filelink"',
'-TYPE:"cm:thumbnail"',
'-TYPE:"cm:failedThumbnail"',

View File

@@ -54,7 +54,7 @@ export class SearchPermissionConfigurationService implements SearchConfiguration
if (this.queryProvider?.query) {
query = this.queryProvider.query.replace(new RegExp(/\${([^}]+)}/g), searchTerm);
} else {
query = `(email:*${searchTerm}* OR firstName:*${searchTerm}* OR lastName:*${searchTerm}* OR displayName:*${searchTerm}* OR authorityName:*${searchTerm}* OR authorityDisplayName:*${searchTerm}*) AND ANAME:("0/APP.DEFAULT")`;
query = `(userName:*${searchTerm}* OR email:*${searchTerm}* OR firstName:*${searchTerm}* OR lastName:*${searchTerm}* OR authorityName:*${searchTerm}* OR authorityDisplayName:*${searchTerm}*) AND PATH:"//cm:APP.DEFAULT/*"`;
}
return query;
}

View File

@@ -110,7 +110,7 @@ export class SearchFilterAutocompleteChipsComponent implements SearchWidget, OnI
if (this.settings.field === AutocompleteField.CATEGORIES) {
queryFragments = this.selectedOptions.map(val => `${this.settings.field}:"workspace://SpacesStore/${val.id}"`);
} else {
queryFragments = this.selectedOptions.map(val => `${this.settings.field}:"${val.value}"`);
queryFragments = this.selectedOptions.map(val => val.query ?? `${this.settings.field}:"${val.value}"`);
}
this.context.queryFragments[this.id] = queryFragments.join(' OR ');
this.context.update();

View File

@@ -19,6 +19,7 @@ export interface AutocompleteOption {
value: string;
id?: string;
fullPath?: string;
query?: string;
}
export enum AutocompleteField {