[ELASTIC-23] Create Index: Character Filters defined for an Analyzer are missing Created: 16/Feb/22  Updated: 16/Feb/22

Status: Open
Project: Elasticsearch
Component/s: None
Affects Version/s: 1.0.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: wolf bubenik Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Magnolia 6.2.15
Java 11
ES 7.13


Attachments: PNG File rich-text-standard-analyser.png    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

Steps to reproduce

  1. define an analyzer with a character filter
  2. create the index
  3. check the created index settings on ES

Expected results

The character filters should be included in the analyzer index settings on the ES server

Actual results

The character filters are not sent to the ES server when building the index.

Workaround

Development notes

Implementation of AnalyzerItemDefinitionConfiguration does not match current node structure: Character filters are sub-nodes of node "charFilter", not multi-value properties.



 Comments   
Comment by wolf bubenik [ 16/Feb/22 ]

Proposal for a fix:

public void setCharFilters(Node node) throws ElasticConfigurationException {
    this.charFilters = new ArrayList();
    // The original implementation does not match the current node structure: Filters are sub-nodes, not properties!
    try {
        if (node.hasNode("charFilter")) {
            Iterable<Node> filterNodes = NodeUtil.getNodes(node.getNode("charFilter"), NodeTypes.ContentNode.NAME);
            for (Node filter : filterNodes) {
                String filterName = PropertyUtil.getString(filter, "charFilter");
                if (isNotBlank(filterName)) {
                    this.charFilters.add(filterName);
                }
            }
        }
    } catch (RepositoryException var6) {
        throw new ElasticConfigurationException("query-exception.unable_char_filters", var6, log);
    }
} 
Generated at Mon Feb 12 01:46:32 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.