diff --git a/backend/src/schema/resolvers/searches.js b/backend/src/schema/resolvers/searches.js index 1005f6576..7f1eeecee 100644 --- a/backend/src/schema/resolvers/searches.js +++ b/backend/src/schema/resolvers/searches.js @@ -10,9 +10,9 @@ export default { .replace(/\s+/g, ' ') .replace(/[[@#:*~\\$|^\]?/"'(){}+?!,.-]/g, '') .split(' ') - .map(s => s.toLowerCase().match(/^(not|and|or)$/)? '"' + s + '"' : s + '*') + .map(s => (s.toLowerCase().match(/^(not|and|or)$/) ? '"' + s + '"' : s + '*')) .join(' ') - //console.log(myQuery) + // console.log(myQuery) const postCypher = ` CALL db.index.fulltext.queryNodes('post_fulltext_search', $query) YIELD node as resource, score diff --git a/cypress/integration/search/Search.feature b/cypress/integration/search/Search.feature index bae30cd2a..e83f58477 100644 --- a/cypress/integration/search/Search.feature +++ b/cypress/integration/search/Search.feature @@ -24,7 +24,7 @@ Feature: Search | 101 Essays that will change the way you think | Scenario: Press enter starts search - When I type "Ess" and press Enter + When I type "Es" and press Enter Then I should have one item in the select dropdown Then I should see the following posts in the select dropdown: | title |