I need to implement custom char_filter (mapping), How do I this?
I think It should be simple as editing elasticsuite_analysis.xml,
<char_filters>
<char_filter name="html_strip" type="html_strip" language="default"/>
<char_filter name="custom_mapper" type="mappings" language="default">
<mappings>["x => y", "a => b"]</<mappings>
</char_filter>
</char_filters>
Any help appreciate :)
Hello @sdasun
yes it should, although I did not test with mappings. Did you try your solution ? is it triggering an error ?
Regards
I tried, I got this error. (Please note, I did have Unicode character in this xml file. I will double check it tonight and let you know.)
Premature end of data in tag analysis line 19
Line: 248
{"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): Invalid XML in file /usr/share/ngin
x/html/vendor/smile/elasticsuite/src/module-elasticsuite-core/etc/elasticsuite_analysis.xml:
expected '>'
Line: 25
Opening and ending tag mismatch: mappings line 25 and unparseable
Line: 25
Opening and ending tag mismatch: mappings line 25 and char_filter
Line: 26
expected '>'
Line: 27
Opening and ending tag mismatch: char_filters line 22 and analysis
Line: 246
Premature end of data in tag analysis line 19
Actually you have a typo at the closing "
I will try to go further by myself.
Ok so I tried with the following syntax :
<char_filters>
<char_filter name="html_strip" type="html_strip" language="default"/>
<char_filter name="custom_mapper" type="mapping" language="default">
<mappings>["x => y", "a => b"]</mappings>
</char_filter>
</char_filters>
Please note the "type=mapping" without the S.
And ran a reindex. Mapping is shown in Elasticsearch like this :
"char_filter": {
"custom_mapper": {
"type": "mapping",
"mappings": [
"x => y",
"a => b"
]
},
"html_strip": {
"type": "html_strip"
}
}
Sounds like everything is working as expected :)
I close the issue then, feel free to reopen it if more details needed.
Regards
Most helpful comment
Ok so I tried with the following syntax :
Please note the "type=mapping" without the S.
And ran a reindex. Mapping is shown in Elasticsearch like this :
Sounds like everything is working as expected :)
I close the issue then, feel free to reopen it if more details needed.
Regards