Skip to content

Commit

Permalink
local-typex differencies (#660)
Browse files Browse the repository at this point in the history
* Added dataProvider Facet

* Replaced deprecated `sortOrder` with the new one.

* `searchFacetDataProvider` should be in the searchFilters

* Updated Integration test which checks the search filters
  • Loading branch information
milanmajchrak authored May 21, 2024
1 parent e343e98 commit 39a1ea1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,8 @@ public void discoverSearchTest() throws Exception {
SearchFilterMatcher.clarinItemsLanguageFilter(),
SearchFilterMatcher.clarinItemsCommunityFilter(),
SearchFilterMatcher.clarinItemsTypeFilter(),
SearchFilterMatcher.clarinSubjectFirstValueFilter()
SearchFilterMatcher.clarinSubjectFirstValueFilter(),
SearchFilterMatcher.clarinDataProviderFacet()
)))
//These sortOptions need to be present as it's the default in the configuration
.andExpect(jsonPath("$.sortOptions", contains(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,14 @@ public static Matcher<? super Object> clarinSubjectFirstValueFilter() {
checkOperators()
);
}

public static Matcher<? super Object> clarinDataProviderFacet() {
return allOf(
hasJsonPath("$.filter", is("dataProvider")),
hasJsonPath("$.hasFacets", is(false)),
hasJsonPath("$.type", is("text")),
hasJsonPath("$.openByDefault", is(false)),
checkOperators()
);
}
}
13 changes: 13 additions & 0 deletions dspace/config/spring/api/discovery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
<ref bean="searchFilterType"/>
<ref bean="searchFilterPublisher"/>
<ref bean="searchFilterSubjectFirstValue"/>
<ref bean="searchFacetDataProvider" />
</list>
</property>
<!--The sort filters for the discovery search-->
Expand Down Expand Up @@ -2567,6 +2568,18 @@
<property name="sortOrderFilterPage" value="COUNT"/>
</bean>

<bean id="searchFacetDataProvider" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
<property name="indexFieldName" value="dataProvider"/>
<property name="metadataFields">
<list>
<value>local.dataProvider</value>
</list>
</property>
<property name="facetLimit" value="20"/>
<property name="sortOrderSidebar" value="COUNT"/>
<property name="sortOrderFilterPage" value="COUNT"/>
</bean>

<bean id="searchFilterEntityType" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
<property name="indexFieldName" value="entityType"/>
<property name="metadataFields">
Expand Down

0 comments on commit 39a1ea1

Please sign in to comment.