Skip to content

Commit

Permalink
[ACS-4794] ES query migration changes (#8773)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
MichalKinas authored Nov 14, 2023
1 parent e2c116c commit 15fdbc7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface AutocompleteOption {
value: string;
id?: string;
fullPath?: string;
query?: string;
}

export enum AutocompleteField {
Expand Down

0 comments on commit 15fdbc7

Please sign in to comment.