# Where's the docs for us "mere mortals"?

**URL:** <https://discuss.elastic.co/t/wheres-the-docs-for-us-mere-mortals/357660>\
**Category:** Elasticsearch\
**Tags:** ingest-pipeline\
**Created:** [April 17, 2024, 11:16pm UTC](https://discuss.elastic.co/t/wheres-the-docs-for-us-mere-mortals/357660 "2024-04-17T23:16:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![flatlander](https://avatars.discourse-cdn.com/v4/letter/f/278dde/32.png) [@flatlander](https://discuss.elastic.co/u/flatlander)\
**Post date:** [April 17, 2024, 11:16pm UTC](https://discuss.elastic.co/t/wheres-the-docs-for-us-mere-mortals/357660/1 "2024-04-17T23:16:29Z")

</div>

Hello,

First time poster. Please don't bite my head off, or tell me to Let Me Google That For You! I've genuinely struggled finding a good source of documentation for ingest pipeline syntax that's actually helpful to me. And I do heavily use the [elastic.co](http://elastic.co) site, but they sure could use a lot more example code for some different use cases.

Where can I find, under one roof, the operators such as these?

myfield. **contains**  
myfield. **length**  
myfield. **startsWith**  
myfield. **splitOnToken**

Thank you very much in advance!

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [April 17, 2024, 11:36pm UTC](https://discuss.elastic.co/t/wheres-the-docs-for-us-mere-mortals/357660/2 "2024-04-17T23:36:11Z")

</div>

Hi @flatlander

There is this doc that talks a little about splitOntoken: [Ingest processor context | Painless Scripting Language [8.13] | Elastic](https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-ingest-processor-context.html)

I would use [scripts](https://www.elastic.co/guide/en/elasticsearch/reference/8.13/script-processor.html) in your scenario (I'm not sure if there is a processor for each of the options you mentioned), as below:

```auto
POST /_ingest/pipeline/_simulate
{
  "pipeline" :
  {
    "description": "use contains",
    "processors": [
      {
        "script": {
          "lang": "painless",
          "source": """
          if(ctx.foo.contains('bar')) {
            ctx.exists = true;
          }
          """
        }
      },
      {
        "script": {
          "lang": "painless",
          "source": """
            ctx.foo_length = ctx.foo.length();
          """
        }
      },
      {
        "script": {
          "lang": "painless",
          "source": """
            ctx.starts_with = ctx.foo.startsWith("bar");
          """
        }
      },
      {
        "script": {
          "lang": "painless",
          "source": """
            def arr = ctx.foo.splitOnToken("-");
            ctx.new_field_foo = arr[0];
            ctx.new_field_bar = arr[1];
          """
        }
      }
    ]
  },
  "docs": [
    {
      "_index": "index",
      "_id": "id",
      "_source": {
        "foo": "bar-foo"
      }
    }
  ]
}

```
