Problem/Motivation

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"
          }
        }
      }
    }
  }
}

Steps to reproduce

N/A

Proposed resolution

Allow the analysis configuration to be provided in a pipeline yaml file:

my_pipeline:
  label: 'My Pipeline'
  destinationSettings:
    elasticsearch:
      settings:
          analysis:
            analyzer:
              my_analyzer:
                tokenizer: keyword
                char_filter:
                  - html_strip
      mappings:
...

Remaining tasks

Test coverage, reviews, etc

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nterbogt created an issue. See original summary.

nterbogt credited jibran.

nterbogt credited mstrelan.

nterbogt’s picture

Adding contributors from previous issue.

nterbogt’s picture

Issue summary: View changes
nterbogt’s picture

Assigned: nterbogt » Unassigned
Status: Active » Needs review

Can I please have a review of this one?

nterbogt credited mortim07.

nterbogt’s picture

  • nterbogt committed b64517aa on 2.x
    Issue #3512930 by nterbogt, jibran, mstrelan, mortim07: Allow analyzers...

  • nterbogt committed 5f725a7a on 1.x
    Issue #3512930 by nterbogt, jibran, mstrelan, mortim07: Allow analyzers...
nterbogt’s picture

Status: Needs review » Fixed

This is now fixed. It will be rolled out in the next release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.