diff --git a/api/resolvers/item.js b/api/resolvers/item.js index fe4bf447..6352ca10 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -286,7 +286,7 @@ export default { type: 'most_fields', fields: ['title^20', 'text'], minimum_should_match: '100%', - boost: 40 + boost: 400 } }, { @@ -298,7 +298,7 @@ export default { fuzziness: 'AUTO', prefix_length: 3, minimum_should_match: '100%', - boost: 2 + boost: 20 } }, { @@ -308,6 +308,7 @@ export default { type: 'most_fields', fields: ['title^20', 'text'], fuzziness: 'AUTO', + prefix_length: 3, minimum_should_match: '60%' } } diff --git a/components/item.js b/components/item.js index 566d9224..d24e3abc 100644 --- a/components/item.js +++ b/components/item.js @@ -9,7 +9,7 @@ import Pin from '../svgs/pushpin-fill.svg' import reactStringReplace from 'react-string-replace' function SearchTitle ({ title }) { - return reactStringReplace(title, /:high\[(.+)\]/g, (match, i) => { + return reactStringReplace(title, /:high\[([^\]]+)\]/g, (match, i) => { return {match} }) }