mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
elastic: support fuzzy matching
This commit is contained in:
1 file changed
+1
-1
@@ -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'],
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user