feat: Supports both tokenization by Elasticsearch analyzers and handling of nonsensical strings

This commit is contained in:
MomentQYC 2024-02-05 13:30:46 +08:00
parent 34380dccc2
commit 1b92ec0443
1 changed files with 9 additions and 1 deletions

View File

@ -301,7 +301,15 @@ export class SearchService {
query: {
bool: {
must: [
{ wildcard: { "text": { value: `*${q}*` }, } },
{
bool: {
should: [
{ wildcard: { "text": { value: `*${q}*` }, } },
{ simple_query_string: { fields:["text"], "query": q, default_operator: 'and', } },
],
minimum_should_match: 1,
},
},
esFilter,
]
},