Skip to content

Commit

Permalink
Merge pull request #107 from dbmi-pitt/maxsibilla/publication-update
Browse files Browse the repository at this point in the history
Updating includeFilter support to map to should instead of must
  • Loading branch information
maxsibilla authored Oct 22, 2024
2 parents 95de585 + 33b7665 commit 6b7d38e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/core/TermFacet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function TermFacet({
{options.length > 5 && !moreExpanded && (
<button
type='button'
class='sui-facet-view-more'
className='sui-facet-view-more'
aria-label='Show more options'
onClick={handleMoreClick}
>
Expand Down
6 changes: 4 additions & 2 deletions lib/search-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,16 @@ export function esQueryBuilder(request, config, authState) {
const fields = Object.keys(config.search_fields)
const search = esb.multiMatchQuery(fields, request.searchTerm)
query = query.must(search)
// Whenever a searchTerm is specified we want to remove the default sort order
request.sortList = []
} else if (config.includeFilters && config.includeFilters.length > 0) {
const includeFilters = config.excludeFilters
const includeFilters = config.includeFilters
const f = Array(includeFilters.length)
for (let i = 0; i < includeFilters.length; i++) {
// Only support term filter for now
f[i] = esb.termsQuery(includeFilters[i].field, includeFilters[i].values)
}
query = query.must(f)
query = query.should(f)
} else {
query = query.must(esb.matchAllQuery())
}
Expand Down

0 comments on commit 6b7d38e

Please sign in to comment.