Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('SearchConfigurationService', () => {
});

const backendFilters = [
new SearchFilter('f.author', ['another value']),
new SearchFilter('f.author', ['another value'], 'equals'),
new SearchFilter('f.date', ['[2013 TO 2018]'], 'equals')
];
Comment thread
milanmajchrak marked this conversation as resolved.

Expand Down
6 changes: 5 additions & 1 deletion src/app/core/shared/search/search-configuration.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ export class SearchConfigurationService implements OnDestroy {
filters.push(new SearchFilter(realKey, ['[' + min + ' TO ' + max + ']'], 'equals'));
}
} else {
filters.push(new SearchFilter(key, filterParams[key]));
// Default to the "equals" operator when a filter value carries none (e.g. a legacy or
// crawled URL like "f.subject=foo" instead of "f.subject=foo,equals"). Without this the
// backend rejects the operator-less filter with HTTP 422. Values that already embed an
// operator (contain a comma) keep it - see SearchOptions.toRestUrl. dspace-customers#781.
filters.push(new SearchFilter(key, filterParams[key], 'equals'));
Comment thread
milanmajchrak marked this conversation as resolved.
Outdated
}
});
return filters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('MyDSpaceConfigurationService', () => {
});

const backendFilters = [
new SearchFilter('f.namedresourcetype', ['another value']),
new SearchFilter('f.namedresourcetype', ['another value'], 'equals'),
new SearchFilter('f.dateSubmitted', ['[2013 TO 2018]'], 'equals')
];

Expand Down
Loading