diff --git a/rero_ils/config.py b/rero_ils/config.py
index c87099e2e9..5cc525a841 100644
--- a/rero_ils/config.py
+++ b/rero_ils/config.py
@@ -718,18 +718,48 @@ def _(x):
},
}
+# Number of results in facet
+RERO_ILS_AGGREGATION_SIZE = 50
+
RECORDS_REST_FACETS = {
'documents': dict(
aggs=dict(
- document_type=dict(terms=dict(field='type')),
- library=dict(terms=dict(field='items.library_pid')),
- author__en=dict(terms=dict(field='facet_authors_en')),
- author__fr=dict(terms=dict(field='facet_authors_fr')),
- author__de=dict(terms=dict(field='facet_authors_de')),
- author__it=dict(terms=dict(field='facet_authors_it')),
- language=dict(terms=dict(field='languages.language')),
- subject=dict(terms=dict(field='facet_subjects')),
- status=dict(terms=dict(field='items.status'))
+ document_type=dict(terms=dict(
+ field='type',
+ size=RERO_ILS_AGGREGATION_SIZE
+ )),
+ library=dict(terms=dict(
+ field='items.library_pid',
+ size=RERO_ILS_AGGREGATION_SIZE
+ )),
+ author__en=dict(terms=dict(
+ field='facet_authors_en',
+ size=RERO_ILS_AGGREGATION_SIZE
+ )),
+ author__fr=dict(terms=dict(
+ field='facet_authors_fr',
+ size=RERO_ILS_AGGREGATION_SIZE
+ )),
+ author__de=dict(terms=dict(
+ field='facet_authors_de',
+ size=RERO_ILS_AGGREGATION_SIZE
+ )),
+ author__it=dict(terms=dict(
+ field='facet_authors_it',
+ size=RERO_ILS_AGGREGATION_SIZE
+ )),
+ language=dict(terms=dict(
+ field='languages.language',
+ size=RERO_ILS_AGGREGATION_SIZE
+ )),
+ subject=dict(terms=dict(
+ field='facet_subjects',
+ size=RERO_ILS_AGGREGATION_SIZE
+ )),
+ status=dict(terms=dict(
+ field='items.status',
+ size=RERO_ILS_AGGREGATION_SIZE
+ ))
),
filters={
_('document_type'): terms_filter('type'),
diff --git a/ui/src/app/records/search/search.component.html b/ui/src/app/records/search/search.component.html
index 0fbb0bdde4..f32eb13e82 100644
--- a/ui/src/app/records/search/search.component.html
+++ b/ui/src/app/records/search/search.component.html
@@ -28,21 +28,41 @@
diff --git a/ui/src/app/records/search/search.component.ts b/ui/src/app/records/search/search.component.ts
index cf6a960506..9c0602d67c 100644
--- a/ui/src/app/records/search/search.component.ts
+++ b/ui/src/app/records/search/search.component.ts
@@ -125,6 +125,9 @@ export class SearchComponent implements OnInit {
public language = null;
public permissions = null;
onInitDone = false;
+ public bucketSplitSize = 10;
+ private stateAgg = [];
+
constructor(
protected recordsService: RecordsService,
protected route: ActivatedRoute,
@@ -186,6 +189,14 @@ export class SearchComponent implements OnInit {
const agg_value = data.aggregations[agg];
agg_value.title = agg;
agg_value.name = agg;
+ const agg_values = [];
+ if (agg_value.buckets.length > this.bucketSplitSize) {
+ agg_values.push(agg_value.buckets.slice(0, this.bucketSplitSize));
+ agg_values.push(agg_value.buckets.slice(this.bucketSplitSize));
+ } else {
+ agg_values.push(agg_value.buckets);
+ }
+ agg_value.buckets = agg_values;
const agg_split = agg.split('__');
if (agg_split.length === 2) {
if (this.language === agg_split[1]) {
@@ -288,4 +299,16 @@ export class SearchComponent implements OnInit {
}
return true;
}
+
+ setStateOfAgg(name: string) {
+ if (!this.stateAgg.includes(name)) {
+ this.stateAgg.push(name);
+ } else {
+ this.stateAgg.splice(this.stateAgg.indexOf(name), 1);
+ }
+ }
+
+ stateOfAgg(name: string) {
+ return this.stateAgg.includes(name);
+ }
}
diff --git a/ui/src/assets/i18n/de.json b/ui/src/assets/i18n/de.json
index 7bf5c95c17..13120a560c 100644
--- a/ui/src/assets/i18n/de.json
+++ b/ui/src/assets/i18n/de.json
@@ -243,5 +243,7 @@
"Documents": "Documents",
"Persons": "Persons",
"results": "Resultate",
- "No result found.": "Keine Resultate gefunden"
-}
\ No newline at end of file
+ "No result found.": "Keine Resultate gefunden",
+ "more…": "Weiteres…",
+ "less…": "Weniger…"
+}
diff --git a/ui/src/assets/i18n/en.json b/ui/src/assets/i18n/en.json
index 97d1820b45..9eab4637f1 100644
--- a/ui/src/assets/i18n/en.json
+++ b/ui/src/assets/i18n/en.json
@@ -243,5 +243,7 @@
"Documents": "Documents",
"Persons": "Persons",
"results": "results",
- "No result found.": "No result found."
-}
\ No newline at end of file
+ "No result found.": "No result found.",
+ "more…": "more…",
+ "less…": "less…"
+}
diff --git a/ui/src/assets/i18n/en_US.json b/ui/src/assets/i18n/en_US.json
index 681660ff9f..5154431b69 100644
--- a/ui/src/assets/i18n/en_US.json
+++ b/ui/src/assets/i18n/en_US.json
@@ -243,5 +243,7 @@
"Documents": "Documents",
"Persons": "Persons",
"results": "results",
- "No result found.": "No result found."
-}
\ No newline at end of file
+ "No result found.": "No result found.",
+ "more…": "more…",
+ "less…": "less…"
+}
diff --git a/ui/src/assets/i18n/fr.json b/ui/src/assets/i18n/fr.json
index 63f371e6c2..978f86d708 100644
--- a/ui/src/assets/i18n/fr.json
+++ b/ui/src/assets/i18n/fr.json
@@ -243,5 +243,7 @@
"Documents": "Documents",
"Persons": "Personnes",
"results": "résultats",
- "No result found.": "Aucun résultat n'a été trouvé."
-}
\ No newline at end of file
+ "No result found.": "Aucun résultat n'a été trouvé.",
+ "more…": "plus…",
+ "less…": "moins…"
+}
diff --git a/ui/src/assets/i18n/it.json b/ui/src/assets/i18n/it.json
index e01f1d4d2b..9962312c53 100644
--- a/ui/src/assets/i18n/it.json
+++ b/ui/src/assets/i18n/it.json
@@ -243,5 +243,7 @@
"Documents": "Documenti",
"Persons": "Persons",
"results": "risultati",
- "No result found.": "Nessun risultato trovato."
-}
\ No newline at end of file
+ "No result found.": "Nessun risultato trovato.",
+ "more…": "di più…",
+ "less…": "di meno…"
+}