optimize cleanup search query shop api extends
This commit is contained in:
@@ -275,6 +275,86 @@ final class CommerceQueryParserConfig
|
||||
return '/\b(?:indikator|indicator|reagenz|reagent|kit|set)\s+\d{1,5}[a-z0-9\-]*\b/u';
|
||||
}
|
||||
|
||||
public function getContainsDigitPattern(): string
|
||||
{
|
||||
return '/\d/u';
|
||||
}
|
||||
|
||||
public function getModelNumberTokenPattern(): string
|
||||
{
|
||||
return '/^(?:\d{2,5}[a-z0-9\-]*|[a-z]{1,6}\d{1,5}[a-z0-9\-]*)$/u';
|
||||
}
|
||||
|
||||
public function getModelContextTokenPattern(): string
|
||||
{
|
||||
return '/^[\p{L}][\p{L}0-9®\-]{2,}$/u';
|
||||
}
|
||||
|
||||
public function getModelSuffixTokenPattern(): string
|
||||
{
|
||||
return '/^[a-z]{1,4}\d{0,3}$/u';
|
||||
}
|
||||
|
||||
public function getModelContextTokenWindow(): int
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function getMinMeaningfulAlphaTokenLength(): int
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function getMaxShopSearchTokens(): int
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
|
||||
public function getInstructionOrPresentationTokenPattern(): string
|
||||
{
|
||||
return '/^(?:zeig(?:e)?|such(?:e)?|find(?:e)?|gib|gebe|nenn(?:e)?|liefer(?:e)?|erstelle?|mach(?:e)?|brauch(?:e)?|will|möchte|moechte|hätte|haette|kannst|bitte|mal|alle|alles|komplett|vollständig|vollstaendig|gesamt|ganze|ganzen|liste|listung|auflistung|tabelle|tabellarisch|übersicht|uebersicht|anzeigen?|ausgeben?|darstellen?|antwort(?:e)?|erklär(?:e)?|erklaer(?:e)?|info|infos|informationen|dazu|hierzu|damit|davon|an|als|mit|ohne|inkl|inklusive)$/u';
|
||||
}
|
||||
|
||||
/**
|
||||
* Product/category tokens that are useful for Store API search even when they are not next to a model number.
|
||||
* This is intentionally a semantic allowlist, not a spelling-error blocklist.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getSemanticShopSearchTokens(): array
|
||||
{
|
||||
return [
|
||||
'indikator',
|
||||
'indicator',
|
||||
'reagenz',
|
||||
'reagent',
|
||||
'zubehör',
|
||||
'zubehor',
|
||||
'ersatzteil',
|
||||
'verbrauchsmaterial',
|
||||
'kit',
|
||||
'set',
|
||||
'filter',
|
||||
'pumpe',
|
||||
'pumpenkopf',
|
||||
'motorblock',
|
||||
'lösung',
|
||||
'loesung',
|
||||
'solution',
|
||||
'teststreifen',
|
||||
'gerät',
|
||||
'geraet',
|
||||
'messgerät',
|
||||
'messgeraet',
|
||||
'analysegerät',
|
||||
'analysegeraet',
|
||||
'analysator',
|
||||
'monitor',
|
||||
'controller',
|
||||
'system',
|
||||
];
|
||||
}
|
||||
|
||||
public function buildExactTokenRemovalPattern(string $token): string
|
||||
{
|
||||
return '/\b' . preg_quote($token, '/') . '\b/u';
|
||||
|
||||
Reference in New Issue
Block a user