Skip to content

Commit

Permalink
[DSC-1988] add followAuthorityMaxItemLimit configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
atarix83 committed Nov 29, 2024
1 parent 8bcddd2 commit bf28fa3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
25 changes: 16 additions & 9 deletions config/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,6 @@ item:
# The maximum number of values for repeatable metadata to show in the full item
metadataLimit: 20

# When the search results are retrieved, for each item type the metadata with a valid authority value are inspected.
# Referenced items will be fetched with a find all by id strategy to avoid individual rest requests
# to efficiently display the search results.
followAuthorityMetadata:
- type: Publication
metadata: dc.contributor.author
- type: Product
metadata: dc.contributor.author

# Collection Page Config
collection:
edit:
Expand Down Expand Up @@ -517,3 +508,19 @@ addToAnyPlugin:
title: DSpace CRIS 7 demo
# The link to be shown in the shared post, if different from document.location.origin (optional)
# link: https://dspacecris7.4science.cloud/

# When the search results are retrieved, for each item type the metadata with a valid authority value are inspected.
# Referenced items will be fetched with a find all by id strategy to avoid individual rest requests
# to efficiently display the search results.
followAuthorityMetadata:
- type: Publication
metadata: dc.contributor.author
- type: Product
metadata: dc.contributor.author

# The maximum number of item to process when following authority metadata values.
followAuthorityMaxItemLimit: 100

# The maximum number of metadata values to process for each metadata key
# when following authority metadata values.
followAuthorityMetadataValuesLimit: 5
2 changes: 1 addition & 1 deletion src/app/core/browse/search-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class SearchManager {
})
.filter((item) => hasValue(item));

const uuidList = this.extractUUID(items, environment.followAuthorityMetadata, 100);
const uuidList = this.extractUUID(items, environment.followAuthorityMetadata, environment.followAuthorityMaxItemLimit);

return uuidList.length > 0 ? this.itemService.findAllById(uuidList).pipe(
getFirstCompletedRemoteData(),
Expand Down
1 change: 1 addition & 0 deletions src/config/app-config.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ interface AppConfig extends Config {
suggestion: SuggestionConfig[];
addToAnyPlugin: AddToAnyPluginConfig;
followAuthorityMetadata: FollowAuthorityMetadata[];
followAuthorityMaxItemLimit: number;
followAuthorityMetadataValuesLimit: number;
metricVisualizationConfig: MetricVisualizationConfig[];
attachmentRendering: AttachmentRenderingConfig;
Expand Down
2 changes: 2 additions & 0 deletions src/config/default-app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ export class DefaultAppConfig implements AppConfig {
}
];

// The maximum number of item to process when following authority metadata values.
followAuthorityMaxItemLimit = 100;
// The maximum number of metadata values to process for each metadata key
// when following authority metadata values.
followAuthorityMetadataValuesLimit = 5;
Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ export const environment: BuildConfig = {
metadata: ['dc.contributor.author']
}
],
followAuthorityMaxItemLimit: 100,
followAuthorityMetadataValuesLimit: 5,
item: {
edit: {
Expand Down

0 comments on commit bf28fa3

Please sign in to comment.