Benjamin Habegger created OAK-12360:
---------------------------------------

             Summary: Support per-property analyzers in Lucene index definitions
                 Key: OAK-12360
                 URL: https://issues.apache.org/jira/browse/OAK-12360
             Project: Jackrabbit Oak
          Issue Type: Improvement
          Components: oak-search, lucene
            Reporter: Benjamin Habegger


Today, an {{oak:index}} Lucene definition can declare a custom analyzer only 
under {{analyzers/default}}. Any other analyzer configured under 
{{analyzers/<name>}} is silently ignored.

This means there is currently no way to apply a different analyzer (different 
tokenizer, stemmer, or stopword list — e.g. for a specific language) to an 
individual property while keeping the default analyzer for the rest of the 
index's fields.

h3. Requested change

Allow a property definition to reference a specific analyzer (declared 
alongside {{analyzers/default}}), so different properties in the same index can 
be tokenized differently. Properties that don't opt in must keep today's 
behavior unchanged — fully backward compatible, no migration needed for 
existing index definitions.

h3. Known limitations (explicitly out of scope for this ticket)

* The aggregated {{:fulltext}} field (used by {{CONTAINS(*, ...)}}) collects 
raw text from every {{nodeScopeIndex=true}} property into one shared field, 
re-analyzed with a single analyzer — per-property analyzers can't differentiate 
text once merged into {{:fulltext}}.
* Regular-expression property definitions — since the rule matches a different 
concrete property per node, there's no single property to attach a custom 
analyzer to.

Both fall back to the default analyzer with a logged warning and will be 
documented as known limitations.

h3. Out of scope for this ticket

* Elasticsearch provider ({{oak-search-elastic}}) — tracked separately.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to