Skip to content

Commit

Permalink
ufal/publisher-ok-fix (#473)
Browse files Browse the repository at this point in the history
* fixes ufal#1096 (#471)

* Added publisher filter in the integration test check

---------

Co-authored-by: Ondřej Košarko <[email protected]>
  • Loading branch information
milanmajchrak and kosarko authored Dec 14, 2023
1 parent 85225d2 commit f85e76a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,7 @@ public void discoverSearchTest() throws Exception {
SearchFilterMatcher.authorFilter(),
SearchFilterMatcher.subjectFilter(),
// SearchFilterMatcher.dateIssuedFilter(),
SearchFilterMatcher.publisherFilter(),
SearchFilterMatcher.hasContentInOriginalBundleFilter(),
SearchFilterMatcher.hasFileNameInOriginalBundleFilter(),
SearchFilterMatcher.hasFileDescriptionInOriginalBundleFilter(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,15 @@ public static Matcher<? super Object> clarinItemsTypeFilter() {
checkOperators()
);
}

public static Matcher<? super Object> publisherFilter() {
return allOf(
hasJsonPath("$.filter", is("publisher")),
hasJsonPath("$.hasFacets", is(false)),
hasJsonPath("$.type", is("text")),
hasJsonPath("$.openByDefault", is(false)),
checkOperators()

);
}
}
12 changes: 12 additions & 0 deletions dspace/config/spring/api/discovery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
<ref bean="searchFilterLanguage" />
<ref bean="searchFilterItemsCommunity"/>
<ref bean="searchFilterType"/>
<ref bean="searchFilterPublisher"/>
</list>
</property>
<!--The sort filters for the discovery search-->
Expand Down Expand Up @@ -2488,6 +2489,17 @@
<property name="sortOrderFilterPage" value="COUNT"/>
</bean>

<bean id="searchFilterPublisher" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
<property name="indexFieldName" value="publisher"/>
<property name="metadataFields">
<list>
<value>dc.publisher</value>
</list>
</property>
<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 f85e76a

Please sign in to comment.