You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
no_sub_matches (Optional, Boolean, default false): excludes subwords
that are fully contained within another matched subword (e.g., excludes ball if fußball also matched). Available in OpenSearch 2.17 and later.
no_overlapping_matches (Optional, Boolean, default false): excludes
subwords that overlap with another matched subword. The most restrictive
of the three matching options. Available in OpenSearch 2.17 and later.
Plus a note that typically only one of the three flags is enabled, because
a more restrictive option makes the less restrictive ones redundant.
The only_longest_match description is misleading. It currently reads
"Only includes the longest subword in the generated tokens." Per the underlying
Lucene implementation, the flag keeps the longest dictionary match per
hyphenation start point; subwords starting at other hyphenation points are
still emitted, so overlapping subwords still occur. It does not select a single
longest decomposition of the whole word.
Reproduction for both points: analyzing the German input kurzehose using the
German decompounding resources from https://github.com/uschindler/german-decompounder emits the subwords kurz, zeh, hose — with identical output for only_longest_match: true and false,
because each match starts at a different hyphenation point. The overlapping token zeh ("toe") causes search false positives; no_overlapping_matches: true is the setting that fixes it, but users cannot
discover it from the current docs.
I'm happy to open a PR with the table changes.
Version: 2.17 and later (parameters introduced in 2.17.0; the only_longest_match wording issue applies to all versions)
Testing: POST /_analyze with a hyphenation_decompounder filter on input kurzehose (German patterns + dictionary), comparing output with each of the three flags enabled
What do you want to do?
Tell us about your request.
Page: https://docs.opensearch.org/latest/analyzers/token-filters/hyphenation-decompounder/
Two related problems on this page:
Two supported parameters are undocumented. The
hyphenation_decompoundertoken filter accepts
no_sub_matchesandno_overlapping_matchessinceOpenSearch 2.17.0 (Adding access to noSubMatches and noOverlappingMatches in Hyphenation… OpenSearch#13895), but the parameter
table only lists
only_longest_match. Suggested rows:no_sub_matches(Optional, Boolean, defaultfalse): excludes subwordsthat are fully contained within another matched subword (e.g., excludes
balliffußballalso matched). Available in OpenSearch 2.17 and later.no_overlapping_matches(Optional, Boolean, defaultfalse): excludessubwords that overlap with another matched subword. The most restrictive
of the three matching options. Available in OpenSearch 2.17 and later.
a more restrictive option makes the less restrictive ones redundant.
The
only_longest_matchdescription is misleading. It currently reads"Only includes the longest subword in the generated tokens." Per the underlying
Lucene implementation, the flag keeps the longest dictionary match per
hyphenation start point; subwords starting at other hyphenation points are
still emitted, so overlapping subwords still occur. It does not select a single
longest decomposition of the whole word.
Reproduction for both points: analyzing the German input
kurzehoseusing theGerman decompounding resources from
https://github.com/uschindler/german-decompounder emits the subwords
kurz,zeh,hose— with identical output foronly_longest_match: trueandfalse,because each match starts at a different hyphenation point. The overlapping token
zeh("toe") causes search false positives;no_overlapping_matches: trueis the setting that fixes it, but users cannotdiscover it from the current docs.
I'm happy to open a PR with the table changes.
Version: 2.17 and later (parameters introduced in 2.17.0; the
only_longest_matchwording issue applies to all versions)What other resources are available?
POST /_analyzewith ahyphenation_decompounderfilter on inputkurzehose(German patterns + dictionary), comparing output with each of the three flags enabledfilter; README recommends
only_longest_match: true):https://github.com/uschindler/german-decompounder