# Can split processor address a multi-field?

**URL:** <https://discuss.elastic.co/t/can-split-processor-address-a-multi-field/221601>\
**Category:** Elasticsearch\
**Created:** [March 1, 2020, 9:49pm UTC](https://discuss.elastic.co/t/can-split-processor-address-a-multi-field/221601 "2020-03-01T21:49:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohanP](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@JohanP](https://discuss.elastic.co/u/JohanP)\
**Post date:** [March 1, 2020, 9:49pm UTC](https://discuss.elastic.co/t/can-split-processor-address-a-multi-field/221601/1 "2020-03-01T21:49:07Z")

</div>

Using the split processor as documented in my earlier topic:

> [@Can I apply split processor on more than one field?](https://discuss.elastic.co/t/can-i-apply-split-processor-on-more-than-one-field/220040/2):
>
> What about this? PUT \_ingest/pipeline/split1 { "processors": [{ "split": { "field": "q5", "separator": "[a-z][.] " } }, { "split": { "field": "q6", "separator": "[a-z][.] " } } ] }

Now I would like to be able to specify a multi-field as the field to write to:

```
PUT 51
{
  "mappings": {
    "properties": {
      "q3.read": {
        "type": "boolean"
      },
      "q3.write": {
        "type": "boolean"
      },
      "q3.rw": {
        "type": "text"
      }
    }
  }
}

PUT 510
    {
      "mappings": {
        "properties": {
          "q3.read": {
            "type": "boolean"
          },
          "q3.write": {
            "type": "boolean"
          },
          "q3.rw": {
            "type": "keyword"
          }
        }
      }
    }

    PUT _ingest/pipeline/split5
    {
      "description": "Convert string with multipe choices a. b. c. etc into array. Split on a. b. etc", 
      "processors": [
        {
          "split": {
            "field": "q3.rw",
            "separator": "[a-z][.] ",
            "ignore_missing": true
          }
        }
      ]
    }

    POST _reindex
    {
      "source": {
        "index": "51"
      },
      "dest": {
        "index": "510",
        "pipeline": "split5"
      }
    }

    GET 510/_search

    "hits" : {
        "total" : {
          "value" : 10,
          "relation" : "eq"
        },
        "max_score" : 1.0,
        "hits" : [
          {
            "_index" : "510",
            "_type" : "_doc",
            "_id" : "g8DOlnABCGRif5cq89_l",
            "_score" : 1.0,
            "_source" : {
              "q3.write" : "true",
              "q3.rw" : "a. Read b. Write",
              "q3.read" : "true"
            }
          },

```

But as you can see, the q3.rw field seems unprocessed by the pipeline.  
No error messages in log.  
Are multi-fields not supported by the split processor?

---

<div class="post-metadata">

**Author:** ![JohanP](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@JohanP](https://discuss.elastic.co/u/JohanP)\
**Post date:** [March 3, 2020, 8:30pm UTC](https://discuss.elastic.co/t/can-split-processor-address-a-multi-field/221601/2 "2020-03-03T20:30:45Z")

</div>

Sorry if I have not been clear enough...

Yes the earlier proposed solution works for the issue described in that post, i.e for fields of type:  
"split": {  
"field": "q3"

In this one there are fields of the following type:  
"split": {  
"field": "q3.rw"

, and that's what is not working.

---

<div class="post-metadata">

**Author:** ![JohanP](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@JohanP](https://discuss.elastic.co/u/JohanP)\
**Post date:** [March 3, 2020, 9:15pm UTC](https://discuss.elastic.co/t/can-split-processor-address-a-multi-field/221601/3 "2020-03-03T21:15:31Z")

</div>

I see that I made a mistake. Troubleshooted by using the \_simulate endpoint, which worked out fine....!

My bulk indexing was not correctly formatted for multi-fields.  
index with  
`{"q3.rw"....`  
instead of  
`{"q3": { "rw".....`

correct:

```
POST 51/_bulk
{"index": {"_id": 12}}
{"q3": { "rw": "a. I live alone f. I live with my friends g. Hejsan"}}

```

, so my indata was the problem.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 31, 2020, 9:15pm UTC](https://discuss.elastic.co/t/can-split-processor-address-a-multi-field/221601/4 "2020-03-31T21:15:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
