Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #142 from mhatvan/114-searching-for-already-added-…
Browse files Browse the repository at this point in the history
…preprints-by-doi-no-results

fix: Searching for already added preprints by DOI doesn't yield any results
  • Loading branch information
harumhelmy authored Jul 13, 2020
2 parents c4b736b + d23bfdf commit 3f668bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/utils/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,8 @@ export function apifyPreprintQs(uiQs = '', bookmark) {

if (ui.has('q')) {
const q = ui.get('q');
const splt = q.split(/(\s+)/);

const ored = [
`name:${splt.length > 1 && escapeLucene(q) === q ? JSON.stringify(q) : q}` // we auto quote multiple terms if they do not contain lucene operators
];
const ored = [`name:"${escapeLucene(q)}"`];

const doiMatched = q.match(doiRegex());
if (doiMatched) {
Expand Down
2 changes: 1 addition & 1 deletion test/test-search-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('search utils', () => {
const p = querystring.parse(apifyPreprintQs(ui).substring(1));
assert.equal(
p.q,
'name:text AND hasReviews:true AND (subjectName:"influenza" OR subjectName:"zika")'
'name:"text" AND hasReviews:true AND (subjectName:"influenza" OR subjectName:"zika")'
);
});

Expand Down

0 comments on commit 3f668bf

Please sign in to comment.