refine search

This commit is contained in:
keyan 2022-02-03 16:29:48 -06:00
parent e18ca2fee8
commit 7d088cdd0b
2 changed files with 4 additions and 3 deletions

View File

@ -286,7 +286,7 @@ export default {
type: 'most_fields', type: 'most_fields',
fields: ['title^20', 'text'], fields: ['title^20', 'text'],
minimum_should_match: '100%', minimum_should_match: '100%',
boost: 40 boost: 400
} }
}, },
{ {
@ -298,7 +298,7 @@ export default {
fuzziness: 'AUTO', fuzziness: 'AUTO',
prefix_length: 3, prefix_length: 3,
minimum_should_match: '100%', minimum_should_match: '100%',
boost: 2 boost: 20
} }
}, },
{ {
@ -308,6 +308,7 @@ export default {
type: 'most_fields', type: 'most_fields',
fields: ['title^20', 'text'], fields: ['title^20', 'text'],
fuzziness: 'AUTO', fuzziness: 'AUTO',
prefix_length: 3,
minimum_should_match: '60%' minimum_should_match: '60%'
} }
} }

View File

@ -9,7 +9,7 @@ import Pin from '../svgs/pushpin-fill.svg'
import reactStringReplace from 'react-string-replace' import reactStringReplace from 'react-string-replace'
function SearchTitle ({ title }) { function SearchTitle ({ title }) {
return reactStringReplace(title, /:high\[(.+)\]/g, (match, i) => { return reactStringReplace(title, /:high\[([^\]]+)\]/g, (match, i) => {
return <mark key={`mark-${match}`}>{match}</mark> return <mark key={`mark-${match}`}>{match}</mark>
}) })
} }