- Issue created by @mstrelan
- last update
about 1 year ago 69 pass - last update
about 1 year ago 69 pass - Status changed to Needs work
about 1 year ago 6:05am 21 November 2023
Use case: we need to store HTML data in a field, and perform search filters and sorts on the same field, ignoring the HTML characters.
This can be achieved in elasticsearch by adding an analyzer, for example:
{
"settings": {
"analysis": {
"analyzer": {
"my_analyzer": {
"tokenizer": "keyword",
"char_filter": ["html_strip"]
}
}
}
},
"mappings": {
"properties": {
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
},
"plain_text": {
"type": "text",
"analyzer": "my_analyzer"
}
}
}
}
}
}
N/A
Allow the analysis
configuration to be provided in a pipeline yaml file:
my_pipeline:
label: 'My Pipeline'
class: '\Drupal\data_pipelines_elasticsearch\ElasticSearchDatasetPipeline'
analysis:
analyzer:
my_analyzer:
tokenizer: keyword
char_filter:
- html_strip
mappings:
properties:
name:
type: text
fields:
keyword:
type: keyword
plain_text:
type: text
analyzer: my_analyzer
Test coverage, reviews, etc
Needs work
1.0
Code