elastic: support fuzzy matching

This commit is contained in:
undefined committed 2024-05-12 17:33:36 +08:00
1 parent 19fd8b13ab
commit 2df9435eb7
1 file changed
+1 -1
+1 -1
View File
@@ -27,7 +27,7 @@ global.Hydro.lib.problemSearch = async (domainId, q, opts) => {
from,
query: {
simple_query_string: {
query: q,
query: q.replace(/([a-z0-9]{2,})/gi, (i) => `${i}~5`),
fields: ['tag^5', 'pid^4', 'title^3', 'content'],
},
},