[
https://issues.apache.org/jira/browse/OAK-12509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Thomas Mueller updated OAK-12509:
---------------------------------
Component/s: (was: indexin)
> Index-tag validation rejects hyphenated values, unlike index names
> ------------------------------------------------------------------
>
> Key: OAK-12509
> URL: https://issues.apache.org/jira/browse/OAK-12509
> Project: Jackrabbit Oak
> Issue Type: Task
> Components: indexing
> Affects Versions: 1.2.22
> Reporter: Paul Chibulcuteanu
> Priority: Minor
>
> Hyphenated index names work for explicit index selection, but hyphenated
> index tags fail—even when quoted or bracket-delimited.
> The index definition includes:
> "tags": ["personalization", "pages", "semantic-pages"]
> Using the same query, the following options succeed:
> OPTION(INDEX NAME [damAssetLucene-12-custom-1])
> OPTION(INDEX TAG [pages])
> However, selecting the configured hyphenated tag fails:
> OPTION(INDEX TAG [semantic-pages])
> Expected behavior
> Configured hyphenated index tags should be usable for index selection,
> consistently with support for hyphenated index names.
> Actual behavior / cause
> Index-tag values undergo additional validation in SQL2Parser.readLabel() ,
> allowing only letters, digits, and underscores ( [a-zA-Z0-9_]* ). Quoting
> does not bypass this validation. Index names use readName() without this
> additional restriction.
> Source:
> https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
> Impact
> A hyphenated tag can exist in an index definition but cannot be used to
> select that index. Workarounds include adding an underscore-based tag or
> selecting the index by name.
> The restriction is currently documented; this requests aligning index-tag
> handling with index-name handling, rather than reporting a confirmed
> regression.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)