Skip to content

Commit 338191d

Browse files
milanmajchrakmilanmajchrakclaude
authored
TUL/fix: make Subject a plain facet to stop vocabulary=undefined 400s (#781) (#1362)
* TUL/fix: make Subject a plain facet to stop vocabulary=undefined 400s (#781) dc.subject at TUL is free-text keywords, not a controlled hierarchy. The searchFilterSubject facet was HierarchicalSidebarFacetConfiguration, which makes the Angular UI (SearchHierarchyFilterComponent) probe /submission/vocabularyEntryDetails/search/top with vocabulary=undefined on every search-page render (getVocabularyEntry() returns undefined because no srsc vocabulary is enabled), producing an HTTP 400 each time. Switch searchFilterSubject to a plain DiscoverySearchFilterFacet and drop the hierarchical '::' splitter. The facet renders as a normal text facet and no longer triggers the vocabulary tree probe. Note: run `dspace index-discovery -b` after deploy; this changes how dc.subject is indexed for faceting. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * TUL/test: expect Subject facet as text (not hierarchical) after facet change The Subject facet was switched from HierarchicalSidebarFacetConfiguration to a plain DiscoverySearchFilterFacet, so the REST API now reports facetType/type "text" for subject (same as author). Update the shared matchers accordingly: - FacetEntryMatcher.subjectFacet: facetType "hierarchical" -> "text" - SearchFilterMatcher.subjectFilter: type "hierarchical" -> "text" Fixes the 28 DiscoveryRestControllerIT (and ClarinDiscoveryRestControllerIT) assertions that go through these matchers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: milanmajchrak <minptai7@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0446ae5 commit 338191d

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/FacetEntryMatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static Matcher<? super Object> authorFacetWithMinMax(boolean hasNext, Str
4848
public static Matcher<? super Object> subjectFacet(boolean hasNext) {
4949
return allOf(
5050
hasJsonPath("$.name", is("subject")),
51-
hasJsonPath("$.facetType", is("hierarchical")),
51+
hasJsonPath("$.facetType", is("text")),
5252
hasJsonPath("$.facetLimit", any(Integer.class)),
5353
hasJsonPath("$._links.self.href", containsString("api/discover/facets/subject")),
5454
hasJsonPath("$._links", matchNextLink(hasNext, "api/discover/facets/subject"))

dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SearchFilterMatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static Matcher<? super Object> subjectFilter() {
4444
return allOf(
4545
hasJsonPath("$.filter", is("subject")),
4646
hasJsonPath("$.hasFacets", is(true)),
47-
hasJsonPath("$.type", is("hierarchical")),
47+
hasJsonPath("$.type", is("text")),
4848
hasJsonPath("$.openByDefault", is(false)),
4949
checkOperators()
5050

dspace/config/spring/api/discovery.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2444,7 +2444,11 @@
24442444

24452445
</bean>
24462446

2447-
<bean id="searchFilterSubject" class="org.dspace.discovery.configuration.HierarchicalSidebarFacetConfiguration">
2447+
<!-- TUL: dc.subject holds free-text keywords, not a controlled hierarchy, so this is a
2448+
plain facet. Using HierarchicalSidebarFacetConfiguration makes the Angular UI probe
2449+
vocabularyEntryDetails/search/top with vocabulary=undefined (no srsc vocabulary is
2450+
wired for TUL), yielding an HTTP 400 on every search-page render. See dspace-customers#781. -->
2451+
<bean id="searchFilterSubject" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
24482452
<property name="indexFieldName" value="subject"/>
24492453
<property name="metadataFields">
24502454
<list>
@@ -2454,8 +2458,6 @@
24542458
<property name="facetLimit" value="5"/>
24552459
<property name="sortOrderSidebar" value="COUNT"/>
24562460
<property name="sortOrderFilterPage" value="COUNT"/>
2457-
<property name="splitter" value="::"/>
2458-
24592461
</bean>
24602462

24612463
<bean id="searchFilterIssued" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">

0 commit comments

Comments
 (0)